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 2007/01/10 17:31:43 UTC

svn commit: r494880 - /directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeService.java

Author: elecharny
Date: Wed Jan 10 08:31:43 2007
New Revision: 494880

URL: http://svn.apache.org/viewvc?view=rev&rev=494880
Log:
Used the dn.isNormalized to avoid a costly normalization

Modified:
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeService.java

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeService.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeService.java?view=diff&rev=494880&r1=494879&r2=494880
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeService.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeService.java Wed Jan 10 08:31:43 2007
@@ -25,7 +25,6 @@
 import java.util.Map;
 import java.util.Set;
 
-import javax.naming.Name;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
@@ -102,9 +101,15 @@
      * @param retAttrs array or attribute type to be specifically included in the result entry(s)
      * @throws NamingException if there are problems accessing subentries
      */
-    private void addCollectiveAttributes( Name name, Attributes entry, String[] retAttrs ) throws NamingException
+    private void addCollectiveAttributes( LdapDN name, Attributes entry, String[] retAttrs ) throws NamingException
     {
-        LdapDN normName = LdapDN.normalize( ( LdapDN ) name, registry.getNormalizerMapping() );
+        LdapDN normName = name;
+        
+        if ( !name.isNormalized() )
+        {
+            normName = LdapDN.normalize( name, registry.getNormalizerMapping() );
+        }
+
         Attributes entryWithCAS = nexus.lookup( normName, new String[] { COLLECTIVE_ATTRIBUTE_SUBENTRIES } );
         Attribute caSubentries = entryWithCAS.get( COLLECTIVE_ATTRIBUTE_SUBENTRIES );