directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r494880 - /directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeService.java
Date Wed, 10 Jan 2007 16:31:43 GMT
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 );
 



Mime
View raw message