You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the example below, SpotBugs reports no warning. The equals method takes a parameter that is marked as @javax.annotation.Nonnull . So it obeys this rule correctly.
However, in the example below, SpotBugs reports a warning at line 3 if we use @org.netbeans.api.annotations.common.NonNull instead. Actually, @javax.annotation.Nonnull and @org.netbeans.api.annotations.common.NonNull are equivalent. So, this exmaple does not violate the rule NP_EQUALS_SHOULD_HANDLE_NULL_ARGUMENT and the warning is a false positive.
publicclassTest {
publicbooleanequals(@org.netbeans.api.annotations.common.NonNullObjecta) { //report a warning, but it is an FPreturna.hashCode() == this.hashCode();
}
}
I use the cmd spotbugs -textui -low -xml -output= report.xml -auxclasspath org.eclipse.jdt.annotation-2.2.700.jar Test.class
The text was updated successfully, but these errors were encountered:
* test: reproducer for issue #2558
* Recognize more nullability annotations
* fix: added back check for Eclipse's NonNullByDefault
* fix: made eclipseNonNullByDefault a field again since used externally
* fix: with the other changes the smoke tests flag that field as NonNull
LogicalLocation.properties should be annotated NonNull
* doc: added changelog entry
* fix: updated the comment now that the false positive is fixed
Version: 4.7.3
I found a false positive about the rule NP_EQUALS_SHOULD_HANDLE_NULL_ARGUMENT.
In the example below, SpotBugs reports no warning. The
equals
method takes a parameter that is marked as@javax.annotation.Nonnull
. So it obeys this rule correctly.However, in the example below, SpotBugs reports a warning at line 3 if we use
@org.netbeans.api.annotations.common.NonNull
instead. Actually,@javax.annotation.Nonnull
and@org.netbeans.api.annotations.common.NonNull
are equivalent. So, this exmaple does not violate the rule NP_EQUALS_SHOULD_HANDLE_NULL_ARGUMENT and the warning is a false positive.I use the cmd
spotbugs -textui -low -xml -output= report.xml -auxclasspath org.eclipse.jdt.annotation-2.2.700.jar Test.class
The text was updated successfully, but these errors were encountered: