IDEA-178922 A few more null annotation problems with arrays

This commit is contained in:
peter
2017-10-11 22:01:07 +02:00
parent 75ee2ffe59
commit abca97e2ad
4 changed files with 41 additions and 7 deletions
@@ -0,0 +1,10 @@
import typeUse.*;
class Test {
private byte <warning descr="Not-null fields must be initialized">@NotNull</warning> [] field;
private byte @NotNull [] initField;
{
initField = new byte[0];
}
}
@@ -0,0 +1,14 @@
import typeUse.*;
class Super {
void m1(byte @NotNull [] p) {}
void m2(byte @NotNull [] p) {}
void m3(byte[] p) {}
}
class Sub extends Super {
void m1(byte @NotNull [] p) {}
void m2(byte[] <warning descr="Not annotated parameter overrides @NotNull parameter">p</warning>) {}
void m3(byte <warning descr="Parameter annotated @NotNull should not override non-annotated parameter">@NotNull</warning> [] p) {}
}