Examples of ArrayReference


Examples of com.sun.jdi.ArrayReference

   * @return the {@link ClassType} instance
   */
  public ClassType inject(byte[] clazz, String argsForInstantiate) throws Exception {

    // build a byte array and fill it
    final ArrayReference array = buildArray(_byte, clazz.length);
    ByteValue[] byteValues = new ByteValue[clazz.length];
    for (int i = 0; i < clazz.length; i++) {
      byteValues[i] = virtualMachine.mirrorOf(clazz[i]);
    }
    array.setValues(Arrays.asList(byteValues));

    // load the class with the class loader
    final ObjectReference loadedClazz = (ObjectReference) invokeMethod(myClassLoader, _URLClassLoader, "defineClass", "([BII)Ljava/lang/Class;", new Value[] { array, virtualMachine.mirrorOf(0), virtualMachine.mirrorOf(clazz.length) });
    final ClassType _clazz = (ClassType) ((ClassObjectReference) loadedClazz).reflectedType();

View Full Code Here

Examples of com.sun.jdi.ArrayReference

            final Location loc = be.location();
            final ThreadReference tr = be.thread()
            if (loc.equals(interceptIn)) {
              LocalVariable result = (LocalVariable) loc.method().variablesByName("result").get(0);
              LocalVariable buffer = (LocalVariable) loc.method().arguments().get(0);
              ArrayReference buf = (ArrayReference) tr.frame(0).getValue(buffer);
              new InputInterceptHandler(tr, buf, result).start();
            } else if (loc.equals(interceptOut)) {
              LocalVariable result = (LocalVariable) loc.method().variablesByName("result").get(0);
              LocalVariable data = (LocalVariable) loc.method().arguments().get(0);
              ArrayReference buf = (ArrayReference) tr.frame(0).getValue(data);
              List values = buf.getValues();
              byte[] temp = new byte[buf.length()];
              for (int i = 0; i < temp.length; i++) {
                temp[i] = ((ByteValue)values.get(i)).byteValue();
              }
              pipedOut.write(temp);
              pipedOut.flush();
View Full Code Here

Examples of com.sun.jdi.ArrayReference

  /**
   * Returns this variable's current underlying value.
   */
  @Override
  protected Value retrieveValue() {
    ArrayReference ar = getArrayReference();
    if (ar != null) {
      return ar.getValue(getIndex());
    }
    return null;
  }
View Full Code Here

Examples of com.sun.jdi.ArrayReference

    return "[" + getIndex() + "]"; //$NON-NLS-2$ //$NON-NLS-1$
  }

  @Override
  protected void setJDIValue(Value value) throws DebugException {
    ArrayReference ar = getArrayReference();
    if (ar == null) {
      requestFailed(
          JDIDebugModelMessages.JDIArrayEntryVariable_value_modification_failed,
          null);
    }
    try {
      ar.setValue(getIndex(), value);
      fireChangeEvent(DebugEvent.CONTENT);
    } catch (ClassNotLoadedException e) {
      targetRequestFailed(
          MessageFormat.format(
              JDIDebugModelMessages.JDIArrayEntryVariable_exception_modifying_variable_value,
View Full Code Here

Examples of com.sun.jdi.ArrayReference

  /**
   * @see IJavaArrayType#newInstance(int)
   */
  public IJavaArray newInstance(int size) throws DebugException {
    try {
      ArrayReference ar = ((ArrayType) getUnderlyingType())
          .newInstance(size);
      return (IJavaArray) JDIValue.createValue(getJavaDebugTarget(), ar);
    } catch (RuntimeException e) {
      targetRequestFailed(
          MessageFormat.format(
View Full Code Here

Examples of com.sun.jdi.ArrayReference

            return false;
        }

        // handle arrays
        if (getType() == TYPE_ARRAY) {
            ArrayReference array = (ArrayReference) value;
            return array.length() > 0;
        }
        // handle objects
        if (getType() == TYPE_OBJECT) { // this also rules out null
            // check if this object has any fields
            ObjectReference obj = (ObjectReference) value;
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.ast.ArrayReference

        // output.append(qnr.actualReceiverType.debugName());
        // output.append('.');
        // output.append(qnr.tokens[qnr.tokens.length - 1]);
        return output;
      } else if (e instanceof ArrayReference) {
        ArrayReference ar = (ArrayReference) e;
        printExpression(ar.receiver).append('[');
        return printExpression(ar.position).append(']');
      } else if (e instanceof MessageSend) {
        return printMessageSendStatement((MessageSend) e);
      } else if (e instanceof ThisReference) {
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.ast.ArrayReference

  //optimize push/pop
  Expression exp;
  if (unspecifiedReference) {
    exp =
      this.expressionStack[this.expressionPtr] =
        new ArrayReference(
          getUnspecifiedReferenceOptimized(),
          this.expressionStack[this.expressionPtr]);
  } else {
    this.expressionPtr--;
    this.expressionLengthPtr--;
    exp =
      this.expressionStack[this.expressionPtr] =
        new ArrayReference(
          this.expressionStack[this.expressionPtr],
          this.expressionStack[this.expressionPtr + 1]);
  }
  exp.sourceEnd = this.endStatementPosition;
}
View Full Code Here

Examples of org.jboss.aop.array.ArrayReference

      ClassForReference obj = new ClassForReference();
      obj.fieldA = arr;
      List<ArrayReference> references = registry.getArrayOwners(arr);

      assertEquals(1, references.size());
      ArrayReference reference = references.get(0);
      assertEquals(obj, reference.getRootObject());
      assertEquals("fieldA", reference.getRootField());
      assertNull(reference.getNestedArrayIndices());

      obj.fieldA = null;
      references = registry.getArrayOwners(arr);
      assertNull(references);
   }
View Full Code Here

Examples of org.jboss.aop.array.ArrayReference

      assertTrue("Did not find all references " + fields, fields.size() == 0);
     
      obj.fieldA = null;
      references = registry.getArrayOwners(arr);
      assertEquals(1, references.size());
      ArrayReference reference = references.get(0);
      assertEquals(obj, reference.getRootObject());
      assertEquals("fieldB", reference.getRootField());
      assertNull(reference.getNestedArrayIndices());
     
      obj.fieldB = null;
      references = registry.getArrayOwners(arr);
      assertNull(references);
   }
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.