mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
IDEA-167263 Stream API migration does not work when replacing simple loop on array of primitive types (int, long, double)
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
// "Replace with collect" "true"
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class Test {
|
||||
public static void main(String[] args) {
|
||||
final double[] array = new double[10];
|
||||
final List<Double> list = Arrays.stream(array).boxed().collect(Collectors.toList());
|
||||
// Cannot be replaced with list.addAll()
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// "Replace with collect" "true"
|
||||
import java.util.*;
|
||||
|
||||
public class Test {
|
||||
public static void main(String[] args) {
|
||||
final double[] array = new double[10];
|
||||
final List<Double> list = new ArrayList<>();
|
||||
// Cannot be replaced with list.addAll()
|
||||
for (double d : ar<caret>ray) {
|
||||
list.add(d);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user