mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

ludovicp
27.39.2010 70c59429431f6811943521287ba2dab30a4699b3
Fix for issue #4553 - Referencial Integrity plugin fails when configure to check integrity on several attributes and only one is in the entry
1 files modified
23 ■■■■■ changed files
opends/src/server/org/opends/server/plugins/ReferentialIntegrityPlugin.java 23 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/plugins/ReferentialIntegrityPlugin.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Copyright 2008-2010 Sun Microsystems, Inc.
 */
package org.opends.server.plugins;
@@ -696,15 +696,20 @@
    {
      if(e.hasAttribute(type))
      {
        mods.add(new Modification(ModificationType.DELETE, Attributes
            .create(type, oldEntryDN.toString())));
        // If the new entry DN exists, create an ADD modification for
        // it.
        if(newEntryDN != null)
        AttributeValue value = AttributeValues
            .create(type, oldEntryDN.toString());
        if (e.hasValue(type, null, value))
        {
          mods.add(new Modification(ModificationType.ADD, Attributes
              .create(type, newEntryDN.toString())));
          mods.add(new Modification(ModificationType.DELETE, Attributes
              .create(type, value)));
          // If the new entry DN exists, create an ADD modification for
          // it.
          if(newEntryDN != null)
          {
            mods.add(new Modification(ModificationType.ADD, Attributes
                .create(type, newEntryDN.toString())));
          }
        }
      }
    }