ReplaceCollectionStreamFix: handle comments

GitOrigin-RevId: 739c49a0f24a980ce19574b70cfe35c88c657026
This commit is contained in:
Tagir Valeev
2019-11-07 02:40:58 +00:00
committed by intellij-monorepo-bot
parent a3a485a202
commit b04be5706b
3 changed files with 36 additions and 9 deletions
@@ -0,0 +1,11 @@
// "Replace with findFirst()" "true"
import java.util.Arrays;
import java.util.stream.Stream;
public class Main {
public static String find() {
//comment
return Stream.of("foo", "bar", "baz").filter(s -> s.contains("z")).findFirst().orElse("");
}
}
@@ -0,0 +1,13 @@
// "Replace with findFirst()" "true"
import java.util.Arrays;
public class Main {
public static String find() {
for(String s : Arrays.//comment
<caret>asList("foo", "bar", "baz")) {
if (s.contains("z")) return s;
}
return "";
}
}