directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r954848 - in /directory/apacheds/trunk: core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ core/src/main/java/org/apache/directory/server/core/normalization/
Date Tue, 15 Jun 2010 12:14:26 GMT
Author: elecharny
Date: Tue Jun 15 12:14:25 2010
New Revision: 954848

URL: http://svn.apache.org/viewvc?rev=954848&view=rev
Log:
cleaned up the NormalizationInterceptor.moveAndRename()  method

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveAndRenameOperationContext.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/RenameOperationContext.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveAndRenameOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveAndRenameOperationContext.java?rev=954848&r1=954847&r2=954848&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveAndRenameOperationContext.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveAndRenameOperationContext.java
Tue Jun 15 12:14:25 2010
@@ -61,6 +61,7 @@ public class MoveAndRenameOperationConte
     {
         super( session, oldDn, newRdn, delOldRdn );
         this.newSuperiorDn = newSuperiorDn;
+        newDn = ((DN)newSuperiorDn.clone()).add( newRdn );
     }
 
 
@@ -84,8 +85,7 @@ public class MoveAndRenameOperationConte
             throwReferral();
         }
         
-        newDn = (DN)newSuperiorDn.clone();
-        newDn.add( getNewRdn() );
+        newDn = ((DN)newSuperiorDn.clone()).add(newRdn);
         
         try
         {

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/RenameOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/RenameOperationContext.java?rev=954848&r1=954847&r2=954848&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/RenameOperationContext.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/RenameOperationContext.java
Tue Jun 15 12:14:25 2010
@@ -40,7 +40,7 @@ import org.apache.directory.shared.ldap.
 public class RenameOperationContext extends AbstractChangeOperationContext
 {
     /** The new RDN */
-    private RDN newRdn;
+    protected RDN newRdn;
 
     /** Cached copy of the new DN */
     protected DN newDn;

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java?rev=954848&r1=954847&r2=954848&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
Tue Jun 15 12:14:25 2010
@@ -213,16 +213,22 @@ public class NormalizationInterceptor ex
     public void moveAndRename( NextInterceptor nextInterceptor, MoveAndRenameOperationContext
moveAndRenameContext )
         throws LdapException
     {
-        DN rdn = new DN();
-        rdn.add( moveAndRenameContext.getNewRdn() );
-        rdn.normalize( schemaManager.getNormalizerMapping() );
-        moveAndRenameContext.setNewRdn( rdn.getRdn() );
 
+        if ( !moveAndRenameContext.getNewRdn().isNormalized() )
+        {
+            moveAndRenameContext.getNewRdn().normalize( schemaManager.getNormalizerMapping()
);
+        }
+        
         if ( !moveAndRenameContext.getDn().isNormalized() )
         {
             moveAndRenameContext.getDn().normalize( schemaManager.getNormalizerMapping()
);
         }
         
+        if ( !moveAndRenameContext.getNewDn().isNormalized() )
+        {
+            moveAndRenameContext.getNewDn().normalize( schemaManager.getNormalizerMapping()
);
+        }
+        
         if ( !moveAndRenameContext.getNewSuperiorDn().isNormalized() )
         {
             moveAndRenameContext.getNewSuperiorDn().normalize( schemaManager.getNormalizerMapping()
);



Mime
View raw message