directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r357848 - /directory/shared/ldap/branches/DN-refactoring/common/src/main/java/org/apache/ldap/common/name/AttributeTypeAndValue.java
Date Tue, 20 Dec 2005 00:02:45 GMT
Author: elecharny
Date: Mon Dec 19 16:02:41 2005
New Revision: 357848

URL: http://svn.apache.org/viewcvs?rev=357848&view=rev
Log:
Changed the case sensitivity values and control

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=357848&r1=357847&r2=357848&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
Mon Dec 19 16:02:41 2005
@@ -49,8 +49,8 @@
     private String value;
     
     /** Two values used for comparizon */
-    private static final boolean CASE_SENSITIVE = false;
-    private static final boolean CASE_INSENSITIVE = true;
+    private static final boolean CASE_SENSITIVE = true;
+    private static final boolean CASE_INSENSITIVE = false;
     
     /**
      * Construct an empty AttributeTypeAndValue
@@ -267,7 +267,7 @@
      * @param val2 Second String
      * @return true if both strings are equals or null.
      */
-    private int compareValue( String val1, String val2, boolean caseSensitive )
+    private int compareValue( String val1, String val2, boolean sensitivity )
     {
         if ( StringUtils.isEmpty( val1 ) )
         {
@@ -279,13 +279,13 @@
         }
         else
         {
-        	if ( caseSensitive )
+        	if ( sensitivity == CASE_SENSITIVE )
         	{
-        		return ( StringUtils.trim( val1 ) ).compareToIgnoreCase( StringUtils.trim( val2
) );
+        		return ( StringUtils.trim( val1 ) ).compareTo( StringUtils.trim( val2 ) );
         	}
         	else
         	{
-        		return ( StringUtils.trim( val1 ) ).compareTo( StringUtils.trim( val2 ) );
+        		return ( StringUtils.trim( val1 ) ).compareToIgnoreCase( StringUtils.trim( val2
) );
         	}
         }
     }



Mime
View raw message