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 2005/12/26 01:39:04 UTC

svn commit: r359027 - /directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/ObjectIdentifierComparator.java

Author: elecharny
Date: Sun Dec 25 16:39:01 2005
New Revision: 359027

URL: http://svn.apache.org/viewcvs?rev=359027&view=rev
Log:
- Added a toString() method
- little modifications in the compare() method

Modified:
    directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/ObjectIdentifierComparator.java

Modified: directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/ObjectIdentifierComparator.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/ObjectIdentifierComparator.java?rev=359027&r1=359026&r2=359027&view=diff
==============================================================================
--- directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/ObjectIdentifierComparator.java (original)
+++ directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/schema/ObjectIdentifierComparator.java Sun Dec 25 16:39:01 2005
@@ -33,17 +33,23 @@
 
     public int compare( Object o1, Object o2 )
     {
-        if ( o1 == null && o2 == null )
+        if ( o1 == null )
         {
-            return 0;
+        	if ( o2 == null )
+        	{
+        		return 0;
+        	}
+        	else
+        	{
+        		return -1;
+        	}
         }
-        else if ( o1 != null && o2 == null )
+        else
         {
-            return 1;
-        }
-        else if ( o1 == null && o2 != null )
-        {
-            return -1;
+        	if ( o2 == null )
+        	{
+        		return 1;
+        	}
         }
 
         if ( o1.equals( o2 ) )
@@ -63,5 +69,13 @@
 
         String s1 = ( ( String ) o1 ).trim().toLowerCase(), s2 = ( ( String ) o2 ).trim().toLowerCase();
         return s1.compareTo( s2 );
+    }
+
+    /**
+     * A String representation of this class
+     */
+    public String toString()
+    {
+    	return "OID comparator";
     }
 }