-
Bug
-
Resolution: Unresolved
-
P4
-
22, 23, 24, 25
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
java.lang.invoke.MethodHandleProxies.WRAPPER_TYPES is a java.util.Set backed by a java.util.WeakHashMap, which is not thread-safe. And it is accessed without external synchronization.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
The non-threadsafe can, for instance, result in a wrong return value in MethodHandleProxies.isWrapperInstance(), because the caller thread may not have observed the `WRAPPER_TYPES.add` call on the defining thread of the wrapper class. (WeakHashMap might also throw exceptions on certain concurrent modifications)
java.lang.invoke.MethodHandleProxies.WRAPPER_TYPES is a java.util.Set backed by a java.util.WeakHashMap, which is not thread-safe. And it is accessed without external synchronization.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
The non-threadsafe can, for instance, result in a wrong return value in MethodHandleProxies.isWrapperInstance(), because the caller thread may not have observed the `WRAPPER_TYPES.add` call on the defining thread of the wrapper class. (WeakHashMap might also throw exceptions on certain concurrent modifications)
- relates to
-
JDK-6983726 Reimplement MethodHandleProxies.asInterfaceInstance
-
- Resolved
-
- links to
-
Review(master) openjdk/jdk/23757