Relates :
|
|
Relates :
|
|
Relates :
|
We experienced very rare NullPointerExceptions in core reflection in jdk7, like this: * at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:125) * at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49) * at sun.reflect.generics.repository.ClassRepository.getSuperclass(ClassRepository.java:84) * at java.lang.Class.getGenericSuperclass(Class.java:692) * at com.google.inject.TypeLiteral.getSuperclassTypeParameter(TypeLiteral.java:99) * at com.google.inject.TypeLiteral.<init>(TypeLiteral.java:79) while experimenting with fixes, we were surprised to discover that making reflection class fields final fixed the problem - that's never happened before on x86 in my memory. Although it's not reproducible on jdk8+, apparently because of the fix in 8016236: Class.getGenericInterfaces performance improvement (which is also a correctness improvement!) we should preserve our work in jdk9 as well.
|