directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1200361 - /directory/shared/branches/shared-txns/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/comparators/UUIDComparator.java
Date Thu, 10 Nov 2011 15:03:51 GMT
Author: elecharny
Date: Thu Nov 10 15:03:51 2011
New Revision: 1200361

URL: http://svn.apache.org/viewvc?rev=1200361&view=rev
Log:
Made the UUID comparator accept either UUID or Strings

Modified:
    directory/shared/branches/shared-txns/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/comparators/UUIDComparator.java

Modified: directory/shared/branches/shared-txns/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/comparators/UUIDComparator.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-txns/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/comparators/UUIDComparator.java?rev=1200361&r1=1200360&r2=1200361&view=diff
==============================================================================
--- directory/shared/branches/shared-txns/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/comparators/UUIDComparator.java
(original)
+++ directory/shared/branches/shared-txns/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/comparators/UUIDComparator.java
Thu Nov 10 15:03:51 2011
@@ -19,7 +19,6 @@
  */
 package org.apache.directory.shared.ldap.model.schema.comparators;
 
-
 import org.apache.directory.shared.ldap.model.schema.LdapComparator;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -30,7 +29,7 @@ import org.slf4j.LoggerFactory;
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class UUIDComparator extends LdapComparator<String>
+public class UUIDComparator extends LdapComparator<Object>
 {
     /** The serial version UID */
     private static final long serialVersionUID = 2L;
@@ -51,7 +50,7 @@ public class UUIDComparator extends Ldap
     /**
      * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
      */
-    public int compare( String uuid1, String uuid2 )
+    public int compare( Object uuid1, Object uuid2 )
     {
         LOG.debug( "comparing UUID objects '{}' with '{}'", uuid1, uuid2 );
 
@@ -68,6 +67,9 @@ public class UUIDComparator extends Ldap
             return 1;
         }
         
-        return uuid1.compareTo( uuid2 );
+        String uuidStr1 = uuid1.toString();
+        String uuidStr2 = uuid2.toString();
+
+        return uuidStr1.compareTo( uuidStr2 );
     }
 }



Mime
View raw message