IDEA-139253 TYPE_USE @Nullable-Annotations don't work correctly with arrays

This commit is contained in:
peter
2015-04-16 19:11:46 +03:00
parent 10560f057f
commit ce9914e697
5 changed files with 47 additions and 10 deletions
@@ -0,0 +1,27 @@
import foo.*;
import java.util.List;
class TestCompilerWarnings {
public void m(@NotNull Object x) {
assert x != null;
}
public void test1Array(@Nullable String @NotNull [] x) {
if (<warning descr="Condition 'x == null' is always 'false'">x == null</warning>) {
System.out.println("x is null");
}
m(x);
m(<warning descr="Argument 'x[0]' might be null">x[0]</warning>);
}
public void test2Array(@NotNull String @Nullable [] x) {
if (x == null) {
System.out.println("x is null");
} else {
m(x[0]);
}
m(<warning descr="Argument 'x' might be null">x</warning>);
}
}