mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-23 06:51:24 +07:00
IDEA-167580 Uncompilable code after conversion Stream -> Loop with generics
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
// "Fix all 'Stream API call chain can be replaced with loop' problems in file" "true"
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import static java.util.stream.Collectors.*;
|
||||
|
||||
public class Main {
|
||||
static Predicate<String> nonEmpty = s -> s != null && !s.isEmpty();
|
||||
|
||||
@@ -10,6 +13,17 @@ public class Main {
|
||||
return strings.stream().filter(nonEmpty).cou<caret>nt();
|
||||
}
|
||||
|
||||
private Set<Identifier> test(Set<Identifier> identifiers) {
|
||||
return identifiers.stream().filter(isReady(identifiers)).collect(toSet());
|
||||
}
|
||||
|
||||
private Predicate<? super Identifier> isReady(Set<Identifier> identifiers) {
|
||||
return null;
|
||||
}
|
||||
|
||||
private static class Identifier {
|
||||
}
|
||||
|
||||
private static long testStreamOfFunctions(List<Predicate<String>> predicates, List<String> strings) {
|
||||
return predicates.stream().filter(pred -> pred != null)
|
||||
.flatMap(p -> strings.stream().filter(p)).count();
|
||||
|
||||
Reference in New Issue
Block a user