### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core.tests.model Index: src/org/eclipse/jdt/core/tests/model/CompletionContextTests.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionContextTests.java,v retrieving revision 1.14 diff -u -r1.14 CompletionContextTests.java --- src/org/eclipse/jdt/core/tests/model/CompletionContextTests.java 27 Jun 2008 16:02:38 -0000 1.14 +++ src/org/eclipse/jdt/core/tests/model/CompletionContextTests.java 4 Sep 2008 13:03:18 -0000 @@ -4899,4 +4899,33 @@ "visibleElements={}", result.context); } +//https://bugs.eclipse.org/bugs/show_bug.cgi?id=243023 +public void test0166() throws JavaModelException { + this.workingCopies = new ICompilationUnit[1]; + this.workingCopies[0] = getWorkingCopy( + "/Completion/src3/test0001/X.java", + "package test0001;\n" + + "public class X {\n" + + " public void foo() {\n" + + " if ( null == /**/\n" + + " }\n" + + "}"); + + String str = this.workingCopies[0].getSource(); + int tokenStart = str.lastIndexOf("/**/"); + int tokenEnd = tokenStart + "".length() - 1; + int cursorLocation = str.lastIndexOf("/**/") + "".length(); + + 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\n"+ + "completion token location=UNKNOWN", + 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.371 diff -u -r1.371 CompletionEngine.java --- codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 8 Jul 2008 13:29:04 -0000 1.371 +++ codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 4 Sep 2008 13:03:21 -0000 @@ -9803,7 +9803,7 @@ } } private void addExpectedType(TypeBinding type, Scope scope){ - if (type == null || !type.isValidBinding()) return; + if (type == null || !type.isValidBinding() || type == TypeBinding.NULL) return; // do not add twice the same type for (int i = 0; i <= this.expectedTypesPtr; i++) {