### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java,v retrieving revision 1.163 diff -u -r1.163 CompletionParser.java --- codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java 23 Oct 2006 16:43:24 -0000 1.163 +++ codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java 16 Nov 2006 17:45:16 -0000 @@ -2680,8 +2680,14 @@ case TokenNameRIGHT_SHIFT: // or fred>[(]1, 2) case TokenNameUNSIGNED_RIGHT_SHIFT: //or Fred>>[(]1, 2) if (topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_SELECTOR) { - this.pushOnElementStack(K_SELECTOR_INVOCATION_TYPE, (this.invocationType == QUALIFIED_ALLOCATION) ? QUALIFIED_ALLOCATION : ALLOCATION); - this.pushOnElementStack(K_SELECTOR_QUALIFIER, this.qualifier); + if (topKnownElementKind(COMPLETION_OR_ASSIST_PARSER, 1) == K_BINARY_OPERATOR && + topKnownElementInfo(COMPLETION_OR_ASSIST_PARSER, 1) == GREATER) { + // it's not a selector invocation + popElement(K_SELECTOR); + } else { + this.pushOnElementStack(K_SELECTOR_INVOCATION_TYPE, (this.invocationType == QUALIFIED_ALLOCATION) ? QUALIFIED_ALLOCATION : ALLOCATION); + this.pushOnElementStack(K_SELECTOR_QUALIFIER, this.qualifier); + } } this.qualifier = -1; this.invocationType = NO_RECEIVER; #P org.eclipse.jdt.core.tests.model Index: src/org/eclipse/jdt/core/tests/model/CompletionTests.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTests.java,v retrieving revision 1.134 diff -u -r1.134 CompletionTests.java --- src/org/eclipse/jdt/core/tests/model/CompletionTests.java 6 Nov 2006 16:47:47 -0000 1.134 +++ src/org/eclipse/jdt/core/tests/model/CompletionTests.java 16 Nov 2006 17:45:23 -0000 @@ -13076,4 +13076,28 @@ "this[KEYWORD]{this, null, null, this, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_INHERITED + R_NON_RESTRICTED) + "}", requestor.getResults()); } +//https://bugs.eclipse.org/bugs/show_bug.cgi?id=164311 +public void testBug164311() throws JavaModelException { + this.workingCopies = new ICompilationUnit[1]; + this.workingCopies[0] = getWorkingCopy( + "/Completion/src/test/Test.java", + "package test;"+ + "public class Test {\n" + + " public int zzzzzz;\n" + + " public void method1() {\n" + + " label : if (0> (10));\n" + + " zzz\n" + + " }\n" + + "}\n"); + + CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); + String str = this.workingCopies[0].getSource(); + String completeBehind = "zzz"; + int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); + this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); + + assertResults( + "zzzzzz[FIELD_REF]{zzzzzz, Ltest.Test;, I, zzzzzz, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}", + requestor.getResults()); +} }