fix split-filter intention on anyMatch()

This commit is contained in:
Bas Leijdekkers
2017-10-15 11:40:59 +02:00
parent cad8001898
commit 8c17d9fee4
4 changed files with 43 additions and 42 deletions
@@ -0,0 +1,9 @@
// "Split into filter chain" "true"
import java.util.List;
class Test {
void f(List<String> l) {
l.stream().filter(s -> s/*4*/ !=/*5*/ null/*6*/).anyMatch(/*1*/s/*2*/ ->/*3*//*7*/!s./*8*/isEmpty()/*9*//*10*/);
}
}
@@ -4,6 +4,6 @@ import java.util.stream.Stream;
class Test {
void foo(Stream<String> stringStream ) {
stringStream.filter(name -> name.startsWith("A")//starts with A
).filter(name -> name.length() > 1/*comment*/).findAny();
).filter(name -> /*comment*/name.length() > 1).findAny();
}
}
@@ -0,0 +1,9 @@
// "Split into filter chain" "true"
import java.util.List;
class Test {
void f(List<String> l) {
l.stream().anyMatch(/*1*/s/*2*/ ->/*3*/s/*4*/ !=/*5*/ null/*6*/ <caret>&&/*7*/!s./*8*/isEmpty()/*9*//*10*/);
}
}