hardcode Map#get as having unknown nullity (IDEA-176626)

until we have a better solution
This commit is contained in:
peter
2017-10-12 20:02:39 +02:00
parent 6551b38303
commit 4eb2fe474e
3 changed files with 30 additions and 0 deletions
@@ -0,0 +1,17 @@
import foo.*;
import java.util.*;
class Test {
public void main(Map<@NotNull String, @NotNull Integer> map, HashMap<@NotNull String, @NotNull Integer> hashMap) {
Integer value = map.get("y");
if (value == null) {
System.out.println("it's not contained");
}
value = hashMap.get("y");
if (value == null) {
System.out.println("it's not contained");
}
}
}
@@ -197,6 +197,8 @@ public class DataFlowInspection8Test extends DataFlowInspectionTestCase {
public void testStreamInlining() { doTest(); }
public void testStreamComparatorInlining() { doTest(); }
public void testStreamKnownSource() { doTest(); }
public void testMapGetWithNotNullKeys() { doTestWithCustomAnnotations(); }
public void testMethodVsExpressionTypeAnnotationConflict() {
setupAmbiguousAnnotations("withTypeUse", myFixture);