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

View File

@@ -5,18 +5,14 @@ import java.util.List;
public class Main {
private static void test(List<String> list) {
boolean found = false;
for (String x : list) {
if (x != null) {
if (x.startsWith("x")) {
found = true;
System.out.println("Ok!");
break;
}
}
}
if(found) {
System.out.println("Ok!");
}
}
public static void main(String[] args) {