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:
Tagir Valeev
2017-01-30 14:00:52 +03:00
parent b01ac7a17b
commit e8c6ba183b
3 changed files with 25 additions and 1 deletions
@@ -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()
}
}
@@ -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);
}
}
}