mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
StreamApiMigration: register comments from post-loop operations like sorting
This commit is contained in:
+3
@@ -5,6 +5,9 @@ import java.util.stream.Stream;
|
||||
|
||||
public class Test {
|
||||
public void testSetListSort(String[] args) {
|
||||
// foo
|
||||
// bar
|
||||
/*baz*/
|
||||
System.out.println(Arrays.stream(args).distinct().sorted().toArray());
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -6,8 +6,8 @@ import java.util.stream.Stream;
|
||||
public class Test {
|
||||
public void testSetListSort(String[] args) {
|
||||
Set<String> set = Arrays.stream(args).co<caret>llect(Collectors.toSet());
|
||||
List<String> list = new ArrayList<>(set);
|
||||
list.sort(null);
|
||||
System.out.println(list.toArray());
|
||||
List<String> list = new ArrayList<>(set); // foo
|
||||
list.sort(null); // bar
|
||||
System.out.println(list.toArray(/*baz*/));
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -10,6 +10,7 @@ public class Collect {
|
||||
}
|
||||
|
||||
void collectNames(List<Person> persons){
|
||||
List<String> names = persons.stream().map(Person::getName).sorted(Comparator.comparing(Person::getName)).collect(Collectors.toList());
|
||||
List<String> names = persons.stream().map(Person::getName).sorted(Comparator.comparing(/*c2*/Person::getName)).collect(Collectors.toList());
|
||||
// comment
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -13,6 +13,7 @@ public class Collect {
|
||||
for (Person person : pers<caret>ons) {
|
||||
names.add(person.getName());
|
||||
}
|
||||
Collections.sort(names, Comparator.comparing(Person::getName));
|
||||
Collections.// comment
|
||||
sort(names, Comparator.comparing(/*c2*/Person::getName));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user