You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ace.apache.org by ma...@apache.org on 2009/08/10 13:45:33 UTC

svn commit: r802753 - /incubator/ace/trunk/webui/src/org/apache/ace/client/services/Descriptor.java

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