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

(-)codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java (-1 / +1 lines)
Lines 9923-9929 Link Here
9923
		ObjectVector typesFound) {
9923
		ObjectVector typesFound) {
9924
9924
9925
		ReferenceBinding currentType = receiverType;
9925
		ReferenceBinding currentType = receiverType;
9926
		if (typeName == null || typeName.length == 0)
9926
		if (typeName == null)
9927
			return;
9927
			return;
9928
9928
9929
		if (this.assistNodeIsSuperType && !this.insideQualifiedReference && isForbidden(currentType)) return; // we're trying to find a supertype
9929
		if (this.assistNodeIsSuperType && !this.insideQualifiedReference && isForbidden(currentType)) return; // we're trying to find a supertype
(-)src/org/eclipse/jdt/core/tests/model/CompletionTests.java (+68 lines)
Lines 21186-21189 Link Here
21186
			"AClass[TYPE_REF]{AClass, test, Ltest.AClass;, null, null, 27}",
21186
			"AClass[TYPE_REF]{AClass, test, Ltest.AClass;, null, null, 27}",
21187
			requestor.getResults());
21187
			requestor.getResults());
21188
}
21188
}
21189
21190
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=267091
21191
// To verify that we get interface proposals after 'implements'
21192
public void testBug267091a() throws JavaModelException {
21193
	this.workingCopies = new ICompilationUnit[1];
21194
	this.workingCopies[0] = getWorkingCopy(
21195
		"/Completion/src/test/Try.java",
21196
		"package test;\n" +
21197
		"interface In{}\n" +
21198
		"interface Inn{\n" +
21199
		"	interface Inn2{}\n" +
21200
		"}\n" +
21201
		"class ABC {\n" +
21202
		"	interface ABCInterface;\n" +
21203
		"}\n" +
21204
		"public class Try implements {\n" +
21205
		"}\n");
21206
21207
	CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
21208
	requestor.allowAllRequiredProposals();
21209
	String str = this.workingCopies[0].getSource();
21210
	String completeBehind = "Try implements ";
21211
	int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
21212
	this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
21213
21214
	assertResults(
21215
			// without the fix no proposals obtained.
21216
			"Inn.Inn2[TYPE_REF]{test.Inn.Inn2, test, Ltest.Inn$Inn2;, null, null, 44}\n" +
21217
			"ABC.ABCInterface[TYPE_REF]{ABCInterface, test, Ltest.ABC$ABCInterface;, null, null, 47}\n" +
21218
			"In[TYPE_REF]{In, test, Ltest.In;, null, null, 47}\n" +
21219
			"Inn[TYPE_REF]{Inn, test, Ltest.Inn;, null, null, 47}",
21220
			requestor.getResults());
21221
}
21222
21223
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=267091
21224
// To verify that we get type proposals after 'extends'
21225
public void testBug267091b() throws JavaModelException {
21226
	this.workingCopies = new ICompilationUnit[1];
21227
	this.workingCopies[0] = getWorkingCopy(
21228
		"/Completion/src/test/Try.java",
21229
		"package test;\n" +
21230
		"class In{}\n" +
21231
		"class Inn{\n" +
21232
		"	class Inn2{\n" +
21233
		"		class Inn3{\n" +
21234
		"		}\n" +
21235
		"	}\n" +
21236
		"}\n" +
21237
		"class ABC extends Inn{}\n" +
21238
		"public class Try extends {\n" +
21239
		"}\n");
21240
21241
	CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
21242
	requestor.allowAllRequiredProposals();
21243
	String str = this.workingCopies[0].getSource();
21244
	String completeBehind = "Try extends ";
21245
	int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
21246
	this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
21247
21248
	assertResults(
21249
			// without the fix no proposals obtained.
21250
			"Inn.Inn2[TYPE_REF]{test.Inn.Inn2, test, Ltest.Inn$Inn2;, null, null, 44}\n" +
21251
			"Inn.Inn2.Inn3[TYPE_REF]{test.Inn.Inn2.Inn3, test, Ltest.Inn$Inn2$Inn3;, null, null, 44}\n" +
21252
			"ABC[TYPE_REF]{ABC, test, Ltest.ABC;, null, null, 47}\n" +
21253
			"In[TYPE_REF]{In, test, Ltest.In;, null, null, 47}\n" +
21254
			"Inn[TYPE_REF]{Inn, test, Ltest.Inn;, null, null, 47}",
21255
			requestor.getResults());
21256
}
21189
}
21257
}

Return to bug 267091