EA-55951 - CCE: StreamApiMigrationInspection$ReplaceWithForeachCallFix.applyFix

This commit is contained in:
Anna Kozlova
2014-04-16 19:19:20 +02:00
parent e7b3efbf80
commit e512a2f07a
3 changed files with 30 additions and 1 deletions
@@ -0,0 +1,11 @@
// "Replace with forEach" "true"
import java.util.ArrayList;
import java.util.List;
class Sample {
List<String> foo = new ArrayList<>();
String foo(){
((List<String>) foo).stream().filter(s -> s == null).forEach(System.out::println);
return null;
}
}
@@ -0,0 +1,15 @@
// "Replace with forEach" "true"
import java.util.ArrayList;
import java.util.List;
class Sample {
List<String> foo = new ArrayList<>();
String foo(){
for (String s : (List<String>)fo<caret>o) {
if (s == null) {
System.out.println(s);
}
}
return null;
}
}