IDEA-40195 'constant expression' and @NotNull

This commit is contained in:
peter
2012-10-31 20:06:45 +01:00
parent 10cfc6c5cc
commit 2bad268da5
4 changed files with 53 additions and 7 deletions
@@ -0,0 +1,21 @@
import org.jetbrains.annotations.NotNull;
class Test {
private static void test(@NotNull Object foo) {
assert foo != null;
}
private static void test2(@NotNull Object foo) {
if (foo == null) {
throw new IllegalArgumentException();
}
}
private static void test3(@NotNull Object foo) {
if (foo == null) throw new IllegalArgumentException();
}
private static void test4(@NotNull Object foo) {
if (<warning descr="Condition 'foo != null' is always 'true'">foo != null</warning>) throw new IllegalArgumentException();
}
}