### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core.tests.model Index: src/org/eclipse/jdt/core/tests/model/CompletionContextTests_1_5.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionContextTests_1_5.java,v retrieving revision 1.4 diff -u -r1.4 CompletionContextTests_1_5.java --- src/org/eclipse/jdt/core/tests/model/CompletionContextTests_1_5.java 29 Mar 2006 04:03:08 -0000 1.4 +++ src/org/eclipse/jdt/core/tests/model/CompletionContextTests_1_5.java 6 Jun 2007 09:19:47 -0000 @@ -664,4 +664,36 @@ "expectedTypesKeys=null", result.context); } +//https://bugs.eclipse.org/bugs/show_bug.cgi?id=191125 +public void test0025() throws JavaModelException { + this.workingCopies = new ICompilationUnit[2]; + this.workingCopies[0] = getWorkingCopy( + "/Completion/src3/test0006/X.java", + "package test0006;\n" + + "@ZZZZ\n" + + "public class X {\n" + + "}"); + + this.workingCopies[1] = getWorkingCopy( + "/Completion/src3/pkgannotation/QQAnnotation.java", + "package pkgannotations;\n" + + "@interface QQAnnotation {\n" + + "}"); + + String str = this.workingCopies[0].getSource(); + int tokenStart = str.lastIndexOf("ZZZZ"); + int tokenEnd = tokenStart + "ZZZZ".length() - 1; + int cursorLocation = str.lastIndexOf("ZZZZ"); + + CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation); + + assertResults( + "completion offset="+(cursorLocation)+"\n" + + "completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" + + "completion token=\"\"\n" + + "completion token kind=TOKEN_KIND_NAME\n" + + "expectedTypesSignatures=null\n" + + "expectedTypesKeys=null", + result.context); +} } #P org.eclipse.jdt.core Index: codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java,v retrieving revision 1.329 diff -u -r1.329 CompletionEngine.java --- codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 24 May 2007 13:54:05 -0000 1.329 +++ codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 6 Jun 2007 09:19:51 -0000 @@ -730,7 +730,7 @@ break; } - if (!guessedType.isValidBinding()) return; + if (guessedType == null || !guessedType.isValidBinding()) return; if (!hasPossibleAnnotationTarget(guessedType, scope)) return; }