[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:
Matthias Sohn
2011-03-09 23:32:32 +01:00
parent 0ff5ff0112
commit 089f04e516
8 changed files with 16 additions and 0 deletions

View File

@@ -94,6 +94,8 @@ public class AndPredicate<T> extends Predicate<T> {
@Override
public boolean equals(final Object other) {
if (other == null)
return false;
return getClass() == other.getClass()
&& getChildren().equals(((Predicate<?>) other).getChildren());
}