invert boolean: stop on class level (IDEA-66889)

This commit is contained in:
anna
2011-03-22 12:45:48 +01:00
parent eac1f4d2de
commit 6776cbd8c1
4 changed files with 38 additions and 0 deletions
@@ -0,0 +1,16 @@
public class Convert2AtomicTest {
public boolean f<caret>oo() {
Processor processor = new Processor() {
@Override
public boolean process(Object o) {
return false; // Changes false to true here, WRONG!!!
}
};
return false; // Changes false to true here, right
}
}
interface Processor {
boolean process(Object object);
}
@@ -0,0 +1,16 @@
public class Convert2AtomicTest {
public boolean fooInverted() {
Processor processor = new Processor() {
@Override
public boolean process(Object o) {
return false; // Changes false to true here, WRONG!!!
}
};
return true; // Changes false to true here, right
}
}
interface Processor {
boolean process(Object object);
}
@@ -27,6 +27,8 @@ public class InvertBooleanTest extends LightCodeInsightTestCase {
public void testParameter1() throws Exception { doTest(); } //inverting boolean parameter more advanced stuff
public void testUnusedReturnValue() throws Exception { doTest(); }
public void testInnerClasses() throws Exception {doTest();}
private void doTest() throws Exception {
configureByFile(TEST_ROOT + getTestName(true) + ".java");
PsiElement element = TargetElementUtilBase.findTargetElement(myEditor, TargetElementUtilBase.ELEMENT_NAME_ACCEPTED);