StreamToLoopInspection: handle some if/ifPresent cases

This commit is contained in:
Tagir Valeev
2016-12-13 12:33:43 +07:00
parent 1e61604d88
commit 7b65a6919d
7 changed files with 71 additions and 20 deletions
@@ -6,19 +6,19 @@ import static java.util.Arrays.asList;
public class Main {
public static void test(List<List<String>> list) {
boolean allMatch = true;
boolean b = true;
OUTER:
for (List<String> x : list) {
if (x != null) {
for (String s : x) {
if (!s.startsWith("a")) {
allMatch = false;
b = false;
break OUTER;
}
}
}
}
if(allMatch) {
if(b) {
System.out.println("ok");
}
}