StreamApiMigration: add parentheses if necessary when .stream() can be omitted (fix for EA-93812).

This commit is contained in:
Tagir Valeev
2017-01-10 09:42:03 +06:00
parent a9b8f9c7f4
commit 3738e54fee
3 changed files with 22 additions and 2 deletions
@@ -0,0 +1,9 @@
// "Replace with forEach" "true"
import java.util.Collection;
public class Test {
void test(Object obj) {
((Collection<String>) obj).forEach(System.out::println);
}
}
@@ -0,0 +1,11 @@
// "Replace with forEach" "true"
import java.util.Collection;
public class Test {
void test(Object obj) {
for(String str : (Collection<String>)<caret>obj) {
System.out.println(str);
}
}
}