@Override
  public Object evaluate(EvaluationContextImpl context) throws EvaluateException {
    Value value = (Value)myOperandEvaluator.evaluate(context);
    if (value == null) {
      if (myPrimitiveCastType != null) {
        throw EvaluateExceptionUtil.createEvaluateException(
          JavaDebuggerBundle.message("evaluation.error.cannot.cast.null", myPrimitiveCastType));
      }
      return null;
    }
    VirtualMachineProxyImpl vm = context.getSuspendContext().getVirtualMachine();
    if (DebuggerUtils.isInteger(value)) {
      value = DebuggerUtilsEx.createValue(vm, myPrimitiveCastType, ((PrimitiveValue)value).longValue());
      if (value == null) {
        throw EvaluateExceptionUtil.createEvaluateException(JavaDebuggerBundle.message("evaluation.error.cannot.cast.numeric",
                                                                                       myPrimitiveCastType));
      }
    }
    else if (DebuggerUtils.isNumeric(value)) {
      value = DebuggerUtilsEx.createValue(vm, myPrimitiveCastType, ((PrimitiveValue)value).doubleValue());
      if (value == null) {
        throw EvaluateExceptionUtil.createEvaluateException(JavaDebuggerBundle.message("evaluation.error.cannot.cast.numeric",
                                                                                       myPrimitiveCastType));
      }
    }
    else if (value instanceof BooleanValue) {
      value = DebuggerUtilsEx.createValue(vm, myPrimitiveCastType, ((BooleanValue)value).booleanValue());
      if (value == null) {
        throw EvaluateExceptionUtil.createEvaluateException(JavaDebuggerBundle.message("evaluation.error.cannot.cast.boolean",
                                                                                       myPrimitiveCastType));
      }
    }
    else if (value instanceof CharValue) {
      value = DebuggerUtilsEx.createValue(vm, myPrimitiveCastType, ((CharValue)value).charValue());
      if (value == null) {
        throw EvaluateExceptionUtil.createEvaluateException(
          JavaDebuggerBundle.message("evaluation.error.cannot.cast.char", myPrimitiveCastType));
      }
    }
    else if (value instanceof ObjectReference) {
      ReferenceType type = ((ObjectReference)value).referenceType();
      if (myTypeCastEvaluator == null) {
        throw EvaluateExceptionUtil.createEvaluateException(
          JavaDebuggerBundle.message("evaluation.error.cannot.cast.object", type.name(), myPrimitiveCastType));
      }
      ReferenceType castType = myTypeCastEvaluator.evaluate(context);
      if (!DebuggerUtilsImpl.instanceOf(type, castType)) {
        throw EvaluateExceptionUtil.createEvaluateException(
          JavaDebuggerBundle.message("evaluation.error.cannot.cast.object", type.name(), castType.name()));
      }
    }

    return value;
  }
@Override
  public Object evaluate(EvaluationContextImpl context)