View | Details | Raw Unified | Return to bug 287009 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java (+19 lines)
Lines 8850-8853 Link Here
8850
			null, null,
8850
			null, null,
8851
			JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
8851
			JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
8852
}
8852
}
8853
8854
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=287009
8855
public void test270() {
8856
	this.runNegativeTest(
8857
		new String[] {
8858
			"Test.java", 
8859
			"public class Test<T> {\n" + 
8860
			"	@interface Anno {\n" + 
8861
			"		Anno value();\n" + 
8862
			"	}\n" + 
8863
			"}\n", 
8864
		},
8865
		"----------\n" +
8866
		"1. ERROR in Test.java (at line 3)\n" +
8867
		"	Anno value();\n" +
8868
		"	^^^^\n" +
8869
		"Cycle detected: the annotation type Test<T>.Anno cannot contain attributes of the annotation type itself\n" +
8870
		"----------\n");
8871
}
8853
}
8872
}
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java (-1 / +1 lines)
Lines 670-676 Link Here
670
	boolean inCycle = false; // check each method before failing
670
	boolean inCycle = false; // check each method before failing
671
	for (int i = 0, l = currentMethods.length; i < l; i++) {
671
	for (int i = 0, l = currentMethods.length; i < l; i++) {
672
		TypeBinding returnType = currentMethods[i].returnType.leafComponentType();
672
		TypeBinding returnType = currentMethods[i].returnType.leafComponentType();
673
		if (this == returnType) {
673
		if (this == returnType || this == returnType.erasure()) {
674
			if (this instanceof SourceTypeBinding) {
674
			if (this instanceof SourceTypeBinding) {
675
				MethodDeclaration decl = (MethodDeclaration) currentMethods[i].sourceMethod();
675
				MethodDeclaration decl = (MethodDeclaration) currentMethods[i].sourceMethod();
676
				((SourceTypeBinding) this).scope.problemReporter().annotationCircularity(this, this, decl != null ? decl.returnType : null);
676
				((SourceTypeBinding) this).scope.problemReporter().annotationCircularity(this, this, decl != null ? decl.returnType : null);

Return to bug 287009