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

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/model/CompletionContextTests_1_5.java (+32 lines)
Lines 664-667 Link Here
664
		"expectedTypesKeys=null",
664
		"expectedTypesKeys=null",
665
		result.context);
665
		result.context);
666
}
666
}
667
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=191125
668
public void test0025() throws JavaModelException {
669
	this.workingCopies = new ICompilationUnit[2];
670
	this.workingCopies[0] = getWorkingCopy(
671
		"/Completion/src3/test0006/X.java",
672
		"package test0006;\n" + 
673
		"@ZZZZ\n" + 
674
		"public class X {\n" + 
675
		"}");
676
	
677
	this.workingCopies[1] = getWorkingCopy(
678
		"/Completion/src3/pkgannotation/QQAnnotation.java",
679
		"package pkgannotations;\n" + 
680
		"@interface QQAnnotation {\n" + 
681
		"}");
682
	
683
	String str = this.workingCopies[0].getSource();
684
	int tokenStart = str.lastIndexOf("ZZZZ");
685
	int tokenEnd = tokenStart + "ZZZZ".length() - 1;
686
	int cursorLocation = str.lastIndexOf("ZZZZ");
687
688
	CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
689
690
	assertResults(
691
		"completion offset="+(cursorLocation)+"\n" +
692
		"completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
693
		"completion token=\"\"\n" +
694
		"completion token kind=TOKEN_KIND_NAME\n" +
695
		"expectedTypesSignatures=null\n" +
696
		"expectedTypesKeys=null",
697
		result.context);
698
}
667
}
699
}
(-)codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java (-1 / +1 lines)
Lines 730-736 Link Here
730
					break;
730
					break;
731
			}
731
			}
732
			
732
			
733
			if (!guessedType.isValidBinding()) return;
733
			if (guessedType == null || !guessedType.isValidBinding()) return;
734
			
734
			
735
			if (!hasPossibleAnnotationTarget(guessedType, scope)) return;
735
			if (!hasPossibleAnnotationTarget(guessedType, scope)) return;
736
		}
736
		}

Return to bug 191125