You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by pa...@apache.org on 2007/05/23 15:59:03 UTC

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

Author: pamarcelot
Date: Wed May 23 06:58:59 2007
New Revision: 540956

URL: http://svn.apache.org/viewvc?view=rev&rev=540956
Log:
Fixed DIRSERVER-941 (ClassCastException raised when unbinding from LDAP Studio).

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

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java?view=diff&rev=540956&r1=540955&r2=540956
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java Wed May 23 06:58:59 2007
@@ -184,9 +184,18 @@
      */
     public void ldapUnbind() throws NamingException
     {
-        String bindDn = ( String ) getEnvironment().get( Context.SECURITY_PRINCIPAL );
+        Object dn = getEnvironment().get( Context.SECURITY_PRINCIPAL );;
         
-        super.getNexusProxy().unbind( new UnbindOperationContext( new LdapDN( bindDn ) ) );
+        if ( dn instanceof LdapDN )
+        {
+            super.getNexusProxy().unbind( new UnbindOperationContext( ( LdapDN ) dn ) );
+        }
+        else
+        {
+            String bindDn = ( String ) dn;
+            
+            super.getNexusProxy().unbind( new UnbindOperationContext( new LdapDN( bindDn ) ) );
+        }
     }