stream api: fix primitive boxing (IDEA-151494)

This commit is contained in:
Anna Kozlova
2016-02-15 15:49:06 +01:00
parent b424316b32
commit 7a671c53f8
3 changed files with 26 additions and 1 deletions
@@ -0,0 +1,9 @@
// "Replace with collect" "true"
import java.util.List;
import java.util.stream.Collectors;
class Sample {
public void some(List<String> from, List<Integer> to) {
to.addAll(from.stream().map(String::length).collect(Collectors.toList()));
}
}
@@ -0,0 +1,10 @@
// "Replace with collect" "true"
import java.util.List;
class Sample {
public void some(List<String> from, List<Integer> to) {
for (String key : fr<caret>om) {
to.add(key.length());
}
}
}