IDEA-89654 Incorrect control flow warning with @Nullable

This commit is contained in:
peter
2012-09-07 19:08:41 +02:00
parent 316e41c33b
commit aba62f142b
3 changed files with 121 additions and 67 deletions
@@ -0,0 +1,13 @@
import org.jetbrains.annotations.*;
class TestIDEAWarn {
void method(@Nullable MyEnum e) {
if (e != MyEnum.foo) {return;}
System.out.println(e.hashCode());
}
void method2(@Nullable MyEnum e) {
if (e == MyEnum.foo) {
System.out.println(e.hashCode());
}
}
}
enum MyEnum { foo, bar }
@@ -73,5 +73,6 @@ public class DataFlowInspectionFixtureTest extends JavaCodeInsightFixtureTestCas
public void testEqualsNotNull() throws Throwable { doTest(); }
public void testVisitFinallyOnce() throws Throwable { doTest(); }
public void testNotEqualsDoesntImplyNotNullity() throws Throwable { doTest(); }
public void testEqualsEnumConstant() throws Throwable { doTest(); }
}