incubator-ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r802753 - /incubator/ace/trunk/webui/src/org/apache/ace/client/services/Descriptor.java
Date Mon, 10 Aug 2009 11:45:33 GMT
Author: marrs
Date: Mon Aug 10 11:45:33 2009
New Revision: 802753

URL: http://svn.apache.org/viewvc?rev=802753&view=rev
Log:
ACE-36 fixed the issue by changing the implementation of equals and hashCode to take into
account the actuall classname instead of doing an "instanceof Descriptor".

Modified:
    incubator/ace/trunk/webui/src/org/apache/ace/client/services/Descriptor.java

Modified: incubator/ace/trunk/webui/src/org/apache/ace/client/services/Descriptor.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/webui/src/org/apache/ace/client/services/Descriptor.java?rev=802753&r1=802752&r2=802753&view=diff
==============================================================================
--- incubator/ace/trunk/webui/src/org/apache/ace/client/services/Descriptor.java (original)
+++ incubator/ace/trunk/webui/src/org/apache/ace/client/services/Descriptor.java Mon Aug 10
11:45:33 2009
@@ -47,10 +47,8 @@
      */
     @Override
     public boolean equals(Object obj) {
-        if (obj instanceof Descriptor) {
-            return getName().equals(((Descriptor) obj).getName());
-        }
-        return false;
+        return getClass().equals(obj.getClass()) &&
+            getName().equals(((Descriptor) obj).getName());
     }
     
     /**
@@ -58,6 +56,6 @@
      */
     @Override
     public int hashCode() {
-        return getName().hashCode();
+        return getName().hashCode() ^ getClass().hashCode();
     }
 }
\ No newline at end of file



Mime
View raw message