mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 00:11:26 +07:00
stream migration: collapse identity matching (IDEA-122706)
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
// "Replace with collect" "true"
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class Collect {
|
||||
class Person {}
|
||||
|
||||
void collectNames(List<Person> persons){
|
||||
List<Person> names = persons.stream().collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// "Replace with collect" "true"
|
||||
import java.util.*;
|
||||
|
||||
public class Collect {
|
||||
class Person {}
|
||||
|
||||
void collectNames(List<Person> persons){
|
||||
List<Person> names = new ArrayList<>();
|
||||
for (Person person : pers<caret>ons) {
|
||||
names.add(person);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user