directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r359010 - /directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/name/AttributeTypeAndValue.java
Date Sun, 25 Dec 2005 22:12:14 GMT
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 );
         }
     }
 



Mime
View raw message