directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r527983 - /directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/ModifyDnHandler.java
Date Thu, 12 Apr 2007 15:38:44 GMT
Author: elecharny
Date: Thu Apr 12 08:38:43 2007
New Revision: 527983

URL: http://svn.apache.org/viewvc?view=rev&rev=527983
Log:
Simplified the ModifyDN handler by removing a duplicated case

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

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/ModifyDnHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/ModifyDnHandler.java?view=diff&rev=527983&r1=527982&r2=527983
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/ModifyDnHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/ModifyDnHandler.java
Thu Apr 12 08:38:43 2007
@@ -111,28 +111,14 @@
                 String deleteRDN = String.valueOf( req.getDeleteOldRdn() );
                 ctx.addToEnvironment( JndiPropertyConstants.JNDI_LDAP_DELETE_RDN, deleteRDN
);
 
-                if ( req.isMove() )
+                LdapDN newSuperior = req.getNewSuperior();
+
+                if ( ( newSuperior != null ) && ( !newSuperior.isEmpty() ) )
                 {
                     LdapDN oldDn = req.getName();
                     LdapDN newDn = null;
 
-                    LdapDN newSuperior = req.getNewSuperior();
-                    
-                    if ( newSuperior.isEmpty() )
-                    {
-                        if ( oldDn.isEmpty() )
-                        {
-                            newDn = oldDn;
-                        }
-                        else
-                        {
-                            newDn = (LdapDN)oldDn.getPrefix( oldDn.size() - 1 );
-                        }
-                    }
-                    else
-                    {
-                        newDn = newSuperior;
-                    }
+                    newDn = newSuperior;
 
                     if ( req.getNewRdn() != null )
                     {



Mime
View raw message