diff --git a/src/java/org/apache/commons/collections/functors/NOPClosure.java b/src/java/org/apache/commons/collections/functors/NOPClosure.java index 789193e8b..4da423d0e 100644 --- a/src/java/org/apache/commons/collections/functors/NOPClosure.java +++ b/src/java/org/apache/commons/collections/functors/NOPClosure.java @@ -28,7 +28,7 @@ import org.apache.commons.collections.Closure; * * @author Stephen Colebourne */ -public class NOPClosure implements Closure, Serializable { +public final class NOPClosure implements Closure, Serializable { /** Serial version UID */ private static final long serialVersionUID = 3518477308466486130L; @@ -68,13 +68,7 @@ public class NOPClosure implements Closure, Serializable { */ @Override public boolean equals(Object arg0) { - if (arg0 == this) { - return true; - } - if (arg0 instanceof NOPClosure == false) { - return false; - } - return arg0.hashCode() == this.hashCode(); + return arg0 == this || arg0 instanceof NOPClosure; } /**