8261404: Class.getReflectionFactory() is not thread-safe
Reviewed-by: rriggs, mchung
This commit is contained in:
parent
022e4f0f1c
commit
905b763942
@ -3820,12 +3820,13 @@ public final class Class<T> implements java.io.Serializable,
|
||||
// Fetches the factory for reflective objects
|
||||
@SuppressWarnings("removal")
|
||||
private static ReflectionFactory getReflectionFactory() {
|
||||
if (reflectionFactory == null) {
|
||||
reflectionFactory =
|
||||
java.security.AccessController.doPrivileged
|
||||
(new ReflectionFactory.GetReflectionFactoryAction());
|
||||
var factory = reflectionFactory;
|
||||
if (factory != null) {
|
||||
return factory;
|
||||
}
|
||||
return reflectionFactory;
|
||||
return reflectionFactory =
|
||||
java.security.AccessController.doPrivileged
|
||||
(new ReflectionFactory.GetReflectionFactoryAction());
|
||||
}
|
||||
private static ReflectionFactory reflectionFactory;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user