invert if: preserve parenthesis when not safe to delete (IDEA-107783)

This commit is contained in:
Anna Kozlova
2013-05-24 16:57:26 +04:00
parent 1529d441b1
commit 35b276b733
3 changed files with 24 additions and 1 deletions
@@ -0,0 +1,10 @@
// "Invert If Condition" "true"
class A {
public boolean foo(boolean a, boolean b, boolean c, boolean d) {
if ((a || b) && !c && !d) {
return true;
}
return false;
}
}
@@ -0,0 +1,9 @@
// "Invert If Condition" "true"
class A {
public boolean foo(boolean a, boolean b, boolean c, boolean d) {
if (!(a |<caret>| b) || c || d)
return false;
return true;
}
}