mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
IDEA-185812 Allow to force explicit toCollection(ArrayList::new) instead of toList() in "Subsequent steps can be fused into Stream API"
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
// "Fix all 'Subsequent steps can be fused into Stream API chain' problems in file" "true"
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class Test {
|
||||
interface Foo {
|
||||
}
|
||||
|
||||
// IDEA-179303
|
||||
void test1(Stream<Foo> fooStream) {
|
||||
ArrayList<Foo> collectedFoos = fooStream.collect(Collectors.toCollection(ArrayList::new));
|
||||
}
|
||||
|
||||
void test2(Stream<Foo> fooStream) {
|
||||
List<Foo> collectedFoos = fooStream.collect(Collectors.toCollection(ArrayList::new));
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// "Fix all 'Subsequent steps can be fused into Stream API chain' problems in file" "true"
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class Test {
|
||||
interface Foo {
|
||||
}
|
||||
|
||||
// IDEA-179303
|
||||
void test1(Stream<Foo> fooStream) {
|
||||
ArrayList<Foo> collectedFoos = new ArrayList<>(fooStream.co<caret>llect(Collectors.toList()));
|
||||
}
|
||||
|
||||
void test2(Stream<Foo> fooStream) {
|
||||
List<Foo> collectedFoos = new ArrayList<>(fooStream.collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user