I am using org.eclipse.jdt.annotation.NonNull to add additional information for static null analysis. I don't know how to annotate arrays correctly:
- How can I say that an array reference is not null?
- How can I say that an array consists of non-zero elements?
I tested:
public static void test(@NonNull String[] a) {
assert a != null;
}
public static void main(String[] args) {
test(null);
}
However, Eclipse does not mark it test(null);as erroneous.
source
share