invert if: check precedence and keep parenthesis accordingly (IDEA-175062)

replace duplicated negation utility
This commit is contained in:
Anna Kozlova
2018-01-03 14:18:52 +01:00
parent 28ec1b1e80
commit 0ebca9cff2
9 changed files with 56 additions and 11 deletions
@@ -0,0 +1,13 @@
// "Invert 'if' condition" "true"
class A {
void method(Object x) {
if (x instanceof String) {
System.out.println(((String) x).toUpperCase());
}
else {
System.out.println(x.toString());
}
}
}