directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r365506 - /directory/trunk/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/support/ModifyDnHandler.java
Date Tue, 03 Jan 2006 01:05:18 GMT
Author: elecharny
Date: Mon Jan  2 17:04:50 2006
New Revision: 365506

URL: http://svn.apache.org/viewcvs?rev=365506&view=rev
Log:
Fixed the case where newSuperior is null. We have to get the prefix

Modified:
    directory/trunk/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/support/ModifyDnHandler.java

Modified: directory/trunk/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/support/ModifyDnHandler.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/support/ModifyDnHandler.java?rev=365506&r1=365505&r2=365506&view=diff
==============================================================================
--- directory/trunk/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/support/ModifyDnHandler.java
(original)
+++ directory/trunk/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/support/ModifyDnHandler.java
Mon Jan  2 17:04:50 2006
@@ -28,6 +28,7 @@
 import org.apache.ldap.common.message.ResultCodeEnum;
 import org.apache.ldap.common.name.LdapName;
 import org.apache.ldap.common.util.ExceptionUtils;
+import org.apache.ldap.common.util.StringTools;
 import org.apache.ldap.server.protocol.SessionRegistry;
 import org.apache.mina.common.IoSession;
 import org.apache.mina.handler.demux.MessageHandler;
@@ -74,7 +75,19 @@
                 if (req.isMove())
                 {
                     LdapName oldDn = new LdapName( req.getName() );
-                    LdapName newDn = new LdapName( req.getNewSuperior() );
+                    LdapName newDn = null;
+                    
+                    String newSuperior = req.getNewSuperior();
+                    
+                    if ( StringTools.isEmpty( newSuperior ) )
+                    {
+                    	newDn = (LdapName)oldDn.getPrefix( 1 );
+                    }
+                    else
+                    {
+                    	newDn = new LdapName( req.getNewSuperior() );
+                    }
+                    
 
                     if (req.getNewRdn() != null)
                     {



Mime
View raw message