mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 18:50:54 +07:00
[java-inspections] IDEA-346005 Add new inspection: Unnecessary keySet() call
GitOrigin-RevId: d1f1db0ae939017a8550b91cd8742dc222a8db99
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ecc3d78a3a
commit
ac0c57748b
@@ -0,0 +1,15 @@
|
||||
// "Fix all 'Redundant 'Collection' operation' problems in file" "true"
|
||||
import java.util.*;
|
||||
|
||||
class Test {
|
||||
void test(Map<String, String> map) {
|
||||
if (map.isEmpty()) return;
|
||||
if (map.isEmpty()) return;
|
||||
map.remove("oops");
|
||||
map.values().remove("oops");
|
||||
if (map.size() > 10) return;
|
||||
if (map.size() > 10) return;
|
||||
map.clear();
|
||||
map.clear();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// "Fix all 'Redundant 'Collection' operation' problems in file" "true"
|
||||
import java.util.*;
|
||||
|
||||
class Test {
|
||||
void test(Map<String, String> map) {
|
||||
if (map.ke<caret>ySet().isEmpty()) return;
|
||||
if (map.values().isEmpty()) return;
|
||||
map.keySet().remove("oops");
|
||||
map.values().remove("oops");
|
||||
if (map.keySet().size() > 10) return;
|
||||
if (map.values().size() > 10) return;
|
||||
map.keySet().clear();
|
||||
map.values().clear();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user