IDEA-51920 'Suspicious call to Map.get' inspection should be aware of dataflow type information

This commit is contained in:
peter
2011-12-30 16:18:34 +01:00
parent 52e6e8e2d7
commit 75c5872a0a
3 changed files with 23 additions and 1 deletions
@@ -0,0 +1,11 @@
import java.lang.Integer;
import java.util.Map;
class Clazz {
void f(Map<Integer, String> map, Object o) {
if (o instanceof Integer && map.containsKey(o)) {
System.out.println();
}
}
}
@@ -17,6 +17,7 @@ public class SuspiciousCollectionMethodCallsTest extends LightCodeInsightFixture
myFixture.testHighlighting(getTestName(false) + ".java");
}
public void testUseDfa() throws Exception { doTest(); }
public void testWildcard() throws Exception { doTest(); }
public void testIgnoreConvertible() throws Exception {
myTool.REPORT_CONVERTIBLE_METHOD_CALLS = false;