Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/redundantCollectionOperation/beforeAddAllCollectionsSingleton.java
Andrey.Cherkasov cc1c1cc844 [java-inspections] RedundantCollectionOperation: warn 'collection.addAll(List.of("x"))'
'collection.addAll(Set.of("x"))'
'collection.addAll(Collections.singletonList("x"))'

GitOrigin-RevId: 4a9185f774f9368fdcb5377eaeddb108b521f174
2022-01-04 21:57:31 +00:00

11 lines
303 B
Java

// "Fix all 'Redundant 'Collection' operation' problems in file" "true"
import java.util.*;
class Test {
void test(List<Integer> list) {
list.add<caret>All(Collections.singleton(42));
list.addAll(Collections.singletonList(42));
list.addAll(List.of(42));
list.addAll(Set.of(42));
}
}