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

Jean-Noël Rouvignac
05.10.2016 3610cc2b7bc4fa3228f18e361823035064d5aa0b
Align Attribute with SDK APIs: containsAll(Collection<ByteString>) => containsAll(Collection<?>)
5 files modified
34 ■■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/server/api/VirtualAttributeProvider.java 5 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/AbstractAttribute.java 13 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/Attribute.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/AttributeBuilder.java 12 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/VirtualAttribute.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/api/VirtualAttributeProvider.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2012-2014 ForgeRock AS
 *      Portions Copyright 2012-2016 ForgeRock AS
 */
package org.opends.server.api;
@@ -227,8 +227,7 @@
   *          {@code false} if it will not generate at least one of
   *          them.
   */
  public boolean hasAllValues(Entry entry, VirtualAttributeRule rule,
                              Collection<ByteString> values)
  public boolean hasAllValues(Entry entry, VirtualAttributeRule rule, Collection<?> values)
  {
    return getValues(entry, rule).containsAll(values);
  }
opendj-server-legacy/src/main/java/org/opends/server/types/AbstractAttribute.java
@@ -47,19 +47,12 @@
    // No implementation required.
  }
  /**
   * {@inheritDoc}
   * <p>
   * This implementation iterates through each attribute value in the
   * provided collection, checking to see if this attribute contains
   * the value using {@link #contains(ByteString)}.
   */
  @Override
  public boolean containsAll(Collection<ByteString> values)
  public boolean containsAll(Collection<?> values)
  {
    for (ByteString value : values)
    for (Object value : values)
    {
      if (!contains(value))
      if (!contains(ByteString.valueOfObject(value)))
      {
        return false;
      }
opendj-server-legacy/src/main/java/org/opends/server/types/Attribute.java
@@ -88,7 +88,7 @@
   *         values in the provided collection, or {@code false}
   *         if it does not contain at least one of them.
   */
  boolean containsAll(Collection<ByteString> values);
  boolean containsAll(Collection<?> values);
  /**
   * Indicates whether this attribute matches the specified assertion value.
opendj-server-legacy/src/main/java/org/opends/server/types/AttributeBuilder.java
@@ -112,9 +112,7 @@
  private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
  /**
   * A real attribute - options handled by sub-classes.
   */
  /** A real attribute */
  private static class RealAttribute extends AbstractAttribute
  {
    private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
@@ -1060,8 +1058,6 @@
    return values.contains(createAttributeValue(attributeType, value));
  }
  /**
   * Indicates whether this attribute builder contains all the values
   * in the collection.
@@ -1073,11 +1069,11 @@
   *         <CODE>false</CODE> if it does not contain at least one
   *         of them.
   */
  public boolean containsAll(Collection<ByteString> values)
  public boolean containsAll(Collection<?> values)
  {
    for (ByteString v : values)
    for (Object v : values)
    {
      if (!contains(v))
      if (!contains(ByteString.valueOfObject(v)))
      {
        return false;
      }
opendj-server-legacy/src/main/java/org/opends/server/types/VirtualAttribute.java
@@ -94,7 +94,7 @@
  }
  @Override
  public boolean containsAll(Collection<ByteString> values)
  public boolean containsAll(Collection<?> values)
  {
    return provider.hasAllValues(entry, rule, values);
  }