Fixed Bug 427468 - [1.8][compiler] can't resolve
java.lang.annotation.Annotation from source
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TypeAnnotationTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TypeAnnotationTest.java
index b03a2ed..9fe7cfe 100644
--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TypeAnnotationTest.java
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TypeAnnotationTest.java
@@ -6242,7 +6242,6 @@
checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X.class", "X", expectedOutput, ClassFileBytesDisassembler.SYSTEM);
}
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=419331, [1.8][compiler] Weird error on forward reference to type annotations from type parameter declarations
- // ENCODES WRONG BEHAVIOR - FIX TEST ALONG WITH FIX
public void testForwardReference() {
this.runNegativeTest(
new String[] {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java
index 3fe8dd2..fb6b282 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java
@@ -109,9 +109,6 @@
this.methods = Binding.UNINITIALIZED_METHODS;
this.prototype = this;
computeId();
- if (this.isAnnotationType()) { // for forward references, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=419331
- this.superInterfaces = new ReferenceBinding [] { scope.getJavaLangAnnotationAnnotation() };
- }
}
public SourceTypeBinding(SourceTypeBinding prototype) {
@@ -2275,7 +2272,7 @@
public ReferenceBinding[] superInterfaces() {
if (!isPrototype())
return this.superInterfaces = this.prototype.superInterfaces();
- return this.superInterfaces;
+ return this.superInterfaces != null ? this.superInterfaces : isAnnotationType() ? this.superInterfaces = new ReferenceBinding [] { this.scope.getJavaLangAnnotationAnnotation() } : null;
}
public SyntheticMethodBinding[] syntheticMethods() {