mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
stream api: fix primitive boxing (IDEA-151494)
This commit is contained in:
+9
@@ -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()));
|
||||
}
|
||||
}
|
||||
+10
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user