-
Notifications
You must be signed in to change notification settings - Fork 629
Open
Description
Although the title already says all, here is a MWE:
// file: package-info.java
@NonNullByDefault
package ghIssues.issue3324;
import org.eclipse.jdt.annotation.NonNullByDefault;
package ghIssues.issue3324;
import javax.annotation.Nonnull;
public interface DummyInterface{
String getNameDefaultNonnull();
@Nonnull
String getNameExplicitNonnullFromInterface();
}
package ghIssues.issue3324;
public abstract class DummyAbs {
public abstract String getNameDefaultNonnullFromAbs();
}
package ghIssues.issue3324;
import javax.annotation.Nullable;
public class DummyImpl extends DummyAbs implements DummyInterface {
@Override
public @Nullable String getNameDefaultNonnull() {
return null;
}
@Override
public @Nullable String getNameExplicitNonnullFromInterface() {
return null;
}
@Override
public @Nullable String getNameDefaultNonnullFromAbs() {
return null;
}
}
First I was not sure if SpotBugs can detect issues that involve multiple classes / interfaces, but since the above MWE shows 1 NP_METHOD_RETURN_RELAXING_ANNOTATION
, I guess I was wrong, SpotBugs can indeed detect such issues 🎉
However, in the above example I would have expected 3 reports of NP_METHOD_RETURN_RELAXING_ANNOTATION
instead of 1.
Metadata
Metadata
Assignees
Labels
No labels