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

Collapse All | Expand All

(-)codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java (-3 / +16 lines)
Lines 3370-3378 Link Here
3370
				if(topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) != K_ARRAY_CREATION) {
3370
				if(topKnownElementKind(COMPLETION_OR_ASSIST_PARSER) != K_ARRAY_CREATION) {
3371
					pushOnElementStack(K_BETWEEN_LEFT_AND_RIGHT_BRACKET);
3371
					pushOnElementStack(K_BETWEEN_LEFT_AND_RIGHT_BRACKET);
3372
				} else {
3372
				} else {
3373
					if(previous == TokenNameIdentifier) {
3373
					switch (previous) {
3374
						this.invocationType = NO_RECEIVER;
3374
						case TokenNameIdentifier:
3375
						this.qualifier = -1;
3375
						case TokenNameboolean:
3376
						case TokenNamebyte:
3377
						case TokenNamechar:
3378
						case TokenNamedouble:
3379
						case TokenNamefloat:
3380
						case TokenNameint:
3381
						case TokenNamelong:
3382
						case TokenNameshort:
3383
						case TokenNameGREATER:
3384
						case TokenNameRIGHT_SHIFT:
3385
						case TokenNameUNSIGNED_RIGHT_SHIFT:
3386
							this.invocationType = NO_RECEIVER;
3387
							this.qualifier = -1;
3388
							break;
3376
					}
3389
					}
3377
				}
3390
				}
3378
				break;
3391
				break;
(-)src/org/eclipse/jdt/core/tests/model/CompletionTests.java (+26 lines)
Lines 115-120 Link Here
115
	}
115
	}
116
}
116
}
117
117
118
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=246276
119
public void testArrayInitializer1() throws JavaModelException {
120
	this.workingCopies = new ICompilationUnit[1];
121
	this.workingCopies[0] = getWorkingCopy(
122
		"/Completion/src/ArrayInitializer.java",
123
		"public class ArrayInitializer {\n"+
124
		"	int bar() {return 0;}\n"+
125
		"	void foo(int[] i) {\n"+
126
		"		i = new int[] {\n"+
127
		"			bar()\n"+
128
		"		};\n"+
129
		"	}\n"+
130
		"}\n");
131
132
	CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
133
	
134
	String str = this.workingCopies[0].getSource();
135
	String completeBehind = "bar(";
136
	int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
137
	this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
138
	
139
	assertResults(
140
			"bar[METHOD_REF]{, LArrayInitializer;, ()I, bar, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_EXACT_NAME + R_UNQUALIFIED + R_NON_RESTRICTED) + "}",
141
			requestor.getResults());
142
}
143
118
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=164311
144
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=164311
119
public void testBug164311() throws JavaModelException {
145
public void testBug164311() throws JavaModelException {
120
	this.workingCopies = new ICompilationUnit[1];
146
	this.workingCopies = new ICompilationUnit[1];

Return to bug 246276