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

Jean-Noel Rouvignac
16.57.2015 a41662c1136b2bb4a4198df89e0e87d2be3ef099
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/ExtendedResponseProtocolOp.java
@@ -25,23 +25,21 @@
 *      Portions Copyright 2014-2015 ForgeRock AS
 */
package org.opends.server.protocols.ldap;
import org.forgerock.i18n.LocalizableMessage;
import java.util.Iterator;
import java.util.List;
import java.io.IOException;
import org.forgerock.opendj.io.*;
import org.opends.server.types.DN;
import org.forgerock.opendj.ldap.ByteString;
import org.forgerock.util.Utils;
import org.forgerock.i18n.slf4j.LocalizedLogger;
import static org.opends.server.protocols.ldap.LDAPConstants.*;
import static org.opends.server.util.ServerConstants.*;
/**
 * This class defines the structures and methods for an LDAP extended response
 * protocol op, which is used to provide information about the result of
@@ -283,7 +281,7 @@
      stream.writeOctetString(errorMessage.toString());
    }
    if ((referralURLs != null) && (! referralURLs.isEmpty()))
    if (referralURLs != null && !referralURLs.isEmpty())
    {
      stream.writeStartSequence(TYPE_REFERRAL_SEQUENCE);
      for (String s : referralURLs)
@@ -293,7 +291,7 @@
      stream.writeEndSequence();
    }
    if ((oid != null) && (oid.length() > 0))
    if (oid != null && oid.length() > 0)
    {
      stream.writeOctetString(TYPE_EXTENDED_RESPONSE_OID, oid);
    }
@@ -319,40 +317,27 @@
    buffer.append("ExtendedResponse(resultCode=");
    buffer.append(resultCode);
    if ((errorMessage != null) && (errorMessage.length() > 0))
    if (errorMessage != null && errorMessage.length() > 0)
    {
      buffer.append(", errorMessage=");
      buffer.append(errorMessage);
    }
    if (matchedDN != null)
    {
      buffer.append(", matchedDN=");
      buffer.append(matchedDN);
    }
    if ((referralURLs != null) && (! referralURLs.isEmpty()))
    if (referralURLs != null && !referralURLs.isEmpty())
    {
      buffer.append(", referralURLs={");
      Iterator<String> iterator = referralURLs.iterator();
      buffer.append(iterator.next());
      while (iterator.hasNext())
      {
        buffer.append(", ");
        buffer.append(iterator.next());
      }
      buffer.append(Utils.joinAsString(", ", referralURLs));
      buffer.append("}");
    }
    if ((oid != null) && (oid.length() > 0))
    if (oid != null && oid.length() > 0)
    {
      buffer.append(", oid=");
      buffer.append(oid);
    }
    if (value != null)
    {
      buffer.append(", value=");
@@ -405,7 +390,7 @@
      buffer.append(EOL);
    }
    if ((referralURLs != null) && (! referralURLs.isEmpty()))
    if (referralURLs != null && !referralURLs.isEmpty())
    {
      buffer.append(indentBuf);
      buffer.append("  Referral URLs:  ");
@@ -420,7 +405,7 @@
      }
    }
    if ((oid != null) && (oid.length() > 0))
    if (oid != null && oid.length() > 0)
    {
      buffer.append(indentBuf);
      buffer.append("  Response OID:  ");