I would like to use the "null analysis" feature of Eclipse but I would rather use the javax.annotation.Nonnull annotation than the org.eclipse.jdt.annotation.NonNull annotation. I can't seem to get Eclipse to recognize any custom annotations I configure.
I'm using Eclipse Luna 4.4.2.
I created a new test project that contains only the following class:
package org.example;
import javax.annotation.Nonnull;
public class OmgNulls {
public static void main(String[] args) {
@Nonnull String test = null;
System.out.println(test);
}
}
My compiler settings are configured to use the javax annotations:
My project's includes the checker-1.8.10 JAR to provide the annotations.
With these settings, Eclipse reports 0 errors.
If I check "Use default annotations for null specifications" and change my test class to use Eclipse's annotation, I get:
Anyone know what I'm doing wrong or is this an Eclipse bug maybe? I've also tried the jsr305 JAR from google instead of checker in case that was an issue but that didn't help.