Examples of IJavaVariable


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

   * @see Instruction#execute()
   */
  @Override
  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);
    }
    push(variable.getValue());
  }
View Full Code Here

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

    }
  }

  private void executeAssignment() throws CoreException {
    IJavaValue value = popValue();
    IJavaVariable variable = (IJavaVariable) pop();
    IJavaValue variableValue = (IJavaValue) variable.getValue();

    switch (fResultTypeId) {
    case T_byte:
      variableValue = getByteValueResult(variableValue, value);
      break;
    case T_short:
      variableValue = getShortValueResult(variableValue, value);
      break;
    case T_char:
      variableValue = getCharValueResult(variableValue, value);
      break;
    case T_int:
      variableValue = getIntValueResult(variableValue, value);
      break;
    case T_long:
      variableValue = getLongValueResult(variableValue, value);
      break;
    case T_float:
      variableValue = getFloatValueResult(variableValue, value);
      break;
    case T_double:
      variableValue = getDoubleValueResult(variableValue, value);
      break;
    case T_boolean:
      variableValue = getBooleanValueResult(variableValue, value);
      break;
    case T_String:
      variableValue = getStringValueResult(variableValue, value);
      break;
    }
    variable.setValue(variableValue);
    push(variableValue);
  }
View Full Code Here

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

  /*
   * @see Instruction#execute()
   */
  @Override
  public void execute() throws CoreException {
    IJavaVariable variable = (IJavaVariable) pop();

    switch (fVariableTypeId) {
    case T_byte:
      variable.setValue(newValue((byte) (((IJavaPrimitiveValue) variable
          .getValue()).getByteValue() - 1)));
      break;
    case T_short:
      variable.setValue(newValue((short) (((IJavaPrimitiveValue) variable
          .getValue()).getShortValue() - 1)));
      break;
    case T_char:
      variable.setValue(newValue((char) (((IJavaPrimitiveValue) variable
          .getValue()).getCharValue() - 1)));
      break;
    case T_int:
      variable.setValue(newValue(((IJavaPrimitiveValue) variable
          .getValue()).getIntValue() - 1));
      break;
    case T_long:
      variable.setValue(newValue(((IJavaPrimitiveValue) variable
          .getValue()).getLongValue() - 1));
      break;
    case T_float:
      variable.setValue(newValue(((IJavaPrimitiveValue) variable
          .getValue()).getFloatValue() - 1));
      break;
    case T_double:
      variable.setValue(newValue(((IJavaPrimitiveValue) variable
          .getValue()).getDoubleValue() - 1));
      break;
    }

    push(variable.getValue());
  }
View Full Code Here

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

    if (isSuspended()) {
      try {
        IStackFrame[] stackFrames = getStackFrames();
        for (IStackFrame stackFrame : stackFrames) {
          IJavaStackFrame sf = (IJavaStackFrame) stackFrame;
          IJavaVariable var = sf.findVariable(varName);
          if (var != null) {
            return var;
          }
        }
      } catch (DebugException e) {
View Full Code Here

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

      codeSnippetInstance.sendMessage(RUN_METHOD,  "()V", null, getThread(), false); //$NON-NLS-1$
      restoreLocals(codeSnippetInstance);

      // now retrieve the description of the result
      IVariable[] fields = codeSnippetInstance.getVariables();
      IJavaVariable resultValue = null;
      IJavaVariable resultType = null;
      for (IVariable field : fields) {
        if (field.getName().equals(RESULT_TYPE_FIELD)) {
          resultType = (IJavaVariable) field;
        }
        if (field.getName().equals(RESULT_VALUE_FIELD)) {
          resultValue = (IJavaVariable) field;
        }
      }
      IJavaValue result = convertResult((IJavaClassObject) resultType.getValue(), (IJavaValue) resultValue.getValue());
      getResult().setValue(result);
    } catch (DebugException e) {
      getResult().setException(e);

      Throwable underlyingException = e.getStatus().getException();
View Full Code Here

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

    if (getStackFrame() != null) {
      locals = getStackFrame().getLocalVariables();
    }
    if (locals != null) {
      for (IJavaVariable local : locals) {
        IJavaVariable field = object.getField(
            LOCAL_VAR_PREFIX + local.getName(), false);
        // internal error if field is not found
        if (field == null) {
          throw new DebugException(
              new Status(
                  IStatus.ERROR,
                  JDIDebugModel.getPluginIdentifier(),
                  DebugException.REQUEST_FAILED,
                  EvaluationMessages.LocalEvaluationEngine_Evaluation_failed___unable_to_initialize_local_variables__4,
                  null));
        }
        field.setValue(local.getValue());
      }
    }
    if (thisObject != null) {
      IJavaVariable field = object.getField(DELEGATE_THIS, false);
      // internal error if field is not found
      if (field == null) {
        throw new DebugException(
            new Status(
                IStatus.ERROR,
                JDIDebugModel.getPluginIdentifier(),
                DebugException.REQUEST_FAILED,
                EvaluationMessages.LocalEvaluationEngine_Evaluation_failed___unable_to_initialize___this___context__5,
                null));
      }
      field.setValue(thisObject);
    }
  }
View Full Code Here

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

    if (getStackFrame() != null) {
      locals = getStackFrame().getLocalVariables();
    }
    if (locals != null) {
      for (IJavaVariable local : locals) {
        IJavaVariable field = object.getField(
            LOCAL_VAR_PREFIX + local.getName(), false);
        // internal error if field is not found
        if (field == null) {
          throw new DebugException(
              new Status(
                  IStatus.ERROR,
                  JDIDebugModel.getPluginIdentifier(),
                  DebugException.REQUEST_FAILED,
                  EvaluationMessages.LocalEvaluationEngine_Evaluation_failed___unable_to_initialize_local_variables__6,
                  null));
        }
        local.setValue(field.getValue());
      }
    }
  }
