Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8281266: [JVMCI] MetaUtil.toInternalName() doesn't handle hidden classes correctly #7346

Closed
wants to merge 2 commits into from

Conversation

zakkak
Copy link
Contributor

@zakkak zakkak commented Feb 4, 2022

7cc1371 introduced hidden classes with internal names like com/example/Foo.1234 that get changed to com.example.Foo/1234 by Class.getName() which are not properly handled by MetaUtil's toInternalName and internalNameToJava

This PR fixes this along with the corresponding test that used to work on the assumption that the internal class names didn't contain the . character and that java class names didn't contain the / character except for lambdas (which are now treated as hidden classes as well), an assumption that no longer holds.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8281266: [JVMCI] MetaUtil.toInternalName() doesn't handle hidden classes correctly

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/7346/head:pull/7346
$ git checkout pull/7346

Update a local copy of the PR:
$ git checkout pull/7346
$ git pull https://git.openjdk.java.net/jdk pull/7346/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 7346

View PR using the GUI difftool:
$ git pr show -t 7346

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/7346.diff

Removes the previous test that was comparing the internal name's suffix
that returned by toJavaName().

As of 7cc1371
InnerClassLambdaMetafactory is generating hidden classes instead of
anonymous ones for lambdas and in hidden classes the internal name's
suffix needs to be converted. E.g. Foo$$Lambda$217.0x0000000800d40df0 in
com/example/Foo$$Lambda$217.0x0000000800d40df0 needs to become
Foo$$Lambda$217/0x0000000800d40df0, while previously it was already
Foo$$Lambda$217/0x0000000800d40df0
@bridgekeeper bridgekeeper bot added the oca Needs verification of OCA signatory status label Feb 4, 2022
@bridgekeeper
Copy link

bridgekeeper bot commented Feb 4, 2022

Hi @zakkak, welcome to this OpenJDK project and thanks for contributing!

We do not recognize you as Contributor and need to ensure you have signed the Oracle Contributor Agreement (OCA). If you have not signed the OCA, please follow the instructions. Please fill in your GitHub username in the "Username" field of the application. Once you have signed the OCA, please let us know by writing /signed in a comment in this pull request.

If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please use "Add GitHub user zakkak" as summary for the issue.

If you are contributing this work on behalf of your employer and your employer has signed the OCA, please let us know by writing /covered in a comment in this pull request.

@zakkak
Copy link
Contributor Author

zakkak commented Feb 4, 2022

/covered

@bridgekeeper bridgekeeper bot added the oca-verify Needs verification of OCA signatory status label Feb 4, 2022
@bridgekeeper
Copy link

bridgekeeper bot commented Feb 4, 2022

Thank you! Please allow for a few business days to verify that your employer has signed the OCA. Also, please note that pull requests that are pending an OCA check will not usually be evaluated, so your patience is appreciated!

@openjdk
Copy link

openjdk bot commented Feb 4, 2022

@zakkak The following label will be automatically applied to this pull request:

  • hotspot-compiler

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Feb 4, 2022
@jerboaa
Copy link
Contributor

jerboaa commented Feb 4, 2022

@zakkak Works for Red Hat is covered by the RH OCA.

@jerboaa
Copy link
Contributor

jerboaa commented Feb 4, 2022

I've created a bug for this here: https://bugs.openjdk.java.net/browse/JDK-8281266

@jerboaa
Copy link
Contributor

jerboaa commented Feb 4, 2022

I've created a bug for this here: https://bugs.openjdk.java.net/browse/JDK-8281266

@zakkak If you update the PR title to the bug synopsis the bots should add the issue just fine. I.e. change it to:

8281266: [JVMCI] MetaUtil.toInternalName() doesn't handle hidden classes correctly

@zakkak zakkak changed the title Fix handling of hidden classes in MetaUtil 8281266: [JVMCI] MetaUtil.toInternalName() doesn't handle hidden classes correctly Feb 7, 2022
@jerboaa
Copy link
Contributor

jerboaa commented Feb 16, 2022

@robilad Could someone look at the OCA verification status for @zakkak please?

@robilad
Copy link

robilad commented Feb 18, 2022

Done, thanks for the ping!

@bridgekeeper bridgekeeper bot removed oca Needs verification of OCA signatory status oca-verify Needs verification of OCA signatory status labels Feb 18, 2022
@openjdk openjdk bot added the rfr Pull request is ready for review label Feb 18, 2022
@mlbridge
Copy link

mlbridge bot commented Feb 18, 2022

Webrevs

@jerboaa
Copy link
Contributor

jerboaa commented Feb 21, 2022

