mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 09:19:13 +07:00
StreamToLoop: support parentheses inside flatMap
This commit is contained in:
+2
-2
@@ -16,12 +16,12 @@ public class Main {
|
||||
public static void testComplexFilter(List<String> list) {
|
||||
System.out.println(list.stream()
|
||||
.filter(x -> x != null)
|
||||
.flatMap(s -> IntStream.range(0, 10).boxed().filter(Predicate.isEqual(s.length())))
|
||||
.flatMap(s -> (IntStream.range(0, 10).boxed().filter(Predicate.isEqual(s.length()))))
|
||||
.collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
public void testConditional(List<List<String>> list) {
|
||||
list.stream().flatMap(lst -> lst == null ? Stream.empty() : lst.stream()).forEach(System.out::println);
|
||||
list.stream().flatMap(lst -> lst == null ? (Stream.empty()) : (lst.stream())).forEach(System.out::println);
|
||||
}
|
||||
|
||||
private static long testDistinctUnpluralize(List<List<String>> nested) {
|
||||
|
||||
Reference in New Issue
Block a user