You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2008/08/05 07:33:56 UTC
svn commit: r682584 -
/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifUtils.java
Author: akarasulu
Date: Mon Aug 4 22:33:55 2008
New Revision: 682584
URL: http://svn.apache.org/viewvc?rev=682584&view=rev
Log:
found bug where a modify replace on attribute that is not present causes both null modify attribute value and null previous value and this is not properly considered: such an operation is bogus and has no effect so for it we preduce the same modify that is in forward as is in the reverse direction
Modified:
directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifUtils.java
Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifUtils.java?rev=682584&r1=682583&r2=682584&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifUtils.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifUtils.java Mon Aug 4 22:33:55 2008
@@ -793,6 +793,23 @@
previous = modifiedEntry.get( mod.getID() );
+ /*
+ * The server accepts without complaint replace
+ * modifications to non-existing attributes in the
+ * entry. When this occurs nothing really happens
+ * but this method freaks out. To prevent that we
+ * make such no-op modifications produce the same
+ * modification for the reverse direction which should
+ * do nothing as well.
+ */
+ if ( mod.get() == null && previous == null )
+ {
+ reverseModification = new ModificationItemImpl( DirContext.REPLACE_ATTRIBUTE,
+ new AttributeImpl( mod.getID() ) );
+ reverseModifications.add( 0, reverseModification );
+ continue;
+ }
+
if ( mod.get() == null )
{
reverseModification = new ModificationItemImpl( DirContext.REPLACE_ATTRIBUTE, previous );