mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-09 20:42:52 +07:00
suspicious collections call: process removeAll (IDEA-108755)
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import java.util.*;
|
||||
|
||||
|
||||
class Simple {
|
||||
public static void main(String[] args) {
|
||||
class O {}
|
||||
|
||||
Map<O, String> someData = new HashMap<O, String>();
|
||||
Set<String> set = new HashSet<String>();
|
||||
Set<O> setO = new HashSet<O>();
|
||||
|
||||
set.removeAll(<warning descr="'Set<String>' may not contain objects of type 'O'">someData.keySet()</warning>);
|
||||
setO.removeAll(someData.keySet());
|
||||
|
||||
}
|
||||
}
|
||||
+1
@@ -20,6 +20,7 @@ public class SuspiciousCollectionMethodCallsTest extends LightCodeInsightFixture
|
||||
}
|
||||
|
||||
public void testConcurrentHashMap() throws Exception { doTest(); }
|
||||
public void testRemoveAllCall() throws Exception { doTest(); }
|
||||
public void testUseDfa() throws Exception { doTest(); }
|
||||
public void testWildcard() throws Exception { doTest(); }
|
||||
public void testIgnoreConvertible() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user