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

Jean-Noel Rouvignac
26.06.2013 36644aa0229073cde436212f5c42f998c412694a
opends/src/server/org/opends/server/authorization/dseecompat/AciContainer.java
@@ -33,6 +33,7 @@
import java.net.InetAddress;
import java.security.cert.Certificate;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
@@ -680,6 +681,10 @@
   /**
    * {@inheritDoc}
    * <p>
    * JNR: I find the implementation in this method dubious.
    *
    * @see EnumRight#hasRights(int, int)
    */
    @Override
    public boolean hasRights(int rights) {
@@ -853,6 +858,10 @@
  /**
   * {@inheritDoc}
   * <p>
   * JNR: I find the implementation in this method dubious.
   *
   * @see EnumRight#getEnumRight(int)
   */
    @Override
    public String rightToString() {
@@ -976,22 +985,16 @@
    if (attributeType != null)
    {
      appendSeparatorIfNeeded(sb);
      sb.append(attributeType);
      sb.append("attributeType: ").append(attributeType.getNameOrOID());
      if (attributeValue != null)
      {
        sb.append(":").append(attributeType);
        sb.append(":").append(attributeValue);
      }
    }
    if (allowList != null)
    {
      appendSeparatorIfNeeded(sb);
      sb.append(allowList.size()).append(" allow ACIs");
    }
    if (denyList != null)
    {
      appendSeparatorIfNeeded(sb);
      sb.append(denyList.size()).append(" deny ACIs");
    }
    appendSeparatorIfNeeded(sb);
    sb.append(size(allowList)).append(" allow ACIs");
    appendSeparatorIfNeeded(sb);
    sb.append(size(denyList)).append(" deny ACIs");
    if (evalReason != null)
    {
      appendSeparatorIfNeeded(sb);
@@ -1011,4 +1014,13 @@
      sb.append(", ");
    }
  }
  private int size(Collection<?> col)
  {
    if (col != null)
    {
      return col.size();
    }
    return 0;
  }
}