[COLLECTIONS-341]

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@825151 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Matthew Jason Benson 2009-10-14 14:23:13 +00:00
parent 2e29ad2a8f
commit 73579cc5ef
1 changed files with 2 additions and 8 deletions

View File

@ -28,7 +28,7 @@ import org.apache.commons.collections.Closure;
*
* @author Stephen Colebourne
*/
public class NOPClosure<E> implements Closure<E>, Serializable {
public final class NOPClosure<E> implements Closure<E>, Serializable {
/** Serial version UID */
private static final long serialVersionUID = 3518477308466486130L;
@ -68,13 +68,7 @@ public class NOPClosure<E> implements Closure<E>, 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<?>;
}
/**