commons-commits mailing list archives

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

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

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=825148&r1=825147&r2=825148&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:16:50 2009
@@ -38,7 +38,7 @@
 
     /**
      * Factory returning the singleton instance.
-     * 
+     *
      * @return the singleton instance
      * @since Commons Collections 3.1
      */
@@ -56,7 +56,7 @@
 
     /**
      * Do nothing.
-     * 
+     *
      * @param input  the input object
      */
     public void execute(E input) {
@@ -68,6 +68,12 @@
      */
     @Override
     public boolean equals(Object arg0) {
+        if (arg0 == this) {
+            return true;
+        }
+        if (arg0 instanceof NOPClosure == false) {
+            return false;
+        }
         return arg0.hashCode() == this.hashCode();
     }
 



Mime
View raw message