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 2010/03/18 14:46:50 UTC

svn commit: r924774 - /directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java

Author: elecharny
Date: Thu Mar 18 13:46:50 2010
New Revision: 924774

URL: http://svn.apache.org/viewvc?rev=924774&view=rev
Log:
Fixed some incorrect cast of Name to DN 

Modified:
    directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java

Modified: directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java?rev=924774&r1=924773&r2=924774&view=diff
==============================================================================
--- directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java (original)
+++ directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java Thu Mar 18 13:46:50 2010
@@ -191,10 +191,10 @@ public abstract class ServerContext impl
      * @param service the directory service core
      * @throws NamingException if there is a problem creating the new context
      */
-    public ServerContext( DirectoryService service, LdapPrincipal principal, Name dn ) throws Exception
+    public ServerContext( DirectoryService service, LdapPrincipal principal, Name name ) throws Exception
     {
         this.service = service;
-        this.dn = ( DN ) dn.clone();
+        this.dn = (DN)(DN.fromName( name ).clone());
 
         this.env = new Hashtable<String, Object>();
         this.env.put( PROVIDER_URL, dn.toString() );
@@ -202,17 +202,17 @@ public abstract class ServerContext impl
         session = new DefaultCoreSession( principal, service );
         OperationManager operationManager = service.getOperationManager();
         
-        if ( ! operationManager.hasEntry( new EntryOperationContext( session, ( DN ) dn ) ) )
+        if ( ! operationManager.hasEntry( new EntryOperationContext( session, dn ) ) )
         {
             throw new NameNotFoundException( I18n.err( I18n.ERR_490, dn ) );
         }
     }
 
 
-    public ServerContext( DirectoryService service, CoreSession session, Name dn ) throws Exception
+    public ServerContext( DirectoryService service, CoreSession session, Name name ) throws Exception
     {
         this.service = service;
-        this.dn = ( DN ) dn.clone();
+        this.dn = (DN)(DN.fromName( name ).clone());
         this.env = new Hashtable<String, Object>();
         this.env.put( PROVIDER_URL, dn.toString() );
         this.env.put( DirectoryService.JNDI_KEY, service );