directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1066901 - /directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/SyncInfoValueImpl.java
Date Thu, 03 Feb 2011 18:06:01 GMT
Author: elecharny
Date: Thu Feb  3 18:06:00 2011
New Revision: 1066901

URL: http://svn.apache.org/viewvc?rev=1066901&view=rev
Log:
Fixed the equals() method which was not complete

Modified:
    directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/SyncInfoValueImpl.java

Modified: directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/SyncInfoValueImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/SyncInfoValueImpl.java?rev=1066901&r1=1066900&r2=1066901&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/SyncInfoValueImpl.java
(original)
+++ directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/SyncInfoValueImpl.java
Thu Feb  3 18:06:00 2011
@@ -235,16 +235,32 @@ public class SyncInfoValueImpl extends A
 
         SyncInfoValueDecorator otherControl = ( SyncInfoValueDecorator ) o;
 
-        if ( getSyncUUIDs() != null )
+        if ( syncUUIDs != null )
         {
             if ( otherControl.getSyncUUIDs() == null )
             {
                 return false;
             }
 
-            // @TODO : check the UUIDs
-            for ( @SuppressWarnings("unused") byte[] syncUuid : getSyncUUIDs() )
+            // @TODO : this is extremely heavy... We have to find a better way to
+            // compare the lists of suncUuids, but atm, it's enough.
+            for ( byte[] syncUuid : syncUUIDs )
             {
+                boolean found = false;
+
+                for ( byte[] otherSyncUuid : otherControl.getSyncUUIDs() )
+                {
+                    if ( Arrays.equals( syncUuid, otherSyncUuid ) )
+                    {
+                        found = true;
+                        break;
+                    }
+                }
+
+                if ( found == false )
+                {
+                    return false;
+                }
             }
         }
         else



Mime
View raw message