suspicious collections call: process removeAll (IDEA-108755)

This commit is contained in:
Anna Kozlova
2014-05-31 20:36:02 +04:00
parent e9e95238a6
commit 6b5c924a4e
3 changed files with 42 additions and 0 deletions
@@ -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());
}
}