Project: JDT
Bug 156352 NPE when accessing annotations from ITypeBinding
Reported: 2006-09-06 09:01:50 | Status: verified fixed

The attached snippet fails with a NPE when it tries to access the annotations of a super class. java.lang.NullPointerException at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.getAnnotationTagBits(SourceTypeBinding.java:677) at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.retrieveAnnotationHolder(SourceTypeBinding.java:1417) at org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding.retrieveAnnotations(ReferenceBinding.java:1082) at org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding.getAnnotations(ReferenceBinding.java:595) at org.eclipse.jdt.core.dom.TypeBinding.getAnnotations(TypeBinding.java:92) at org.eclipse.jdt.junit.tests.JUnit4TestFinderTest.testNPE(JUnit4TestFinderTest.java:323) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ...

Files changed in fix:
org.eclipse.jdt.junit.core/src/org/eclipse/jdt/internal/junit/launcher/JUnit4TestFinder.java org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/launcher/JUnit4TestFinder.java