directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r491692 - /directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/filter/AbstractExprNode.java
Date Mon, 01 Jan 2007 23:22:30 GMT
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;
     }
 }



Mime
View raw message