Test jdk/internal/util/ReferencedKeyTest.java fails when run with Valhalla migrated classes because it tries to create a WeakReference from an instance of java.lang.Long:
java.lang.IdentityException: java.lang.Long is not an identity class
at java.base/java.util.Objects.requireIdentity(Objects.java:212)
at java.base/java.lang.ref.Reference.<init>(Reference.java:515)
at java.base/java.lang.ref.WeakReference.<init>(WeakReference.java:78)
at java.base/jdk.internal.util.WeakReferenceKey.<init>(WeakReferenceKey.java:53)
at java.base/jdk.internal.util.ReferencedKeyMap.entryKey(ReferencedKeyMap.java:165)
at java.base/jdk.internal.util.ReferencedKeyMap.put(ReferencedKeyMap.java:217)
at java.base/jdk.internal.util.ReferencedKeyTest.populate(ReferencedKeyTest.java:165)
at java.base/jdk.internal.util.ReferencedKeyTest.mapTest(ReferencedKeyTest.java:68)
at java.base/jdk.internal.util.ReferencedKeyTest.main(ReferencedKeyTest.java:49)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
at java.base/java.lang.VirtualThread.run(VirtualThread.java:329)
java.lang.IdentityException: java.lang.Long is not an identity class
at java.base/java.util.Objects.requireIdentity(Objects.java:212)
at java.base/java.lang.ref.Reference.<init>(Reference.java:515)
at java.base/java.lang.ref.WeakReference.<init>(WeakReference.java:78)
at java.base/jdk.internal.util.WeakReferenceKey.<init>(WeakReferenceKey.java:53)
at java.base/jdk.internal.util.ReferencedKeyMap.entryKey(ReferencedKeyMap.java:165)
at java.base/jdk.internal.util.ReferencedKeyMap.put(ReferencedKeyMap.java:217)
at java.base/jdk.internal.util.ReferencedKeyTest.populate(ReferencedKeyTest.java:165)
at java.base/jdk.internal.util.ReferencedKeyTest.mapTest(ReferencedKeyTest.java:68)
at java.base/jdk.internal.util.ReferencedKeyTest.main(ReferencedKeyTest.java:49)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
at java.base/java.lang.VirtualThread.run(VirtualThread.java:329)
- duplicates
-
JDK-8336390 [lworld] jdk/internal/util/ReferencedKeyTest.java fails with --enable-preview
- Resolved