I am using IntelliJ 13.1.5 and Java 8 SDK and I've set up IntelliJ built-in nullness checker to use checkers.nullness.quals.NonNull
as the annotation of my choice.
Now, when I write a simple class like this
import checkers.nullness.quals.NonNull;
public class Myclass {
public void doSomething(@NonNull String someString) {
}
}
IntelliJ underlines the @NonNull
annotation with the warning
Cannot annotate with both @NonNull and @NonNull
First I thought it has something to do with classes that implement interface which also have methods annotated with @NonNull
.
But I also happens with concrete classes like the example above.
My next guess was that multiple libraries use the same annotation name and there might be a name clash. But unfortunately the warning doesn't specify the exact class name with packages. If this is the case, there must be some setting that enables implicit annotations.
How can I get rid of this warning without removing the annotation?