mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
invert if: check precedence and keep parenthesis accordingly (IDEA-175062)
replace duplicated negation utility
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
// "Invert 'if' condition" "true"
|
||||
class A {
|
||||
|
||||
void method(Object x) {
|
||||
if (!<caret>(x instanceof String)) {
|
||||
System.out.println(x.toString());
|
||||
} else {
|
||||
System.out.println(((String) x).toUpperCase());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user