mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-07-14 01:26:26 +07:00
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:
+10
@@ -0,0 +1,10 @@
|
||||
// "Surround with 'if ((b ? null : "foo") != null)'" "true"
|
||||
class A {
|
||||
void bar(String s) {}
|
||||
|
||||
void foo(boolean b){
|
||||
if ((b ? null : "foo") != null) {
|
||||
bar(b ? null : "foo");
|
||||
}
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Surround with 'if ((Math.random() > 0.5 ? null : "foo") != null)'" "false"
|
||||
class A {
|
||||
void bar(String s) {}
|
||||
|
||||
void foo(boolean b){
|
||||
bar(Math.random() > 0.5 ? null<caret> : "foo");
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Surround with 'if ((b ? null : "foo") != null)'" "true"
|
||||
class A {
|
||||
void bar(String s) {}
|
||||
|
||||
void foo(boolean b){
|
||||
bar(b ? null<caret> : "foo");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user