From ffb9044301d1c169f934e0adf4f473e99da39a47 Mon Sep 17 00:00:00 2001
From: boli <boli@localhost>
Date: Mon, 27 Aug 2007 18:58:10 +0000
Subject: [PATCH] This adds the numSubordinates and hasSubordinates operational attribute support in OpenDS.    - Implemented as virtual attributes    - They are enabled by default    - numSubordinates and hasSubordinates methods added to the backend API and implemented for all existing backends    - JE implementation uses the id2children index to keep count of the number of subordinates for each entry.    - The behavior of exceeding the index-entry-limit (ALL-IDs) has changed to store a 8 byte entry ID set count with the most significant bit  set to 1 instead of a 0 byte array to signify the index-entry-limit has been exceeded. The previous format is still compatible but all requests  for numSubordinates will return undefined (-1).    - The DBTest tool is also included in this fix. This can be used to list root containers, entry containers, database containers, index  status, as well as dumping a database with or without decoding the data. 

---
 opends/src/server/org/opends/server/backends/jeb/BufferedIndex.java |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/opends/src/server/org/opends/server/backends/jeb/BufferedIndex.java b/opends/src/server/org/opends/server/backends/jeb/BufferedIndex.java
index 713e161..3888e04 100644
--- a/opends/src/server/org/opends/server/backends/jeb/BufferedIndex.java
+++ b/opends/src/server/org/opends/server/backends/jeb/BufferedIndex.java
@@ -142,14 +142,15 @@
     {
       if (entryLimit > 0 && entryIDList.size() >= entryLimit)
       {
-        bufferedValue.value = new EntryIDSet();
+        entryIDList = new EntryIDSet(entryIDList.size());
+        entryIDList.add(entryID);
+        bufferedValue.value = entryIDList;
         bufferedValue.isDirty = true;
+        return;
       }
-      else
-      {
-        bufferedValue.isDirty = entryIDList.add(entryID);
-      }
+
     }
+    bufferedValue.isDirty = entryIDList.add(entryID);
   }
 
   /**

--
Gitblit v1.10.0