View Full Code Here

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

    if (sig.length() == 1) {
      // primitive type - find the instance variable with the
      // signature of the result type we are looking for
      IVariable[] vars = result.getVariables();
      IJavaVariable var = null;
      for (IVariable var2 : vars) {
        IJavaVariable jv = (IJavaVariable) var2;
        if (!jv.isStatic() && jv.getSignature().equals(sig)) {
          var = jv;
          break;
        }
      }
      if (var != null) {
View Full Code Here

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

  /*
   * @see Instruction#execute()
   */
  @Override
  public void execute() throws CoreException {
    IJavaVariable variable = (IJavaVariable) pop();
    push(variable.getValue());

    switch (fVariableTypeId) {
    case T_byte:
      variable.setValue(newValue((byte) (((IJavaPrimitiveValue) variable
          .getValue()).getByteValue() - 1)));
      break;
    case T_short:
      variable.setValue(newValue((short) (((IJavaPrimitiveValue) variable
          .getValue()).getShortValue() - 1)));
      break;
    case T_char:
      variable.setValue(newValue((char) (((IJavaPrimitiveValue) variable
          .getValue()).getCharValue() - 1)));
      break;
    case T_int:
      variable.setValue(newValue(((IJavaPrimitiveValue) variable
          .getValue()).getIntValue() - 1));
      break;
    case T_long:
      variable.setValue(newValue(((IJavaPrimitiveValue) variable
          .getValue()).getLongValue() - 1));
      break;
    case T_float:
      variable.setValue(newValue(((IJavaPrimitiveValue) variable
          .getValue()).getFloatValue() - 1));
      break;
    case T_double:
      variable.setValue(newValue(((IJavaPrimitiveValue) variable
          .getValue()).getDoubleValue() - 1));
      break;
    }
  }
View Full Code Here

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

  /*
   * @see Instruction#execute()
   */
  @Override
  public void execute() throws CoreException {
    IJavaVariable variable = (IJavaVariable) pop();
    push(variable.getValue());

    switch (fVariableTypeId) {
    case T_byte:
      variable.setValue(newValue((byte) (((IJavaPrimitiveValue) variable
          .getValue()).getByteValue() + 1)));
      break;
    case T_short:
      variable.setValue(newValue((short) (((IJavaPrimitiveValue) variable
          .getValue()).getShortValue() + 1)));
      break;
    case T_char:
      variable.setValue(newValue((char) (((IJavaPrimitiveValue) variable
          .getValue()).getCharValue() + 1)));
      break;
    case T_int:
      variable.setValue(newValue(((IJavaPrimitiveValue) variable
          .getValue()).getIntValue() + 1));
      break;
    case T_long:
      variable.setValue(newValue(((IJavaPrimitiveValue) variable
          .getValue()).getLongValue() + 1));
      break;
    case T_float:
      variable.setValue(newValue(((IJavaPrimitiveValue) variable
          .getValue()).getFloatValue() + 1));
      break;
    case T_double:
      variable.setValue(newValue(((IJavaPrimitiveValue) variable
          .getValue()).getDoubleValue() + 1));
      break;
    }
  }
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.