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

Jean-Noel Rouvignac
16.30.2014 bc629c7e8792a65de31b4b2ee960fad93e53e2b1
SortOrder.java:
Used varargs for second constructor.
1 files modified
16 ■■■■■ changed files
opendj-sdk/opendj3-server-dev/src/server/org/opends/server/types/SortOrder.java 16 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj3-server-dev/src/server/org/opends/server/types/SortOrder.java
@@ -22,10 +22,10 @@
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Portions Copyright 2014 ForgeRock AS
 */
package org.opends.server.types;
/**
 * This class defines a data structure that defines a set of sort
 * criteria that may be used to order entries in a set of search
@@ -49,11 +49,9 @@
     mayInvoke=true)
public final class SortOrder
{
  // The set of sort keys in this sort order.
  /** The set of sort keys in this sort order. */
  private SortKey[] sortKeys;
  /**
   * Creates a new sort order with a single key.
   *
@@ -72,7 +70,7 @@
   * @param  sortKeys  The set of sort keys to use for this sort
   *                   order.
   */
  public SortOrder(SortKey[] sortKeys)
  public SortOrder(SortKey... sortKeys)
  {
    this.sortKeys = new SortKey[sortKeys.length];
    System.arraycopy(sortKeys, 0, this.sortKeys, 0, sortKeys.length);
@@ -97,6 +95,7 @@
   *
   * @return  A string representation of this sort order.
   */
  @Override
  public String toString()
  {
    StringBuilder buffer = new StringBuilder();
@@ -136,6 +135,7 @@
   *
   * @return  The hash code for this sort order.
   */
  @Override
  public int hashCode()
  {
    int hashCode = 0;
@@ -143,7 +143,6 @@
    {
      hashCode += sortKey.hashCode();
    }
    return hashCode;
  }
@@ -156,25 +155,23 @@
   * @return  <CODE>true</CODE> if the provide object is equal to this
   *          sort order, or <CODE>false</CODE> if it is not.
   */
  @Override
  public boolean equals(Object o)
  {
    if(o == null)
    {
      return false;
    }
    if (o == this)
    {
      return true;
    }
    if (! (o instanceof SortOrder))
    {
      return false;
    }
    SortOrder s = (SortOrder) o;
    if(sortKeys.length != s.sortKeys.length)
    {
      return false;
@@ -187,7 +184,6 @@
        return false;
      }
    }
    return true;
  }
}