Eclipse gives me the warning "Potential null pointer access: The variable ann may be null at this location":
SomeAnnotation ann = type.getAnnotation( SomeAnnotation.class );
Preconditions.checkNotNull( ann, "Missing annotation on %s", type );
for( String value : ann.value() ) { // <-- warning happens here
}
I'm using Eclipse 3.7 and Guava. Is there a way to get rid of this warning?
I could use SuppressWarnings("null")
but I would have to attach it to the method which I feel would be a bad idea.