From 251f9586274ce5f121b0bb596fbb21e1ecd39442 Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Fri, 09 Sep 2016 12:52:10 +0000
Subject: [PATCH] OPENDJ-3281 Modify operations may not be replayed if case is mixed on attribute values

---
 opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/AttrHistoricalSingle.java |   27 ++++++++++++++++++++-------
 1 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/AttrHistoricalSingle.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/AttrHistoricalSingle.java
index 6fd69bc..9543edb 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/AttrHistoricalSingle.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/AttrHistoricalSingle.java
@@ -24,9 +24,9 @@
 
 import org.forgerock.opendj.ldap.ByteString;
 import org.forgerock.opendj.ldap.ModificationType;
+import org.forgerock.opendj.ldap.schema.AttributeType;
 import org.opends.server.replication.common.CSN;
 import org.opends.server.types.Attribute;
-import org.forgerock.opendj.ldap.schema.AttributeType;
 import org.opends.server.types.Entry;
 import org.opends.server.types.Modification;
 
@@ -38,18 +38,31 @@
  */
 public class AttrHistoricalSingle extends AttrHistorical
 {
-  /** Last time when the attribute was deleted. */
-  private CSN deleteTime;
-  /** Last time when a value was added. */
-  private CSN addTime;
   /** Last added value. */
   private ByteString value;
+  /** Attribute type for this historical value */
+  private AttributeType attributeType;
+  /** Last time when a value was added. */
+  private CSN addTime;
+  /** Last time when the attribute was deleted. */
+  private CSN deleteTime;
   /**
    * Last operation applied. This is only used for multiple mods on the same
    * single valued attribute in the same modification.
    */
   private HistAttrModificationKey lastMod;
 
+  /**
+   * Builds an {@link AttrHistoricalSingle} object.
+   *
+   * @param attributeType
+   *          the attribute type for this historical value
+   */
+  public AttrHistoricalSingle(AttributeType attributeType)
+  {
+    this.attributeType = attributeType;
+  }
+
   @Override
   public CSN getDeleteTime()
   {
@@ -61,7 +74,7 @@
   {
     if (addTime != null)
     {
-      return Collections.singleton(new AttrValueHistorical(value, addTime, null));
+      return Collections.singleton(new AttrValueHistorical(value, attributeType, addTime, null));
     }
     return Collections.emptySet();
   }
@@ -262,7 +275,7 @@
   }
 
   @Override
-  public void assign(HistAttrModificationKey histKey, ByteString value, CSN csn)
+  public void assign(HistAttrModificationKey histKey, AttributeType attrType, ByteString value, CSN csn)
   {
     switch (histKey)
     {

--
Gitblit v1.10.0