mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Matthew Swift
22.19.2014 db02e3b120abd8f5e090c3f60b4a4b92508db504
opendj3-server-dev/src/server/org/opends/server/backends/pluggable/Index.java
@@ -511,41 +511,31 @@
      Cursor cursor = txn.openCursor(treeName);
      try
      {
        ByteSequence key = ByteString.empty();
        boolean success;
        // Set the lower bound if necessary.
        if (lower.length() > 0)
        {
          // Initialize the cursor to the lower bound.
          key = lower;
          success = cursor.positionToKeyOrNext(key);
          success = cursor.positionToKeyOrNext(lower);
          // Advance past the lower bound if necessary.
          if (success
              && !lowerIncluded
              && ByteSequence.COMPARATOR.compare(key, lower) == 0)
              && ByteSequence.COMPARATOR.compare(cursor.getKey(), lower) == 0)
          {
            // Do not include the lower value.
            success = cursor.next();
            if (success)
            {
              key = cursor.getKey();
            }
          }
        }
        else
        {
          success = cursor.next();
          if (success)
          {
            key = cursor.getKey();
          }
        }
        if (!success)
        {
          // There are no values.
          return new EntryIDSet(key, null);
          return new EntryIDSet(lowerIncluded ? lower : null, null);
        }
        // Step through the keys until we hit the upper bound or the last key.
@@ -560,7 +550,7 @@
              break;
            }
          }
          EntryIDSet list = new EntryIDSet(key, cursor.getValue());
          EntryIDSet list = new EntryIDSet(cursor.getKey(), cursor.getValue());
          if (!list.isDefined())
          {
            // There is no point continuing.