8299183: Invokers.checkExactType passes parameters to create WMTE in opposite order#11870
8299183: Invokers.checkExactType passes parameters to create WMTE in opposite order#11870mlchung wants to merge 4 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back mchung! A progress list of the required criteria for merging this PR into |
Webrevs
|
irisclark
left a comment
There was a problem hiding this comment.
Parameter order for method invocation now matches method declaration on line 521.
|
@mlchung This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 55 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
|
Hello Mandy, this looks good to me. The copyright year on the file will need an update. There's another call to this if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
+ ad.symbolicMethodTypeExact);
}Should it instead say: if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
throw new WrongMethodTypeException("expected " + ad.symbolicMethodTypeExact + " but found "
+ handle.accessModeType(ad.type));
} |
|
@jaikiran good observation. "expected" and "actual" parameters are confusing. "expected" is ambiguous and it could refer to handle's method type or symbolic type descriptor. I decide to rename the parameters and the exception message for clarity. |
jaikiran
left a comment
There was a problem hiding this comment.
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@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)| * This code is free software; you can redistribute it and/or modify it | ||
| * under the terms of the GNU General Public License version 2 only, as | ||
| * published by the Free Software Foundation. Oracle designates this | ||
| * particular file as subject to the "Classpath" exception as provided |
There was a problem hiding this comment.
From what I understand, the copyright notice on test files don't use the "Classpath" exception and instead use a different copyright notice.
There was a problem hiding this comment.
That's correct. Thanks for catching it. This reveals that the copyright header of several test/jdk/java/lang/invoke tests will need clean up (as this new test was copied from an existing test). I will create a JBS issue for that.
jaikiran
left a comment
There was a problem hiding this comment.
Thank you Mandy for the changes. Looks good to me.
|
/integrate |
|
Going to push as commit a86b6f6.
Your commit was automatically rebased without conflicts. |
Trivial fix. Fix
Invokers.checkExactTypeto callnewWrongMethodTypeException(actual, expected)with parameters in right order.Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/11870/head:pull/11870$ git checkout pull/11870Update a local copy of the PR:
$ git checkout pull/11870$ git pull https://git.openjdk.org/jdk pull/11870/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 11870View PR using the GUI difftool:
$ git pr show -t 11870Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/11870.diff