-
Bug
-
Resolution: Fixed
-
P4
-
11, 12, 13
-
b10
-
Not verified
ReflectionFactory access to instance variable langReflectAccess can NullPointerException if it has not been initialized correctly. During testing with OpenJDK for OpenJ9 this was discovered:
Caused by: java.lang.NullPointerException
at java.base/jdk.internal.reflect.ReflectionFactory.newMethodAccessor(ReflectionFactory.java:200)
at java.base/java.lang.reflect.Method.acquireMethodAccessor(Method.java:632)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
This is due to the field jdk.internal.reflect.ReflectionFactory.langReflectAccess hasn't been initialized yet.
The code snippet in question Method root = langReflectAccess.getRoot(method); should be Method root = langReflectAccess().getRoot(method); like elsewhere in the class.
3 occurrences have this problem in ReflectionFactory.java, lines 178, 200, 236
Caused by: java.lang.NullPointerException
at java.base/jdk.internal.reflect.ReflectionFactory.newMethodAccessor(ReflectionFactory.java:200)
at java.base/java.lang.reflect.Method.acquireMethodAccessor(Method.java:632)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
This is due to the field jdk.internal.reflect.ReflectionFactory.langReflectAccess hasn't been initialized yet.
The code snippet in question Method root = langReflectAccess.getRoot(method); should be Method root = langReflectAccess().getRoot(method); like elsewhere in the class.
3 occurrences have this problem in ReflectionFactory.java, lines 178, 200, 236
- relates to
-
JDK-8219774 Reexamine the initialization of LangReflectAccess shared secret at AccessibleObject::<clinit>
- Resolved