mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-17 16:19:58 +07:00
CollectMigration: do not wrap nullable values with toUnmodifiableList/Set (IDEA-207976)
This commit is contained in:
+7
@@ -3,6 +3,13 @@ import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
class Test {
|
||||
|
||||
List<String> testNullable(List<Integer> input) {
|
||||
// suppress for nullable
|
||||
List<String> list = input.stream().map(integer -> integer == null ? null : integer.toString()).collect(Collectors.toList());
|
||||
return Collections.unmodifiableList(list);
|
||||
}
|
||||
|
||||
List<String> test(String[] list) {
|
||||
return Arrays.stream(list).filter(s -> !s.isEmpty()).collect(Collectors.toUnmodifiableList());
|
||||
}
|
||||
|
||||
+10
@@ -2,6 +2,16 @@
|
||||
import java.util.*;
|
||||
|
||||
class Test {
|
||||
|
||||
List<String> testNullable(List<Integer> input) {
|
||||
// suppress for nullable
|
||||
List<String> list = new ArrayList<>();
|
||||
for (var integer : input) {
|
||||
list.add(integer == null ? null : integer.toString());
|
||||
}
|
||||
return Collections.unmodifiableList(list);
|
||||
}
|
||||
|
||||
List<String> test(String[] list) {
|
||||
List<String> result = new LinkedList<>();
|
||||
f<caret>or (int i = 0; i < list.length; i++) {
|
||||
|
||||
Reference in New Issue
Block a user