Skip to content
Snippets Groups Projects
Commit d7c67fc3 authored by María Arias de Reyna's avatar María Arias de Reyna Committed by Severin Gehwolf
Browse files

8261404: Class.getReflectionFactory() is not thread-safe

Backport-of: 905b7639424a0fa80f81f734f6fdae1b5018a14a
parent 34326989
No related branches found
No related tags found
No related merge requests found
......@@ -3788,13 +3788,14 @@ 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 =
var factory = reflectionFactory;
if (factory != null) {
return factory;
}
return reflectionFactory =
java.security.AccessController.doPrivileged
(new ReflectionFactory.GetReflectionFactoryAction());
}
return reflectionFactory;
}
private static ReflectionFactory reflectionFactory;
/**
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment