mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
FuseStreamOperationsInspection: fixes according to review IDEA-CR-24873
1. Code sample in description 2. Supported toCollection with parameterized method-reference
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
// "Fuse ArrayList into the Stream API chain" "true"
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class Test {
|
||||
void test(Stream<String> stream) {
|
||||
List<Object> objects = stream.distinct().collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Fuse ArrayList into the Stream API chain" "true"
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class Test {
|
||||
void test(Stream<String> stream) {
|
||||
List<Object> objects = new ArrayList<>(stream.co<caret>llect(Collectors.toCollection(LinkedHashSet<Object>::new)));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user