From 39ae5d2d9bf3b741e288998371267a1c7a5d73f9 Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Tue, 01 Mar 2016 11:54:45 +0000
Subject: [PATCH] Made code more explicit with DnKeyFormat

---
 opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/EntryContainer.java |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/EntryContainer.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/EntryContainer.java
index 09d8afd..f761ee7 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/EntryContainer.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/EntryContainer.java
@@ -1084,14 +1084,14 @@
     /*
      * We will iterate forwards through a range of the dn2id keys to
      * find subordinates of the target entry from the top of the tree
-     * downwards. For example, any subordinates of "dc=example,dc=com" appear
-     * in dn2id with a key ending in ",dc=example,dc=com". The entry
-     * "cn=joe,ou=people,dc=example,dc=com" will appear after the entry
+     * downwards. For example, any subordinates of dn "dc=example,dc=com" appear
+     * in dn2id with a dn ending in ",dc=example,dc=com". The dn
+     * "cn=joe,ou=people,dc=example,dc=com" will appear after the dn
      * "ou=people,dc=example,dc=com".
      */
     ByteString baseDNKey = dnToDNKey(aBaseDN, this.baseDN.size());
-    ByteStringBuilder suffix = beforeKey(baseDNKey);
-    ByteStringBuilder end = afterKey(baseDNKey);
+    ByteStringBuilder beforeFirstChild = beforeFirstChildOf(baseDNKey);
+    ByteStringBuilder afterLastChild = afterLastChildOf(baseDNKey);
 
     // Set the starting value.
     ByteSequence begin;
@@ -1112,7 +1112,7 @@
     else
     {
       // Set the starting value to the suffix.
-      begin = suffix;
+      begin = beforeFirstChild;
     }
 
     int lookthroughCount = 0;
@@ -1124,7 +1124,7 @@
       boolean success = cursor.positionToKeyOrNext(begin);
 
       // Step forward until we pass the ending value.
-      while (success && cursor.getKey().compareTo(end) < 0)
+      while (success && cursor.getKey().compareTo(afterLastChild) < 0)
       {
         if (lookthroughLimit > 0 && lookthroughCount > lookthroughLimit)
         {

--
Gitblit v1.10.0