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

(-)src/org/eclipse/jdt/core/tests/model/CompletionTests.java (+31 lines)
Lines 12839-12844 Link Here
12839
			"",
12839
			"",
12840
			requestor.getResults());
12840
			requestor.getResults());
12841
}
12841
}
12842
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=137452
12843
public void testCompletionVariableName39() throws JavaModelException {
12844
	this.workingCopies = new ICompilationUnit[1];
12845
	this.workingCopies[0] = getWorkingCopy(
12846
			"/Completion/src/test/Test.java",
12847
			"package test;\n"+
12848
			"public class AutoCompleteBug {\n"+
12849
			"    interface I {\n"+
12850
			"        void doIt();\n"+
12851
			"    }\n"+
12852
			"    class C1 implements I {\n"+
12853
			"        public void doIt() {\n"+
12854
			"        }\n"+
12855
			"    }\n"+
12856
			"    class C2 extends C1 {\n"+
12857
			"        /*here*/public void doIt() {\n"+
12858
			"			super.doIt();\n"+
12859
			"        }\n"+
12860
			"    }\n"+
12861
			"}");
12862
    
12863
    CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
12864
    String str = this.workingCopies[0].getSource();
12865
    String completeBehind = "/*here*/public void doIt";
12866
    int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
12867
    this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
12868
12869
    assertResults(
12870
			"",
12871
			requestor.getResults());
12872
}
12842
public void testCompletionVariableName4() throws JavaModelException {
12873
public void testCompletionVariableName4() throws JavaModelException {
12843
	this.wc = getWorkingCopy(
12874
	this.wc = getWorkingCopy(
12844
            "/Completion/src/CompletionVariableName4.java",
12875
            "/Completion/src/CompletionVariableName4.java",
(-)codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java (-24 / +18 lines)
Lines 7580-7611 Link Here
7580
	}
7580
	}
7581
7581
7582
	private void findVariableNames(char[] name, TypeReference type , char[][] discouragedNames, char[][] forbiddenNames, int kind, int modifiers){
7582
	private void findVariableNames(char[] name, TypeReference type , char[][] discouragedNames, char[][] forbiddenNames, int kind, int modifiers){
7583
7584
		if(type != null &&
7583
		if(type != null &&
7585
			type.resolvedType != null &&
7584
			type.resolvedType != null) {
7586
			type.resolvedType.problemId() == ProblemReasons.NoError){
7587
			TypeBinding tb = type.resolvedType;
7585
			TypeBinding tb = type.resolvedType;
7588
			findVariableName(
7586
			
7589
				name,
7587
			if (tb.problemId() == ProblemReasons.NoError &&
7590
				tb.leafComponentType().qualifiedPackageName(),
7588
					tb != Scope.getBaseType(VOID)) {
7591
				tb.leafComponentType().qualifiedSourceName(),
7589
				findVariableName(
7592
				tb.leafComponentType().sourceName(),
7590
					name,
7593
				tb,
7591
					tb.leafComponentType().qualifiedPackageName(),
7594
				discouragedNames,
7592
					tb.leafComponentType().qualifiedSourceName(),
7595
				forbiddenNames,
7593
					tb.leafComponentType().sourceName(),
7596
				type.dimensions(),
7594
					tb,
7597
				kind,
7595
					discouragedNames,
7598
				modifiers);
7596
					forbiddenNames,
7599
		}/*	else {
7597
					type.dimensions(),
7600
			char[][] typeName = type.getTypeName();
7598
					kind,
7601
			findVariableName(
7599
					modifiers);
7602
				name,
7600
			}
7603
				NoChar,
7601
		}
7604
				CharOperation.concatWith(typeName, '.'),
7602
7605
				typeName[typeName.length - 1],
7606
				excludeNames,
7607
				type.dimensions());
7608
		}*/
7609
	}
7603
	}
7610
	
7604
	
7611
	private ImportBinding[] getFavoriteReferenceBindings(Scope scope) {
7605
	private ImportBinding[] getFavoriteReferenceBindings(Scope scope) {

Return to bug 137452