View | Details | Raw Unified | Return to bug 164311
Collapse All | Expand All

(-)codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java (-2 / +8 lines)
Lines 2680-2687 Link Here
2680
					case TokenNameRIGHT_SHIFT: // or fred<X<X>>[(]1, 2) 
2680
					case TokenNameRIGHT_SHIFT: // or fred<X<X>>[(]1, 2) 
2681
					case TokenNameUNSIGNED_RIGHT_SHIFT: //or Fred<X<X<X>>>[(]1, 2)
2681
					case TokenNameUNSIGNED_RIGHT_SHIFT: //or Fred<X<X<X>>>[(]1, 2)
2682
						if (topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_SELECTOR) {
2682
						if (topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) == K_SELECTOR) {
2683
							this.pushOnElementStack(K_SELECTOR_INVOCATION_TYPE, (this.invocationType == QUALIFIED_ALLOCATION) ? QUALIFIED_ALLOCATION : ALLOCATION);
2683
							if (topKnownElementKind(COMPLETION_OR_ASSIST_PARSER, 1) == K_BINARY_OPERATOR &&
2684
							this.pushOnElementStack(K_SELECTOR_QUALIFIER, this.qualifier);
2684
									topKnownElementInfo(COMPLETION_OR_ASSIST_PARSER, 1) == GREATER) {
2685
								// it's not a selector invocation
2686
								popElement(K_SELECTOR);
2687
							} else {
2688
								this.pushOnElementStack(K_SELECTOR_INVOCATION_TYPE, (this.invocationType == QUALIFIED_ALLOCATION) ? QUALIFIED_ALLOCATION : ALLOCATION);
2689
								this.pushOnElementStack(K_SELECTOR_QUALIFIER, this.qualifier);
2690
							}
2685
						}
2691
						}
2686
						this.qualifier = -1;
2692
						this.qualifier = -1;
2687
						this.invocationType = NO_RECEIVER;
2693
						this.invocationType = NO_RECEIVER;
(-)src/org/eclipse/jdt/core/tests/model/CompletionTests.java (+24 lines)
Lines 13076-13079 Link Here
13076
			"this[KEYWORD]{this, null, null, this, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_INHERITED + R_NON_RESTRICTED) + "}",
13076
			"this[KEYWORD]{this, null, null, this, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_NON_INHERITED + R_NON_RESTRICTED) + "}",
13077
			requestor.getResults());
13077
			requestor.getResults());
13078
}
13078
}
13079
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=164311
13080
public void testBug164311() throws JavaModelException {
13081
	this.workingCopies = new ICompilationUnit[1];
13082
	this.workingCopies[0] = getWorkingCopy(
13083
		"/Completion/src/test/Test.java",
13084
		"package test;"+
13085
		"public class Test {\n" + 
13086
		"    public int zzzzzz;\n" + 
13087
		"    public void method1() {\n" + 
13088
		"        label : if (0> (10));\n" + 
13089
		"        zzz\n" + 
13090
		"    }\n" + 
13091
		"}\n");
13092
13093
	CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
13094
	String str = this.workingCopies[0].getSource();
13095
	String completeBehind = "zzz";
13096
	int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
13097
	this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
13098
13099
	assertResults(
13100
			"zzzzzz[FIELD_REF]{zzzzzz, Ltest.Test;, I, zzzzzz, null, " + (R_DEFAULT + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
13101
			requestor.getResults());
13102
}
13079
}
13103
}

Return to bug 164311