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/25 23:12:14 UTC

svn commit: r359010 - /directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/name/AttributeTypeAndValue.java

Author: elecharny
Date: Sun Dec 25 14:12:09 2005
New Revision: 359010

URL: http://svn.apache.org/viewcvs?rev=359010&view=rev
Log:
Fixed the value returned by CompareValue.

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

Modified: directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/name/AttributeTypeAndValue.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/name/AttributeTypeAndValue.java?rev=359010&r1=359009&r2=359010&view=diff
==============================================================================
--- directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/name/AttributeTypeAndValue.java (original)
+++ directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/name/AttributeTypeAndValue.java Sun Dec 25 14:12:09 2005
@@ -283,14 +283,18 @@
         }
         else
         {
+        	int res = 0;
+        	
         	if ( sensitivity == CASE_SENSITIVE )
         	{
-        		return ( StringUtils.trim( val1 ) ).compareTo( StringUtils.trim( val2 ) );
+        		res = ( StringUtils.trim( val1 ) ).compareTo( StringUtils.trim( val2 ) );
         	}
         	else
         	{
-        		return ( StringUtils.trim( val1 ) ).compareToIgnoreCase( StringUtils.trim( val2 ) );
+        		res = ( StringUtils.trim( val1 ) ).compareToIgnoreCase( StringUtils.trim( val2 ) );
         	}
+        	
+    		return (res < 0 ? -1 : res > 0 ? 1 : 0 );
         }
     }