directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1079452 - /directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifControl.java
Date Tue, 08 Mar 2011 17:55:10 GMT
Author: pamarcelot
Date: Tue Mar  8 17:55:10 2011
New Revision: 1079452

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

Modified:
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifControl.java

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifControl.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifControl.java?rev=1079452&r1=1079451&r2=1079452&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifControl.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifControl.java
Tue Mar  8 17:55:10 2011
@@ -117,6 +117,27 @@ public class LdifControl implements Cont
 
 
     /**
+     * @see Object#hashCode()
+     */
+    public int hashCode()
+    {
+        int h = 17;
+        h = h * 37 + ( criticality ? 1 : 0 );
+        h = h * 37 + ( oid == null ? 0 : oid.hashCode() );
+
+        if ( value != null )
+        {
+            for ( byte v : value )
+            {
+                h = h * 37 + v;
+            }
+        }
+
+        return h;
+    }
+
+
+    /**
      * @see Object#equals(Object)
      */
     public boolean equals( Object o )
@@ -131,7 +152,7 @@ public class LdifControl implements Cont
             return false;
         }
 
-        if ( !( o instanceof Control) )
+        if ( !( o instanceof Control ) )
         {
             return false;
         }



Mime
View raw message