IDEA-121658 Java 1.8: "Replace with forEach" quick fix is not suggested if for statement is not surrounded with braces

This commit is contained in:
Anna Kozlova
2014-03-05 11:39:47 +01:00
parent c692398423
commit 0fa7d08f83
4 changed files with 28 additions and 2 deletions
@@ -0,0 +1,10 @@
// "Replace with forEach" "true"
import java.util.ArrayList;
import java.util.List;
class Sample {
List<String> foo = new ArrayList<>();
{
foo.forEach(System.out::println);
}
}
@@ -0,0 +1,10 @@
// "Replace with forEach" "true"
import java.util.ArrayList;
import java.util.List;
class Sample {
List<String> foo = new ArrayList<>();
{
for (String s : fo<caret>o) System.out.println(s);
}
}