When an interface returns @Nonnull, an implementation should not be able to override this with @Nullable.
FindBugs version: 3.0.0
JDK/JRE version: Java 8
public interface CustomInterface { @Nonnull public Object getObject(); } public class ConcreteClass implements CustomInterface { @Override @Nullable // Return relaxes nullness public Object getObject() { return null; } }
Yep. We catch only @CheckForNull here, not @Nullable.
Fix: https://code.google.com/p/findbugs/source/detail?r=d751a7d580bbe3c8b444e92ddbeb34b44508b883