Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/redundantCollectionOperation/afterMapKeySetValues.java
Tagir Valeev ac0c57748b [java-inspections] IDEA-346005 Add new inspection: Unnecessary keySet() call
GitOrigin-RevId: d1f1db0ae939017a8550b91cd8742dc222a8db99
2024-09-17 07:28:39 +00:00

15 lines
369 B
Java

// "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();
}
}