commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r646494 - /commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/IteratorToGeneratorAdapter.java
Date Wed, 09 Apr 2008 19:30:55 GMT
Author: mbenson
Date: Wed Apr  9 12:30:53 2008
New Revision: 646494

URL: http://svn.apache.org/viewvc?rev=646494&view=rev
Log:
== check in equals

Modified:
    commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/IteratorToGeneratorAdapter.java

Modified: commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/IteratorToGeneratorAdapter.java
URL: http://svn.apache.org/viewvc/commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/IteratorToGeneratorAdapter.java?rev=646494&r1=646493&r2=646494&view=diff
==============================================================================
--- commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/IteratorToGeneratorAdapter.java
(original)
+++ commons/sandbox/functor/trunk/src/main/java/org/apache/commons/functor/generator/IteratorToGeneratorAdapter.java
Wed Apr  9 12:30:53 2008
@@ -64,12 +64,14 @@
      * {@inheritDoc}
      */
     public boolean equals(Object obj) {
-        if (obj instanceof IteratorToGeneratorAdapter) {
-            IteratorToGeneratorAdapter that = (IteratorToGeneratorAdapter) obj;
-            return this.iter.equals(that.iter);
-        } else {
+        if (obj == this) {
+            return true;
+        }
+        if (obj instanceof IteratorToGeneratorAdapter == false) {
             return false;
         }
+        IteratorToGeneratorAdapter that = (IteratorToGeneratorAdapter) obj;
+        return this.iter.equals(that.iter);
     }
 
     /**



Mime
View raw message