RFR: 8299183: Invokers.checkExactType passes parameters to create WMTE in opposite order [v2]
Jaikiran Pai
jpai at openjdk.org
Sat Jan 7 10:49:51 UTC 2023
On Fri, 6 Jan 2023 21:15:38 GMT, Mandy Chung <mchung at openjdk.org> wrote:
>> Trivial fix. Fix `Invokers.checkExactType` to call `newWrongMethodTypeException(actual, expected)` with parameters in right order.
>
> Mandy Chung has updated the pull request incrementally with two additional commits since the last revision:
>
> - Add a regression test
> - further cleanup newWrongMethodTypeException for clarity
Thank you for the changes Mandy. Overall the error message looks more clear now.
There's a failing test in GitHub actions job which appears to be an existing test case which was expecting the older error message in the exception. That would need an update:
test VarHandleTestExact.testExactArraySet(class [Ljava.lang.Object;, "abcd", VarHandleTestExact$$Lambda$87/0x000000010015b1c0 at 2a9fbca4): failure
java.lang.AssertionError: 'handle's method type (Object[],int,Object)void but found (Object[],int,String)void' did not match the pattern '.*\\Qexpected (Object[],int,Object)void \\E.*'.
at VarHandleTestExact.assertMatches(VarHandleTestExact.java:214)
at VarHandleTestExact.doTest(VarHandleTestExact.java:199)
at VarHandleTestExact.testExactArraySet(VarHandleTestExact.java:153)
test/jdk/java/lang/invoke/WrongMethodTypeTest.java line 8:
> 6: * under the terms of the GNU General Public License version 2 only, as
> 7: * published by the Free Software Foundation. Oracle designates this
> 8: * particular file as subject to the "Classpath" exception as provided
>From what I understand, the copyright notice on test files don't use the "Classpath" exception and instead use a different copyright notice.
-------------
PR: https://git.openjdk.org/jdk/pull/11870
More information about the core-libs-dev
mailing list