JDK-8242012 : Drop the uniqueness guarantee from the suffix of the name of a hidden class
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang.invoke
  • Affected Version: 15
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2020-04-02
  • Updated: 2020-06-29
  • Resolved: 2020-04-10
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 15
15Fixed
Related Reports
Relates :  
Description
https://mail.openjdk.java.net/pipermail/valhalla-dev/2020-April/007056.html
Comments
This patch is folded into: http://cr.openjdk.java.net/~mchung/valhalla/webrevs/hidden-classes/webrev.06/
10-04-2020

Review Thread: https://mail.openjdk.java.net/pipermail/valhalla-dev/2020-April/007096.html
08-04-2020

See John's comment at https://mail.openjdk.java.net/pipermail/valhalla-dev/2020-April/007058.html Proposed patch: diff --git a/src/java.base/share/classes/java/lang/Class.java b/src/java.base/share/classes/java/lang/Class.java --- a/src/java.base/share/classes/java/lang/Class.java +++ b/src/java.base/share/classes/java/lang/Class.java @@ -799,8 +799,7 @@ * where {@code N} is the <a href="ClassLoader.html#binary-name">binary name</a> * indicated by the {@code class} file passed to * {@link java.lang.invoke.MethodHandles.Lookup#defineHiddenClass(byte[], boolean, MethodHandles.Lookup.ClassOption...) - * Lookup::defineHiddenClass} and {@code <suffix>} is an unqualified name - * that is guaranteed to be unique during this execution of the JVM. + * Lookup::defineHiddenClass}, and {@code <suffix>} is an unqualified name. * </ul> * * <p> If this {@code Class} object represents an array class, then diff --git a/src/java.base/share/classes/java/lang/invoke/MethodHandles.java b/src/java.base/share/classes/java/lang/invoke/MethodHandles.java --- a/src/java.base/share/classes/java/lang/invoke/MethodHandles.java +++ b/src/java.base/share/classes/java/lang/invoke/MethodHandles.java @@ -1781,8 +1781,7 @@ * denote a class or interface in the same package as the lookup class.</li> * * <li> Let {@code CN} be the string {@code N + "." + <suffix>}, - * where {@code <suffix>} is an unqualified name that is guaranteed to be unique - * during this execution of the JVM. + * where {@code <suffix>} is an unqualified name. * * <p> Let {@code newBytes} be the {@code ClassFile} structure given by * {@code bytes} with an additional entry in the {@code constant_pool} table,
07-04-2020