Lines 13744-13748
Link Here
|
13744 |
(R_RESOLVED + R_INTERESTING + R_EXACT_EXPECTED_TYPE + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}", |
13744 |
(R_RESOLVED + R_INTERESTING + R_EXACT_EXPECTED_TYPE + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}", |
13745 |
requestor.getResults()); |
13745 |
requestor.getResults()); |
13746 |
} |
13746 |
} |
|
|
13747 |
//bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=274466 |
13748 |
//Check for boolean methods with higher relevance in assert statement's conditional part |
13749 |
public void test274466() throws JavaModelException { |
13750 |
this.workingCopies = new ICompilationUnit[2]; |
13751 |
this.workingCopies[0] = getWorkingCopy( |
13752 |
"/Completion/src/test/Test274466.java", |
13753 |
"package test;" + |
13754 |
"public class Test274466 {\n" + |
13755 |
" boolean methodReturningBoolean() { return true; }\n" + |
13756 |
" Boolean methodReturningBooleanB() { return true; }\n" + |
13757 |
" void methodReturningBlah() { return; }\n" + |
13758 |
" int foo(int p) {\n" + |
13759 |
" assert methodR : \"Exception Message\";" + |
13760 |
" }\n" + |
13761 |
"}\n"); |
13762 |
this.workingCopies[1] = getWorkingCopy( |
13763 |
"/Completion/src3/java/lang/Test.java", |
13764 |
"package java.lang;\n" + |
13765 |
"public class Boolean {\n" + |
13766 |
"}"); |
13767 |
|
13768 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(); |
13769 |
String str = this.workingCopies[0].getSource(); |
13770 |
String completeBehind = "methodR"; |
13771 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
13772 |
|
13773 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
13774 |
assertResults( |
13775 |
"methodReturningBlah[METHOD_REF]{methodReturningBlah(), Ltest.Test274466;, ()V, methodReturningBlah, " + |
13776 |
(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED) + "}\n" + |
13777 |
"methodReturningBooleanB[METHOD_REF]{methodReturningBooleanB(), Ltest.Test274466;, ()Ljava.lang.Boolean;, methodReturningBooleanB, " + |
13778 |
(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXPECTED_TYPE + R_NON_RESTRICTED) + "}\n" + |
13779 |
"methodReturningBoolean[METHOD_REF]{methodReturningBoolean(), Ltest.Test274466;, ()Z, methodReturningBoolean, " + |
13780 |
(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_EXACT_EXPECTED_TYPE + R_NON_RESTRICTED) + "}", |
13781 |
requestor.getResults()); |
13782 |
} |
13747 |
|
13783 |
|
13748 |
} |
13784 |
} |