mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-17 01:57:50 +07:00
IDEA-207874 Inspection to replace Map.keySet().contains(K) with Map.containsKey(K)
This commit is contained in:
+10
@@ -0,0 +1,10 @@
|
||||
// "Replace with 'Map.containsKey()'" "true"
|
||||
import java.util.Map;
|
||||
|
||||
class Test {
|
||||
void test(Map<String, String> map, String key) {
|
||||
if(map.containsKey(key)) {
|
||||
System.out.println("contains");
|
||||
}
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Replace with 'Map.containsValue()'" "true"
|
||||
import java.util.Map;
|
||||
|
||||
class Test {
|
||||
void test(Map<String, String> map, String key) {
|
||||
if(map.containsValue(key)) {
|
||||
System.out.println("contains");
|
||||
}
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Replace with 'Map.containsKey()'" "true"
|
||||
import java.util.Map;
|
||||
|
||||
class Test {
|
||||
void test(Map<String, String> map, String key) {
|
||||
if(map.keySet().cont<caret>ains(key)) {
|
||||
System.out.println("contains");
|
||||
}
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Replace with 'Map.containsValue()'" "true"
|
||||
import java.util.Map;
|
||||
|
||||
class Test {
|
||||
void test(Map<String, String> map, String key) {
|
||||
if(map.values().cont<caret>ains(key)) {
|
||||
System.out.println("contains");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user