mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-06 05:10:22 +07:00
RedundantCollectionOperation: more tests (IDEA-CR-28150)
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
// "Remove the 'contains' check" "true"
|
||||
import java.util.*;
|
||||
|
||||
class Test {
|
||||
void test(Set<String> set, String key) {
|
||||
set.add(key);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Remove the 'contains' check" "true"
|
||||
import java.util.*;
|
||||
|
||||
class Test {
|
||||
void test(Set<String> set, String key) {
|
||||
if(!set.co<caret>ntains(key)) {
|
||||
set.add(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Remove the 'contains' check" "false"
|
||||
import java.util.*;
|
||||
|
||||
class Test {
|
||||
void test(Set<String> set, String key) {
|
||||
if(set.co<caret>ntains(key)) {
|
||||
set.add(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Remove the 'contains' check" "false"
|
||||
import java.util.*;
|
||||
|
||||
class Test {
|
||||
void test(Collection<String> set, String key) {
|
||||
if(!set.co<caret>ntains(key)) {
|
||||
set.add(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Remove the 'contains' check" "false"
|
||||
import java.util.List;
|
||||
|
||||
class Test {
|
||||
void test(List<String> list, String key) {
|
||||
if(!list.co<caret>ntains(/*contains!!!*/key)) {
|
||||
list.remove(/*remove!!!*/key);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user