You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2007/01/02 00:22:30 UTC

svn commit: r491692 - /directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/AbstractExprNode.java

Author: elecharny
Date: Mon Jan  1 15:22:29 2007
New Revision: 491692

URL: http://svn.apache.org/viewvc?view=rev&rev=491692
Log:
Added a hashCode() method

Modified:
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/AbstractExprNode.java

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/AbstractExprNode.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/AbstractExprNode.java?view=diff&rev=491692&r1=491691&r2=491692
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/AbstractExprNode.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/AbstractExprNode.java Mon Jan  1 15:22:29 2007
@@ -166,17 +166,12 @@
      */
     public boolean equals( Object other )
     {
-        if ( null == other )
-        {
-            return false;
-        }
-
         if ( this == other )
         {
             return true;
         }
 
-        if ( !( other instanceof AbstractExprNode ) )
+        if ( ( other == null ) || ( other.getClass() != this.getClass() ) )
         {
             return false;
         }
@@ -199,5 +194,16 @@
 
         return ( ( null != annotations ) && ( null != otherAnnotations ) && 
         		annotations.equals( otherAnnotations ) );
+    }
+    
+    /**
+     * @see Object#hashCode()
+     */
+    public int hashCode()
+    {
+        int hash = 7;
+        hash = hash*31 + ( assertionType == null ? 0 : assertionType.hashCode() );
+        hash = hash*31 + ( annotations == null ? 0 : annotations.hashCode() );
+        return hash;
     }
 }