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

Nicolas Capponi
20.06.2014 5203374a1e5dc294088749071cf5350d2f82787d
opendj3-server-dev/src/server/org/opends/server/backends/jeb/VLVKeyComparator.java
@@ -29,11 +29,11 @@
import java.io.Serializable;
import java.util.Comparator;
import org.forgerock.opendj.ldap.ByteSequence;
import org.forgerock.opendj.ldap.ByteString;
import org.forgerock.opendj.ldap.DecodeException;
import org.forgerock.opendj.ldap.ResultCode;
import org.opends.server.api.MatchingRule;
import org.opends.server.api.OrderingMatchingRule;
import org.opends.server.types.AttributeType;
import org.opends.server.types.DirectoryException;
@@ -54,7 +54,7 @@
   */
  static final long serialVersionUID = 1585167927344130604L;
  private OrderingMatchingRule[] orderingRules;
  private MatchingRule[] orderingRules;
  private boolean[] ascending;
@@ -66,7 +66,7 @@
   * @param ascending     The array of booleans indicating the ordering for
   *                      each value.
   */
  public VLVKeyComparator(OrderingMatchingRule[] orderingRules,
  public VLVKeyComparator(MatchingRule[] orderingRules,
                          boolean[] ascending)
  {
    this.orderingRules = orderingRules;
@@ -189,15 +189,10 @@
        return -1;
      }
      int result;
      if(ascending[j])
      {
        result = orderingRules[j].compare(b1Bytes, b2Bytes);
      }
      else
      {
        result = orderingRules[j].compare(b2Bytes, b1Bytes);
      }
      final Comparator<ByteSequence> comp = orderingRules[j].comparator();
      final ByteString val1 = ByteString.valueOf(b1Bytes);
      final ByteString val2 = ByteString.valueOf(b2Bytes);
      final int result = ascending[j] ? comp.compare(val1, val2) : comp.compare(val2, val1);
      if(result != 0)
      {
@@ -322,15 +317,8 @@
        return -1;
      }
      int result;
      if(ascending[j])
      {
        result = orderingRules[j].compareValues(b1Bytes, b2Bytes);
      }
      else
      {
        result = orderingRules[j].compareValues(b2Bytes, b1Bytes);
      }
      final Comparator<ByteSequence> comp = orderingRules[j].comparator();
      final int result = ascending[j] ? comp.compare(b1Bytes, b2Bytes) : comp.compare(b2Bytes, b1Bytes);
      if(result != 0)
      {