mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-06 01:06:54 +07:00
Fixes IDEA-349386 Don't suggest List/Set/Map.copyOf when elements are annotated @Nullable GitOrigin-RevId: f2c1298394f204732437d304f68272f6cf406cc0
19 lines
599 B
Java
19 lines
599 B
Java
// "Fix all 'Immutable collection creation can be replaced with collection factory call' problems in file" "true"
|
|
import java.util.*;
|
|
|
|
class Main {
|
|
private final List<String> myList;
|
|
private final List<String> myList3;
|
|
private final Map<String, String> myMap;
|
|
private final Set<String> mySet;
|
|
private final Set<String> mySet2;
|
|
|
|
Main(Collection<String> list, Map<? extends String, ? extends String> map,
|
|
Set<String> set) {
|
|
myList = List.copyOf(list);
|
|
myList2 = List.copyOf(set);
|
|
myMap = Map.copyOf(map);
|
|
mySet = Set.copyOf(set);
|
|
mySet2 = Set.copyOf(list);
|
|
}
|
|
} |