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

Foivos duke at openjdk.java.net
Fri Feb 18 19:24:28 UTC 2022


https://github.com/openjdk/jdk/commit/7cc137105928ec109a29d9315565f7f49af3cf2b 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.

-------------

Commit messages:
 - Fix handling of hidden classes in MetaUtil
 - Test MetaUtil methods toInternalName & internalNameToJava

Changes: https://git.openjdk.java.net/jdk/pull/7346/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7346&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8281266
  Stats: 33 lines in 2 files changed: 8 ins; 5 del; 20 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7346.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7346/head:pull/7346

PR: https://git.openjdk.java.net/jdk/pull/7346


More information about the hotspot-compiler-dev mailing list