directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r418523 - /directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java
Date Sat, 01 Jul 2006 23:39:17 GMT
Author: elecharny
Date: Sat Jul  1 16:39:17 2006
New Revision: 418523

URL: http://svn.apache.org/viewvc?rev=418523&view=rev
Log:
Avoid the creation of a new LdapDN object

Modified:
    directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java

Modified: directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java?rev=418523&r1=418522&r2=418523&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java
(original)
+++ directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java
Sat Jul  1 16:39:17 2006
@@ -356,7 +356,13 @@
     private void protectLookUp( Name normalizedDn ) throws NamingException
     {
         LdapContext ctx = ( LdapContext ) InvocationStack.getInstance().peek().getCaller();
-        LdapDN principalDn = new LdapDN( ( ( ServerContext ) ctx ).getPrincipal().getJndiName()
);
+        
+        Name name = ( ( ServerContext ) ctx ).getPrincipal().getJndiName();
+        
+        // We want to avoid a creation of an object if it's not necessary
+        LdapDN principalDn = ( name instanceof LdapDN ? (LdapDN)name : new LdapDN( name ));
+        
+        // TODO : Why do we have to normalize this LdapDN ???
         principalDn.normalize( oidsMap );
 
         if ( !principalDn.equals( ADMIN_DN ) )



Mime
View raw message