Lines 21696-21699
Link Here
|
21696 |
"returnZero[METHOD_REF_WITH_CASTED_RECEIVER]{((CompletionAfterInstanceOf)a).returnZero(), Ltest.CompletionAfterInstanceOf;, ()I, Ltest.CompletionAfterInstanceOf;, returnZero, null, replace["+start2+", "+end2+"], token["+start1+", "+end1+"], receiver["+start3+", "+end3+"], " + (relevance1) + "}", |
21696 |
"returnZero[METHOD_REF_WITH_CASTED_RECEIVER]{((CompletionAfterInstanceOf)a).returnZero(), Ltest.CompletionAfterInstanceOf;, ()I, Ltest.CompletionAfterInstanceOf;, returnZero, null, replace["+start2+", "+end2+"], token["+start1+", "+end1+"], receiver["+start3+", "+end3+"], " + (relevance1) + "}", |
21697 |
requestor.getResults()); |
21697 |
requestor.getResults()); |
21698 |
} |
21698 |
} |
|
|
21699 |
|
21700 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=325481 |
21701 |
// To verify that when content assist is invoked inside a field initialization, |
21702 |
// the field being declared and the ones declared after it are not proposed. |
21703 |
public void test325481() throws JavaModelException { |
21704 |
this.workingCopies = new ICompilationUnit[1]; |
21705 |
this.workingCopies[0] = getWorkingCopy( |
21706 |
"/Completion/src3/test/X.java", |
21707 |
"package test;\n" + |
21708 |
"public class X {\n" + |
21709 |
" void foo(String s) {}\n" + |
21710 |
" String myString = \"\";\n" + |
21711 |
" String myString2 = \"\";\n" + |
21712 |
" String myString3 = (myString = String.format(String.format(my\n" + |
21713 |
" String myString4 = \"hello\";\n" + // should not be proposed |
21714 |
"}"); |
21715 |
|
21716 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
21717 |
String str = this.workingCopies[0].getSource(); |
21718 |
final String completeBehind = "String.format(my"; |
21719 |
int cursorLocation = str.lastIndexOf(completeBehind) + |
21720 |
completeBehind.length(); |
21721 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
21722 |
|
21723 |
assertResults( |
21724 |
"MyClass[TYPE_REF]{mypackage.MyClass, mypackage, Lmypackage.MyClass;, null, null, " + (R_NON_STATIC + R_UNQUALIFIED) + "}\n" + |
21725 |
"mypackage[PACKAGE_REF]{mypackage, mypackage, null, null, null, " + (R_NON_STATIC + R_UNQUALIFIED + R_CASE) + "}\n" + |
21726 |
"myString[FIELD_REF]{myString, Ltest.X;, Ljava.lang.String;, myString, null, " + (R_NON_STATIC + R_UNQUALIFIED + R_CASE + R_NON_RESTRICTED) + "}\n" + |
21727 |
"myString2[FIELD_REF]{myString2, Ltest.X;, Ljava.lang.String;, myString2, null, " + (R_NON_STATIC + R_UNQUALIFIED + R_CASE + R_NON_RESTRICTED) + "}", |
21728 |
requestor.getResults()); |
21729 |
} |
21699 |
} |
21730 |
} |