Lines 21004-21007
Link Here
|
21004 |
"Try[TYPE_REF]{Try, test, Ltest.Try;, null, null, 27}", |
21004 |
"Try[TYPE_REF]{Try, test, Ltest.Try;, null, null, 27}", |
21005 |
requestor.getResults()); |
21005 |
requestor.getResults()); |
21006 |
} |
21006 |
} |
|
|
21007 |
|
21008 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=249704 |
21009 |
public void testBug249704() throws JavaModelException { |
21010 |
this.workingCopies = new ICompilationUnit[1]; |
21011 |
this.workingCopies[0] = getWorkingCopy( |
21012 |
"/Completion/src/test/Try.java", |
21013 |
"package test;\n" + |
21014 |
"import java.util.Arrays;\n" + |
21015 |
"public class Try {\n" + |
21016 |
" Object obj = new Object() {\n" + |
21017 |
" public void method() {\n" + |
21018 |
" Object obj = new Object() {\n" + |
21019 |
" int a = 1;\n" + |
21020 |
" public void anotherMethod() {\n" + |
21021 |
" try {}\n" + |
21022 |
" catch (Throwable e) {}\n" + |
21023 |
" Arrays.sort(new String[]{\"\"});\n" + |
21024 |
" }\n" + |
21025 |
" };\n" + |
21026 |
" e\n" + |
21027 |
" }\n" + |
21028 |
" };\n" + |
21029 |
"}\n"); |
21030 |
|
21031 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
21032 |
requestor.allowAllRequiredProposals(); |
21033 |
String str = this.workingCopies[0].getSource(); |
21034 |
String completeBehind = "e"; |
21035 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
21036 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
21037 |
|
21038 |
assertResults( |
21039 |
// without the fix no proposals obtained. |
21040 |
"Error[TYPE_REF]{Error, java.lang, Ljava.lang.Error;, null, null, 17}\n" + |
21041 |
"Exception[TYPE_REF]{Exception, java.lang, Ljava.lang.Exception;, null, null, 17}\n" + |
21042 |
"equals[METHOD_REF]{Try.this.equals(), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), 24}\n" + |
21043 |
"equals[METHOD_REF]{equals(), Ljava.lang.Object;, (Ljava.lang.Object;)Z, equals, (obj), 27}", |
21044 |
requestor.getResults()); |
21045 |
} |
21007 |
} |
21046 |
} |