Lines 20974-20977
Link Here
|
20974 |
"enclosingElement=<anonymous #1> {key=Ltest/TestBug307337$64;} [in obj [in TestBug307337 [in [Working copy] TestBug307337.java [in test [in src [in Completion]]]]]]", |
20974 |
"enclosingElement=<anonymous #1> {key=Ltest/TestBug307337$64;} [in obj [in TestBug307337 [in [Working copy] TestBug307337.java [in test [in src [in Completion]]]]]]", |
20975 |
requestor.getContext()); |
20975 |
requestor.getContext()); |
20976 |
} |
20976 |
} |
|
|
20977 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=292087 |
20978 |
// To verify that anonymous class in array initializer doesnt cause |
20979 |
// grief to content assist |
20980 |
public void testBug292087() throws JavaModelException { |
20981 |
this.workingCopies = new ICompilationUnit[1]; |
20982 |
this.workingCopies[0] = getWorkingCopy( |
20983 |
"/Completion/src/test/Try.java", |
20984 |
"package test;\n" + |
20985 |
"public class Try extends Thread{\n" + |
20986 |
" public Runnable member[] = { new Runnable (){\n" + |
20987 |
" public void run() {}\n" + |
20988 |
" }\n" + |
20989 |
" };\n" + |
20990 |
" Tr\n" + |
20991 |
"}\n"); |
20992 |
|
20993 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
20994 |
requestor.allowAllRequiredProposals(); |
20995 |
String str = this.workingCopies[0].getSource(); |
20996 |
String completeBehind = "Tr"; |
20997 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
20998 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
20999 |
|
21000 |
assertResults( |
21001 |
// without the fix no proposals obtained. |
21002 |
"Tr[POTENTIAL_METHOD_DECLARATION]{Tr, Ltest.Try;, ()V, Tr, null, 14}\n" + |
21003 |
"transient[KEYWORD]{transient, null, null, transient, null, 14}\n" + |
21004 |
"Try[TYPE_REF]{Try, test, Ltest.Try;, null, null, 27}", |
21005 |
requestor.getResults()); |
21006 |
} |
20977 |
} |
21007 |
} |