commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r825151 - /commons/proper/collections/trunk/src/java/org/apache/commons/collections/functors/NOPClosure.java
Date Wed, 14 Oct 2009 14:23:14 GMT
Author: mbenson
Date: Wed Oct 14 14:23:13 2009
New Revision: 825151

URL: http://svn.apache.org/viewvc?rev=825151&view=rev
Log:
[COLLECTIONS-341]

Modified:
    commons/proper/collections/trunk/src/java/org/apache/commons/collections/functors/NOPClosure.java

Modified: commons/proper/collections/trunk/src/java/org/apache/commons/collections/functors/NOPClosure.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/java/org/apache/commons/collections/functors/NOPClosure.java?rev=825151&r1=825150&r2=825151&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/java/org/apache/commons/collections/functors/NOPClosure.java
(original)
+++ commons/proper/collections/trunk/src/java/org/apache/commons/collections/functors/NOPClosure.java
Wed Oct 14 14:23:13 2009
@@ -28,7 +28,7 @@
  *
  * @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 @@
      */
     @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<?>;
     }
 
     /**



Mime
View raw message