I'm using org.eclipse.jdt.annotation.NonNull to add extra information for static null analysis. I donn't know how to annotate arrays correctly:
- How can I say that an array reference is non-null?
- How can I say that an array consists of non-null elements?
I've tested:
public static void test(@NonNull String[] a) {
assert a != null;
}
public static void main(String[] args) {
test(null);
}
However, Eclipse doesn't mark test(null);
as wrong.