mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Testdata fixed
This commit is contained in:
+1
-1
@@ -34,7 +34,7 @@ public class Main {
|
||||
}
|
||||
}
|
||||
if (b) {
|
||||
System.out.println("Ok!");
|
||||
System.out.println("Ok!");
|
||||
}
|
||||
}
|
||||
if(list.size() > 2 || list.stream().filter(x -> x != null).anyMatch(x -> x.startsWith("x"))) { // not supported
|
||||
|
||||
+8
-3
@@ -67,11 +67,16 @@ class PointlessBooleanExpression {
|
||||
if(<warning descr="'sideEffect() && true' can be simplified to 'sideEffect()'">sideEffect() && true</warning>) {
|
||||
System.out.println("ooh");
|
||||
}
|
||||
// Do not warn as we cannot simplify w/o reordering calls which could be undesired
|
||||
// this code is warned by DFA inspection (w/o quick-fix)
|
||||
if(Math.random() > 0.5 && (sideEffect() || true)) {
|
||||
// Here side-effect can be extracted and placed inside loop
|
||||
if(Math.random() > 0.5 && (<warning descr="'sideEffect() || true' can be simplified to 'true'">sideEffect() || true</warning>)) {
|
||||
System.out.println("well");
|
||||
}
|
||||
// Extracting side-effects from conjunction in if statement which contains else branch is still not supported (though warning is displayed)
|
||||
if(Math.random() > 0.5 && (sideEffect() || true)) {
|
||||
System.out.println("ok");
|
||||
} else {
|
||||
System.out.println("cancel");
|
||||
}
|
||||
// Here side-effect can be extracted before loop
|
||||
if((<warning descr="'sideEffect() || true' can be simplified to 'true'">sideEffect() || true</warning>) && Math.random() > 0.5) {
|
||||
System.out.println("well");
|
||||
|
||||
Reference in New Issue
Block a user