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

(-)src/org/eclipse/jdt/core/tests/model/CompletionContextTests.java (+29 lines)
Lines 4899-4902 Link Here
4899
		"visibleElements={}",
4899
		"visibleElements={}",
4900
		result.context);
4900
		result.context);
4901
}
4901
}
4902
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=243023
4903
public void test0166() throws JavaModelException {
4904
	this.workingCopies = new ICompilationUnit[1];
4905
	this.workingCopies[0] = getWorkingCopy(
4906
		"/Completion/src3/test0001/X.java",
4907
		"package test0001;\n" +
4908
		"public class X {\n" +
4909
		"  public void foo() {\n" +
4910
		"    if ( null == /**/\n" +
4911
		"  }\n" +
4912
		"}");
4913
4914
	String str = this.workingCopies[0].getSource();
4915
	int tokenStart = str.lastIndexOf("/**/");
4916
	int tokenEnd = tokenStart + "".length() - 1;
4917
	int cursorLocation = str.lastIndexOf("/**/") + "".length();
4918
4919
	CompletionResult result = contextComplete(this.workingCopies[0], cursorLocation);
4920
4921
	assertResults(
4922
		"completion offset="+(cursorLocation)+"\n" +
4923
		"completion range=["+(tokenStart)+", "+(tokenEnd)+"]\n" +
4924
		"completion token=\"\"\n" +
4925
		"completion token kind=TOKEN_KIND_NAME\n" +
4926
		"expectedTypesSignatures=null\n" +
4927
		"expectedTypesKeys=null\n"+
4928
		"completion token location=UNKNOWN",
4929
		result.context);
4930
}
4902
}
4931
}
(-)codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java (-1 / +1 lines)
Lines 9803-9809 Link Here
9803
		}
9803
		}
9804
	}
9804
	}
9805
	private void addExpectedType(TypeBinding type, Scope scope){
9805
	private void addExpectedType(TypeBinding type, Scope scope){
9806
		if (type == null || !type.isValidBinding()) return;
9806
		if (type == null || !type.isValidBinding() || type == TypeBinding.NULL) return;
9807
9807
9808
		// do not add twice the same type
9808
		// do not add twice the same type
9809
		for (int i = 0; i <= this.expectedTypesPtr; i++) {
9809
		for (int i = 0; i <= this.expectedTypesPtr; i++) {

Return to bug 243023