From 24558f69b45a25f40844490d17dfb42e13e0f417 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Thu, 11 Dec 2014 11:13:41 +0000
Subject: [PATCH] Since OpenDJ 3 forces a rebuild of all indexes, we do not need to maintain backward compatibility for ds-sync-hist index. This means the fix for OPENDJ-992 is no longer needed.

---
 opendj3-server-dev/src/server/org/opends/server/replication/plugin/HistoricalCsnOrderingMatchingRuleImpl.java |   35 +----------------------------------
 1 files changed, 1 insertions(+), 34 deletions(-)

diff --git a/opendj3-server-dev/src/server/org/opends/server/replication/plugin/HistoricalCsnOrderingMatchingRuleImpl.java b/opendj3-server-dev/src/server/org/opends/server/replication/plugin/HistoricalCsnOrderingMatchingRuleImpl.java
index e20782a..837a4d0 100644
--- a/opendj3-server-dev/src/server/org/opends/server/replication/plugin/HistoricalCsnOrderingMatchingRuleImpl.java
+++ b/opendj3-server-dev/src/server/org/opends/server/replication/plugin/HistoricalCsnOrderingMatchingRuleImpl.java
@@ -82,40 +82,7 @@
    */
   private int compareValues(ByteSequence value1, ByteSequence value2)
   {
-    /*
-     * See OPENDJ-992: do not use StaticUtils.compare() because it performs
-     * unsigned comparisons whereas the 2.4 implementation (below) performs
-     * signed comparisons. Changes to indexing comparators require that the
-     * index be rebuilt, otherwise the DB can fail unexpectedly.
-     */
-    int minLength = Math.min(value1.length(), value2.length());
-
-    for (int i = 0; i < minLength; i++)
-    {
-      final byte b1 = value1.byteAt(i);
-      final byte b2 = value2.byteAt(i);
-      if (b1 < b2)
-      {
-        return -1;
-      }
-      else if (b1 > b2)
-      {
-        return 1;
-      }
-    }
-
-    if (value1.length() == value2.length())
-    {
-      return 0;
-    }
-    else if (value1.length() < value2.length())
-    {
-      return -1;
-    }
-    else
-    {
-      return 1;
-    }
+    return value1.compareTo(value2);
   }
 
   /** {@inheritDoc} */

--
Gitblit v1.10.0