Examples of IJavaPrimitiveValue


Examples of org.eclipse.jdt.debug.core.IJavaPrimitiveValue

  @Override
  public void execute() throws CoreException {
    IJavaValue value = popValue();

    if (value instanceof IJavaPrimitiveValue) {
      IJavaPrimitiveValue primitiveValue = (IJavaPrimitiveValue) value;
      switch (fTypeTypeId) {
      case T_double:
        push(newValue(primitiveValue.getDoubleValue()));
        break;
      case T_float:
        push(newValue(primitiveValue.getFloatValue()));
        break;
      case T_long:
        push(newValue(primitiveValue.getLongValue()));
        break;
      case T_int:
        push(newValue(primitiveValue.getIntValue()));
        break;
      case T_short:
        push(newValue(primitiveValue.getShortValue()));
        break;
      case T_byte:
        push(newValue(primitiveValue.getByteValue()));
        break;
      case T_char:
        push(newValue(primitiveValue.getCharValue()));
        break;
      }

    } else if (value instanceof JDINullValue) {
      // null value can be cast to all non-primitive types (bug 31637).
      push(value);
    } else {
      IJavaObject classObject;
      if (fDimension == 0) {
        classObject = getClassObject(getType(fBaseTypeName));
      } else {
        classObject = getClassObject(getArrayType(
            Signature.createTypeSignature(fBaseTypeName, true),
            fDimension));
      }
      if (classObject == null) {
        throw new CoreException(
            new Status(
                IStatus.ERROR,
                JDIDebugPlugin.getUniqueIdentifier(),
                IStatus.OK,
                NLS.bind(InstructionsEvaluationMessages.Cast_No_class_object,
                        new String[] { typeName() }),
                null));
      }
      IJavaPrimitiveValue resultValue = (IJavaPrimitiveValue) classObject
          .sendMessage(IS_INSTANCE, IS_INSTANCE_SIGNATURE,
              new IJavaValue[] { value }, getContext()
                  .getThread(), false);
      if (!resultValue.getBooleanValue()) {
        throw new CoreException(
            new Status(
                IStatus.ERROR,
                JDIDebugPlugin.getUniqueIdentifier(),
                IStatus.OK,
View Full Code Here

Examples of org.eclipse.jdt.debug.core.IJavaPrimitiveValue

  public void execute() throws CoreException {
    IJavaValue value = popValue();
    IJavaVariable variable = (IJavaVariable) pop();

    if (value instanceof IJavaPrimitiveValue) {
      IJavaPrimitiveValue primitiveValue = (IJavaPrimitiveValue) value;
      switch (fVariableTypeId) {
      case T_boolean:
        variable.setValue(newValue(primitiveValue.getBooleanValue()));
        break;
      case T_byte:
        variable.setValue(newValue(primitiveValue.getByteValue()));
        break;
      case T_short:
        variable.setValue(newValue(primitiveValue.getShortValue()));
        break;
      case T_char:
        variable.setValue(newValue(primitiveValue.getCharValue()));
        break;
      case T_int:
        variable.setValue(newValue(primitiveValue.getIntValue()));
        break;
      case T_long:
        variable.setValue(newValue(primitiveValue.getLongValue()));
        break;
      case T_float:
        variable.setValue(newValue(primitiveValue.getFloatValue()));
        break;
      case T_double:
        variable.setValue(newValue(primitiveValue.getDoubleValue()));
        break;
      }
    } else {
      variable.setValue(value);
    }
View Full Code Here

Examples of org.eclipse.jdt.debug.core.IJavaPrimitiveValue

      try {
        IValue value = result.getValue();
        if (fBreakpoint.isConditionSuspendOnTrue()) {
          if (value instanceof IJavaPrimitiveValue) {
            // Suspend when the condition evaluates true
            IJavaPrimitiveValue javaValue = (IJavaPrimitiveValue) value;
            if (javaValue.getJavaType().getName()
                .equals("boolean")) { //$NON-NLS-1$
              if (javaValue.getBooleanValue()) {
                return SUSPEND;
              }
              return DONT_SUSPEND;
            }
          }
View Full Code Here

Examples of org.eclipse.jdt.debug.core.IJavaPrimitiveValue

      return ((IJavaObject) value).sendMessage(TOSTRING_SELECTOR,
          TOSTRING_SIGNATURE, null, getContext().getThread(), null)
          .getValueString();
    }

    IJavaPrimitiveValue primitiveValue = (IJavaPrimitiveValue) value;
    switch (typeId) {
    case T_boolean:
      return Boolean.valueOf(primitiveValue.getBooleanValue()).toString();
    case T_byte:
      return new Integer(primitiveValue.getByteValue()).toString();
    case T_char:
      return new Character(primitiveValue.getCharValue()).toString();
    case T_double:
      return new Double(primitiveValue.getDoubleValue()).toString();
    case T_float:
      return new Float(primitiveValue.getFloatValue()).toString();
    case T_int:
      return new Integer(primitiveValue.getIntValue()).toString();
    case T_long:
      return new Long(primitiveValue.getLongValue()).toString();
    case T_short:
      return new Integer(primitiveValue.getShortValue()).toString();
    }
    return NULL;
  }
View Full Code Here

Examples of org.eclipse.jdt.debug.core.IJavaPrimitiveValue

  /*
   * @see Instruction#execute()
   */
  @Override
  public void execute() throws CoreException {
    IJavaPrimitiveValue value = (IJavaPrimitiveValue) popValue();
    pushNewValue(!value.getBooleanValue());
  }
View Full Code Here

Examples of org.eclipse.jdt.debug.core.IJavaPrimitiveValue

  /*
   * @see Instruction#execute()
   */
  @Override
  public void execute() throws CoreException {
    IJavaPrimitiveValue value = (IJavaPrimitiveValue) popValue();
    switch (fExpressionTypeId) {
    case T_double:
      pushNewValue(+value.getDoubleValue());
      break;
    case T_float:
      pushNewValue(+value.getFloatValue());
      break;
    case T_long:
      pushNewValue(+value.getLongValue());
      break;
    case T_byte:
    case T_short:
    case T_int:
    case T_char:
      pushNewValue(+value.getIntValue());
      break;
    }
  }
View Full Code Here

Examples of org.eclipse.jdt.debug.core.IJavaPrimitiveValue

  /*
   * @see Instruction#execute()
   */
  @Override
  public void execute() throws CoreException {
    IJavaPrimitiveValue value = (IJavaPrimitiveValue) popValue();
    switch (fExpressionTypeId) {
    case T_long:
      pushNewValue(~value.getLongValue());
      break;
    case T_byte:
    case T_short:
    case T_int:
    case T_char:
      pushNewValue(~value.getIntValue());
      break;
    }
  }
View Full Code Here

Examples of org.eclipse.jdt.debug.core.IJavaPrimitiveValue

  /*
   * @see Instruction#execute()
   */
  @Override
  public void execute() throws CoreException {
    IJavaPrimitiveValue value = (IJavaPrimitiveValue) popValue();
    switch (fExpressionTypeId) {
    case T_double:
      pushNewValue(-value.getDoubleValue());
      break;
    case T_float:
      pushNewValue(-value.getFloatValue());
      break;
    case T_long:
      pushNewValue(-value.getLongValue());
      break;
    case T_byte:
    case T_short:
    case T_int:
    case T_char:
      pushNewValue(-value.getIntValue());
      break;
    }
  }
View Full Code Here

Examples of org.eclipse.jdt.debug.core.IJavaPrimitiveValue

  /*
   * @see Instruction#execute()
   */
  @Override
  public void execute() throws CoreException {
    IJavaPrimitiveValue condition = (IJavaPrimitiveValue) popValue();

    if (!(fJumpOnTrue ^ condition.getBooleanValue())) {
      jump(fOffset);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.