directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1527162 - /directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
Date Sat, 28 Sep 2013 07:33:53 GMT
Author: kayyagari
Date: Sat Sep 28 07:33:53 2013
New Revision: 1527162

URL: http://svn.apache.org/r1527162
Log:
do not remove the attribute instead add or just replace the value of the existing entryDN
attribute (see DIRSERVER-1902)

Modified:
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java?rev=1527162&r1=1527161&r2=1527162&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
Sat Sep 28 07:33:53 2013
@@ -1141,12 +1141,19 @@ public abstract class AbstractBTreeParti
             if ( entry != null )
             {
                 // Replace the entry's DN with the provided one
-                if ( entry.containsAttribute( ENTRY_DN_AT ) )
+                Attribute entryDnAt = entry.get( ENTRY_DN_AT );
+                
+                // see DIRSERVER-1902
+                if ( entryDnAt == null )
                 {
-                    entry.removeAttributes( ENTRY_DN_AT );
+                    entry.add( ENTRY_DN_AT, dn.getName() );
                 }
-
-                entry.add( ENTRY_DN_AT, dn.getName() );
+                else
+                {
+                    entryDnAt.clear();
+                    entryDnAt.add( dn.getName() );
+                }
+                
                 entry.setDn( dn );
 
                 return new ClonedServerEntry( entry );



Mime
View raw message