From 5f4f429bcbd2638da1b0548705371416a9fc0a94 Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Wed, 25 Nov 2015 15:09:54 +0000
Subject: [PATCH] Fix VLV index / server side control tests

---
 opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VLVIndex.java |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VLVIndex.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VLVIndex.java
index a1ff2a7..cc2a40e 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VLVIndex.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VLVIndex.java
@@ -178,6 +178,7 @@
   public synchronized boolean isConfigurationChangeAcceptable(final BackendVLVIndexCfg cfg,
       final List<LocalizableMessage> unacceptableReasons)
   {
+    // TODO JNR remove duplication
     try
     {
       SearchFilter.createFilterFromString(cfg.getFilter());
@@ -324,6 +325,7 @@
       {
         throw new ConfigException(ERR_CONFIG_VLV_INDEX_UNDEFINED_ATTR.get(sortAttrs[i], getName()));
       }
+      // TODO Add ordering matching rule null check
       sortKeys[i] = new SortKey(attrType, ascending);
     }
     return sortKeys;
@@ -606,7 +608,7 @@
        * include some escaped bytes as well. 10 extra bytes should accommodate most inputs.
        */
       final ByteStringBuilder encodedPrimaryKey = new ByteStringBuilder(assertion.length() + 10);
-      final MatchingRule matchingRule = primarySortKey.getAttributeType().getOrderingMatchingRule();
+      final MatchingRule matchingRule = primarySortKey.getEffectiveOrderingRule();
       final ByteString normalizedAttributeValue = matchingRule.normalizeAttributeValue(assertion);
       encodeVLVKeyValue(normalizedAttributeValue, encodedPrimaryKey, primarySortKey.ascending());
       return encodedPrimaryKey;
@@ -767,7 +769,7 @@
     for (final SortKey sortKey : sortOrder.getSortKeys())
     {
       final AttributeType attributeType = sortKey.getAttributeType();
-      final MatchingRule matchingRule = attributeType.getOrderingMatchingRule();
+      final MatchingRule matchingRule = sortKey.getEffectiveOrderingRule();
       final List<Attribute> attrList = entry.getAttribute(attributeType);
       ByteString sortValue = null;
       if (attrList != null)

--
Gitblit v1.10.0