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

kenneth_suter
15.34.2007 cfc513043c5830b5a967733066068c7097b42e3c
opendj-sdk/opends/src/server/org/opends/server/controls/VLVRequestControl.java
@@ -25,6 +25,7 @@
 *      Portions Copyright 2007 Sun Microsystems, Inc.
 */
package org.opends.server.controls;
import org.opends.messages.Message;
@@ -39,8 +40,7 @@
import org.opends.server.types.Control;
import org.opends.server.types.LDAPException;
import static org.opends.server.messages.MessageHandler.*;
import static org.opends.server.messages.ProtocolMessages.*;
import static org.opends.messages.ProtocolMessages.*;
import static org.opends.server.util.ServerConstants.*;
import static org.opends.server.util.StaticUtils.*;
@@ -461,9 +461,8 @@
    ASN1OctetString controlValue = control.getValue();
    if (controlValue == null)
    {
      int    msgID   = MSGID_VLVREQ_CONTROL_NO_VALUE;
      String message = getMessage(msgID);
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, msgID, message);
      Message message = INFO_VLVREQ_CONTROL_NO_VALUE.get();
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
    }
    try
@@ -474,9 +473,9 @@
      if ((elements.size() < 3) || (elements.size() > 4))
      {
        int    msgID   = MSGID_VLVREQ_CONTROL_INVALID_ELEMENT_COUNT;
        String message = getMessage(msgID, elements.size());
        throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, msgID, message);
        Message message =
            INFO_VLVREQ_CONTROL_INVALID_ELEMENT_COUNT.get(elements.size());
        throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
      }
      int beforeCount = elements.get(0).decodeAsInteger().intValue();
@@ -501,10 +500,9 @@
          break;
        default:
          int    msgID   = MSGID_VLVREQ_CONTROL_INVALID_TARGET_TYPE;
          String message = getMessage(msgID, byteToHex(targetType));
          throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, msgID,
                                  message);
          Message message = INFO_VLVREQ_CONTROL_INVALID_TARGET_TYPE.get(
              byteToHex(targetType));
          throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
      }
      ASN1OctetString contextID = null;
@@ -524,9 +522,9 @@
    }
    catch (Exception e)
    {
      int    msgID   = MSGID_VLVREQ_CONTROL_CANNOT_DECODE_VALUE;
      String message = getMessage(msgID, getExceptionMessage(e));
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, msgID, message, e);
      Message message =
          INFO_VLVREQ_CONTROL_CANNOT_DECODE_VALUE.get(getExceptionMessage(e));
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message, e);
    }
  }