/** dont do validation that the exchange validator is doing */
  @Override
  public boolean validate(NewOrderSingle msg, Order order) {
    reset();

    final Instrument inst = msg.getInstrument();
    final Exchange ex = inst.getExchange();

    if (!inst.isTestInstrument()) { // dont validate test instruments at ALL
      final long now = System.currentTimeMillis();

      commonValidation(ex, msg, order, now);

      final OMExchangeValidator exchangeValidator =
          (OMExchangeValidator) ex.getExchangeEventValidator();

      // qty validation done in exchangevalidator

      if (exchangeValidator != null) exchangeValidator.validate(msg, _err, now);
    }

    return _err.length() == 0;
  }
  @Override
  public boolean validate(CancelReplaceRequest newVersion, Order order) {
    reset();

    final OrderVersion lastAcc = order.getLastAckedVerion();
    final OrderRequest previous = (OrderRequest) lastAcc.getBaseOrderRequest();
    final int cumQty = order.getLastAckedVerion().getCumQty();

    final Instrument inst = newVersion.getInstrument();
    final Exchange ex = inst.getExchange();

    if (!inst.isTestInstrument()) { // dont validate test instruments at ALL
      final long now = System.currentTimeMillis();
      final int newOrdQty = newVersion.getOrderQty();

      commonValidation(ex, newVersion, order, now);

      if (newVersion.getCurrency() != previous.getCurrency()) { // CANT CHANGE CCY
        delim()
            .append(UNABLE_TO_CHANGE_CCY)
            .append(Strings.FROM)
            .append(previous.getCurrency().toString())
            .append(Strings.TO)
            .append(newVersion.getCurrency().toString());
      }

      if (newVersion.getOrdType() != previous.getOrdType()) {
        delim()
            .append(UNABLE_TO_CHANGE_ORDTYPE)
            .append(Strings.FROM)
            .append(previous.getOrdType().toString())
            .append(Strings.TO)
            .append(newVersion.getOrdType().toString());
      }

      if (newVersion.getSide() != previous.getSide()) {
        delim()
            .append(UNABLE_TO_CHANGE_SIDE)
            .append(Strings.FROM)
            .append(previous.getSide().toString())
            .append(Strings.TO)
            .append(newVersion.getSide().toString());
      }

      if (!newVersion.getSymbol().equals(previous.getSymbol())) {
        delim()
            .append(UNABLE_TO_CHANGE_SYM)
            .append(Strings.FROM)
            .append(previous.getSymbol())
            .append(Strings.TO)
            .append(newVersion.getSymbol());
      }

      if (newVersion.getPrice() == previous.getPrice()
          && newOrdQty == previous.getOrderQty()
          && newVersion.getTimeInForce() == previous.getTimeInForce()) {
        delim().append(MAJOR_FIELDS_UNCHANGED);
      }

      if (newOrdQty < cumQty) {
        delim()
            .append(CANNOT_AMEND_BELOW_CQTY)
            .append(newOrdQty)
            .append(Strings.CUMQTY)
            .append(cumQty);
      }

      final OMExchangeValidator exchangeValidator =
          (OMExchangeValidator) ex.getExchangeEventValidator();
      if (exchangeValidator != null) {
        exchangeValidator.validate(newVersion, _err, now);
      }
    }

    return _err.length() == 0;
  }