directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r329149 - /directory/shared/ldap/branches/shared-ldap-utf8/common/src/java/org/apache/ldap/common/schema/DeepTrimToLowerNormalizer.java
Date Fri, 28 Oct 2005 07:32:08 GMT
Author: elecharny
Date: Fri Oct 28 00:32:04 2005
New Revision: 329149

URL: http://svn.apache.org/viewcvs?rev=329149&view=rev
Log:
Changed the Normalizer to enable normalization of byte[] values

Modified:
    directory/shared/ldap/branches/shared-ldap-utf8/common/src/java/org/apache/ldap/common/schema/DeepTrimToLowerNormalizer.java

Modified: directory/shared/ldap/branches/shared-ldap-utf8/common/src/java/org/apache/ldap/common/schema/DeepTrimToLowerNormalizer.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/shared-ldap-utf8/common/src/java/org/apache/ldap/common/schema/DeepTrimToLowerNormalizer.java?rev=329149&r1=329148&r2=329149&view=diff
==============================================================================
--- directory/shared/ldap/branches/shared-ldap-utf8/common/src/java/org/apache/ldap/common/schema/DeepTrimToLowerNormalizer.java
(original)
+++ directory/shared/ldap/branches/shared-ldap-utf8/common/src/java/org/apache/ldap/common/schema/DeepTrimToLowerNormalizer.java
Fri Oct 28 00:32:04 2005
@@ -19,6 +19,7 @@
 
 import javax.naming.NamingException;
 
+import org.apache.asn1new.util.StringUtils;
 import org.apache.ldap.common.util.StringTools;
 
 
@@ -35,6 +36,13 @@
 {
     public Object normalize( Object value ) throws NamingException
     {
-        return StringTools.deepTrimToLower( value.toString() );
+        if ( value instanceof byte[] )
+        {
+            return StringTools.deepTrimToLower( StringUtils.toUtf8( (byte[])value ) );
+        }
+        else
+        {
+            return StringTools.deepTrimToLower( value.toString() );
+        }
     }
 }



Mime
View raw message