DataFlowInspection: npe fixes fixed

Fixes duplicating NPE expression are disabled when expression has side-effect (not when it's a method call)
Parentheses added to generated code when necessary
This commit is contained in:
Tagir Valeev
2017-07-27 19:06:34 +07:00
parent 4882d4a589
commit eaec99dcce
10 changed files with 54 additions and 5 deletions
@@ -0,0 +1,8 @@
// "Replace with '(b ? null : "foo") != null ?:'" "true"
class A {
void bar(String s) {}
void foo(boolean b){
bar((b ? null : "foo") != null ? b ? null : "foo" : null);
}
}
@@ -0,0 +1,8 @@
// "Replace with '(b ? null : "foo") != null ?:'" "true"
class A {
void bar(String s) {}
void foo(boolean b){
bar(b ? null<caret> : "foo");
}
}