Done, thanks for the ping!

Thanks, Dalibor!

Copy link
Contributor

@jerboaa jerboaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine to me. Perhaps @dougxc or @tkrodriguez want to have a look at this too?

@openjdk
Copy link

openjdk bot commented Mar 7, 2022

⚠️ @zakkak the full name on your profile does not match the author name in this pull requests' HEAD commit. If this pull request gets integrated then the author name from this pull requests' HEAD commit will be used for the resulting commit. If you wish to push a new commit with a different author name, then please run the following commands in a local repository of your personal fork:

$ git checkout fix-mandrel-355-v3
$ git commit --author='Preferred Full Name <you@example.com>' --allow-empty -m 'Update full name'
$ git push

@openjdk
Copy link

openjdk bot commented Mar 7, 2022

@zakkak 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:

8281266: [JVMCI] MetaUtil.toInternalName() doesn't handle hidden classes correctly

Reviewed-by: sgehwolf, dnsimon

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 344 new commits pushed to the master branch:

  • c6d743f: 8282770: Set source date in jib profiles from buildId
  • 5fab27e: 8282144: RandomSupport.convertSeedBytesToLongs sign extension overwrites previous bytes
  • 65ca0a5: 8276333: jdk/jfr/event/oldobject/TestLargeRootSet.java failed "assert(!contains(edge->reference())) failed: invariant"
  • e607287: 8282728: Serial: Remove unused BlockOffsetArray::Action
  • 8b45dbd: 8282312: Minor corrections to evbroadcasti32x4 intrinsic on x86
  • 3f0684d: 8275775: Add jcmd VM.classes to print details of all classes
  • cde923d: 8282690: runtime/CommandLine/VMDeprecatedOptions.java fails after JDK-8281181
  • 50eb915: 8282632: Cleanup unnecessary calls to Throwable.initCause() in java.security.jgss
  • ccad392: 8282657: Code cleanup: removing double semicolons at the end of lines
  • 5d5bf16: 8282567: Improve source-date handling in build system
  • ... and 334 more: https://git.openjdk.java.net/jdk/compare/5ab22e88da8d79f9e19e8afffdd06206f42bab94...master

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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@jerboaa, @dougxc) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Mar 7, 2022
7cc1371 introduced hidden classes with
internal names like com/example/Foo.1234 that get changed to
com.example.Foo/1234 by Class.getName() which are not properly handled
by MetaUtil's toInternalName and internalNameToJava
Copy link
Contributor

@jerboaa jerboaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still good.

@zakkak
Copy link
Contributor Author

zakkak commented Mar 8, 2022

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Mar 8, 2022
@openjdk
Copy link

openjdk bot commented Mar 8, 2022

@zakkak
Your change (at version f0ac427) is now ready to be sponsored by a Committer.

@jerboaa
Copy link
Contributor

jerboaa commented Mar 8, 2022

/sponsor

@openjdk
Copy link

openjdk bot commented Mar 8, 2022

Going to push as commit 0cbc4b8.
Since your change was applied there have been 345 commits pushed to the master branch:

  • 0f88fc1: 8282769: BSD date cannot handle all ISO 8601 formats
  • c6d743f: 8282770: Set source date in jib profiles from buildId
  • 5fab27e: 8282144: RandomSupport.convertSeedBytesToLongs sign extension overwrites previous bytes
  • 65ca0a5: 8276333: jdk/jfr/event/oldobject/TestLargeRootSet.java failed "assert(!contains(edge->reference())) failed: invariant"
  • e607287: 8282728: Serial: Remove unused BlockOffsetArray::Action
  • 8b45dbd: 8282312: Minor corrections to evbroadcasti32x4 intrinsic on x86
  • 3f0684d: 8275775: Add jcmd VM.classes to print details of all classes
  • cde923d: 8282690: runtime/CommandLine/VMDeprecatedOptions.java fails after JDK-8281181
  • 50eb915: 8282632: Cleanup unnecessary calls to Throwable.initCause() in java.security.jgss
  • ccad392: 8282657: Code cleanup: removing double semicolons at the end of lines
  • ... and 335 more: https://git.openjdk.java.net/jdk/compare/5ab22e88da8d79f9e19e8afffdd06206f42bab94...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Mar 8, 2022
@openjdk openjdk bot closed this Mar 8, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Mar 8, 2022
@openjdk
Copy link

openjdk bot commented Mar 8, 2022

@jerboaa @zakkak Pushed as commit 0cbc4b8.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@zakkak zakkak deleted the fix-mandrel-355-v3 branch March 8, 2022 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

4 participants