package foo; import javax.annotation.*; import javax.annotation.meta.TypeQualifierDefault; import javax.annotation.meta.When; import java.lang.annotation.ElementType; @Nonnull @TypeQualifierDefault({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.TYPE_USE}) @interface NonnullByDefault {} @Nonnull(when = When.MAYBE) @TypeQualifierDefault({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.TYPE_USE}) @interface NullableByDefault { } @NullableByDefault class Bug { // This is emitting a warning when it shouldn't be. private String id; public String getId() { return id; } public void setId(String id) { this.id = id; } }