directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r411918 - /directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDN.java
Date Mon, 05 Jun 2006 21:12:33 GMT
Author: elecharny
Date: Mon Jun  5 14:12:33 2006
New Revision: 411918

URL: http://svn.apache.org/viewvc?rev=411918&view=rev
Log:
Fixing a ClassCast exception

Modified:
    directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDN.java

Modified: directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDN.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDN.java?rev=411918&r1=411917&r2=411918&view=diff
==============================================================================
--- directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDN.java
(original)
+++ directory/branches/shared/optimization/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDN.java
Mon Jun  5 14:12:33 2006
@@ -31,6 +31,7 @@
 import javax.naming.NamingException;
 
 import org.apache.directory.shared.ldap.name.Rdn;
+import org.apache.directory.shared.ldap.schema.Normalizer;
 import org.apache.directory.shared.ldap.schema.OidNormalizer;
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.slf4j.Logger;
@@ -1292,14 +1293,17 @@
 
             if ( StringTools.isNotEmpty( StringTools.lowerCase( type ) ) )
             {
-                OidNormalizer oidNormalizer = ( OidNormalizer ) oids.get( type );
+                Normalizer normalizer = ( Normalizer ) oids.get( type );
 
-                if ( oidNormalizer != null )
+                if ( normalizer != null )
                 {
                     Rdn rdnCopy = ( Rdn ) rdn.clone();
                     rdn.clear();
+                    
+                    // Should get the OID, not the type
+                    String oid = type;
 
-                    rdn.addAttributeTypeAndValue( oidNormalizer.getName(), ( String ) oidNormalizer.getNormalizer()
+                    rdn.addAttributeTypeAndValue( oid, (String)normalizer
                         .normalize( rdnCopy.getValue() ) );
 
                 }



Mime
View raw message