IDEA-127352 no warning when @NotNull annotated method returns null

This commit is contained in:
peter
2014-09-13 13:02:21 +02:00
parent 79e9cebe15
commit 4d0c8ab748
3 changed files with 16 additions and 0 deletions
@@ -0,0 +1,11 @@
import org.jetbrains.annotations.NotNull;
class BrokenAlignment {
private static final String DEFAULT = null;
@NotNull
public String getDefaultValue() {
return <warning descr="Expression 'DEFAULT' might evaluate to null but is returned by the method declared as @NotNull">DEFAULT</warning>;
}
}
@@ -111,6 +111,7 @@ public class DataFlowInspectionTest extends LightCodeInsightFixtureTestCase {
public void testSynchronizingOnNullable() throws Throwable { doTest(); }
public void testSwitchOnNullable() { doTest(); }
public void testReturningNullFromVoidMethod() throws Throwable { doTest(); }
public void testReturningNullConstant() { doTest(); }
public void testCatchRuntimeException() throws Throwable { doTest(); }
// IDEA-129331