[findbugs] equals() must return false for null argument
The contract defined by java.lang.Object.equals() requires that it must return false if passed a null argument. Change-Id: I0b54beeeaed7fbd87d7e3ea5c4d4f5ae3c7d6137 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
This commit is contained in:
@@ -162,6 +162,8 @@ public class ProjectState {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
|
if (o == null)
|
||||||
|
return false;
|
||||||
Grant grant = (Grant) o;
|
Grant grant = (Grant) o;
|
||||||
return group.equals(grant.group) && pattern.equals(grant.pattern);
|
return group.equals(grant.group) && pattern.equals(grant.pattern);
|
||||||
}
|
}
|
||||||
|
@@ -94,6 +94,8 @@ public class AndPredicate<T> extends Predicate<T> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(final Object other) {
|
public boolean equals(final Object other) {
|
||||||
|
if (other == null)
|
||||||
|
return false;
|
||||||
return getClass() == other.getClass()
|
return getClass() == other.getClass()
|
||||||
&& getChildren().equals(((Predicate<?>) other).getChildren());
|
&& getChildren().equals(((Predicate<?>) other).getChildren());
|
||||||
}
|
}
|
||||||
|
@@ -39,6 +39,8 @@ public abstract class IntPredicate<T> extends OperatorPredicate<T> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(final Object other) {
|
public boolean equals(final Object other) {
|
||||||
|
if (other == null)
|
||||||
|
return false;
|
||||||
if (getClass() == other.getClass()) {
|
if (getClass() == other.getClass()) {
|
||||||
final IntPredicate<?> p = (IntPredicate<?>) other;
|
final IntPredicate<?> p = (IntPredicate<?>) other;
|
||||||
return getOperator().equals(p.getOperator())
|
return getOperator().equals(p.getOperator())
|
||||||
|
@@ -74,6 +74,8 @@ public class NotPredicate<T> extends Predicate<T> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(final Object other) {
|
public boolean equals(final Object other) {
|
||||||
|
if (other == null)
|
||||||
|
return false;
|
||||||
return getClass() == other.getClass()
|
return getClass() == other.getClass()
|
||||||
&& getChildren().equals(((Predicate<?>) other).getChildren());
|
&& getChildren().equals(((Predicate<?>) other).getChildren());
|
||||||
}
|
}
|
||||||
|
@@ -50,6 +50,8 @@ public abstract class OperatorPredicate<T> extends Predicate<T> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(final Object other) {
|
public boolean equals(final Object other) {
|
||||||
|
if (other == null)
|
||||||
|
return false;
|
||||||
if (getClass() == other.getClass()) {
|
if (getClass() == other.getClass()) {
|
||||||
final OperatorPredicate<?> p = (OperatorPredicate<?>) other;
|
final OperatorPredicate<?> p = (OperatorPredicate<?>) other;
|
||||||
return getOperator().equals(p.getOperator())
|
return getOperator().equals(p.getOperator())
|
||||||
|
@@ -94,6 +94,8 @@ public class OrPredicate<T> extends Predicate<T> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(final Object other) {
|
public boolean equals(final Object other) {
|
||||||
|
if (other == null)
|
||||||
|
return false;
|
||||||
return getClass() == other.getClass()
|
return getClass() == other.getClass()
|
||||||
&& getChildren().equals(((Predicate<?>) other).getChildren());
|
&& getChildren().equals(((Predicate<?>) other).getChildren());
|
||||||
}
|
}
|
||||||
|
@@ -81,6 +81,8 @@ public class VariablePredicate<T> extends Predicate<T> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(final Object other) {
|
public boolean equals(final Object other) {
|
||||||
|
if (other == null)
|
||||||
|
return false;
|
||||||
if (getClass() == other.getClass()) {
|
if (getClass() == other.getClass()) {
|
||||||
final VariablePredicate<?> v = (VariablePredicate<?>) other;
|
final VariablePredicate<?> v = (VariablePredicate<?>) other;
|
||||||
return getName().equals(v.getName())
|
return getName().equals(v.getName())
|
||||||
|
@@ -45,6 +45,8 @@ public final class WildPatternPredicate<T> extends OperatorPredicate<T> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(final Object other) {
|
public boolean equals(final Object other) {
|
||||||
|
if (other == null)
|
||||||
|
return false;
|
||||||
if (getClass() == other.getClass()) {
|
if (getClass() == other.getClass()) {
|
||||||
final WildPatternPredicate<?> p = (WildPatternPredicate<?>) other;
|
final WildPatternPredicate<?> p = (WildPatternPredicate<?>) other;
|
||||||
return getOperator().equals(p.getOperator());
|
return getOperator().equals(p.getOperator());
|
||||||
|
Reference in New Issue
Block a user