Package com.sun.jdi

Examples of com.sun.jdi.Field


        List<Field> fields = ((ReferenceType) getUnderlyingType()).fields();
        fDeclaredFields = new String[fields.size()];
        Iterator<Field> iterator = fields.iterator();
        int i = 0;
        while (iterator.hasNext()) {
          Field field = iterator.next();
          fDeclaredFields[i] = field.name();
          i++;
        }
      } catch (RuntimeException e) {
        targetRequestFailed(JDIDebugModelMessages.JDIReferenceType_3, e);
      }
View Full Code Here


  }

  private StringBuffer buildTypeDeclaration(ReferenceType referenceType,
      StringBuffer buffer, String nestedTypeName) {

    Field thisField = null;

    List<Field> fields = referenceType.visibleFields();
    for (Iterator<Field> iterator = fields.iterator(); iterator.hasNext();) {
      Field field = iterator.next();
      if (field.name().startsWith("this$")) { //$NON-NLS-1$
        thisField = field;
        break;
      }
    }
View Full Code Here

      source.append(buffer);
    }

    List<Field> fields = referenceType.fields();
    for (Iterator<Field> iterator = fields.iterator(); iterator.hasNext();) {
      Field field = iterator.next();
      if (!field.name().startsWith("this$")) { //$NON-NLS-1$
        source.append(buildFieldDeclaration(field));
      }
    }

    List<Method> methods = referenceType.methods();
View Full Code Here

    if (object == null || !object.getClass().equals(this.getClass()))
      throw new ClassCastException(JDIMessages.FieldImpl_Can__t_compare_field_to_given_object_1);

    // See if declaring types are the same, if not return comparison between
    // declaring types.
    Field type2 = object;
    if (!declaringType().equals(type2.declaringType()))
      return declaringType().compareTo(type2.declaringType());

    // Return comparison of position within declaring type.
    int index1 = declaringType().fields().indexOf(this);
    int index2 = type2.declaringType().fields().indexOf(type2);
    if (index1 < index2)
      return -1;
    else if (index1 > index2)
      return 1;
    else
View Full Code Here

   */
  protected void determineIfDaemonThread() throws DebugException {
    fIsDaemon = false;
    try {
      ReferenceType referenceType = getUnderlyingThread().referenceType();
      Field field = referenceType.fieldByName("daemon"); //$NON-NLS-1$
      if (field == null) {
        field = referenceType.fieldByName("isDaemon"); //$NON-NLS-1$
      }
      if (field != null) {
        if (field.signature().equals(Signature.SIG_BOOLEAN)) {
          Value value = getUnderlyingThread().getValue(field);
          if (value instanceof BooleanValue) {
            fIsDaemon = ((BooleanValue) value).booleanValue();
          }
        }
View Full Code Here

   *             if an exception occurs retrieving the priority
   * @see IThread#getPriority
   */
  public int getPriority() throws DebugException {
    // to get the priority, we must get the value from the "priority" field
    Field p = null;
    try {
      p = fThread.referenceType().fieldByName("priority"); //$NON-NLS-1$
      if (p == null) {
        requestFailed(
            JDIDebugModelMessages.JDIThread_no_priority_field, null);
View Full Code Here

          // #targetRequestFailed will thrown an exception
          return null;
        }
        Iterator<Field> list = fields.iterator();
        while (list.hasNext()) {
          Field field = list.next();
          fVariables.add(new JDIFieldVariable(
              (JDIDebugTarget) getDebugTarget(), field, object,
              fLogicalParent));
        }
        Collections.sort(fVariables, new Comparator<IJavaVariable>() {
View Full Code Here

            return Collections.EMPTY_LIST;
          }
          if (allFields != null) {
            Iterator<Field> fields = allFields.iterator();
            while (fields.hasNext()) {
              Field field = fields.next();
              if (field.isStatic()) {
                fVariables.add(new JDIFieldVariable(
                    (JDIDebugTarget) getDebugTarget(),
                    field, declaringType));
              }
            }
View Full Code Here

    try {
      if (superField) {
        // begin lookup in superclass
        ref = ((ClassType) ref).superclass();
      }
      Field field = ref.fieldByName(name);
      if (field != null) {
        return new JDIFieldVariable((JDIDebugTarget) getDebugTarget(),
            field, getUnderlyingObject(), fLogicalParent);
      }
      Field enclosingThis = null;
      Iterator<Field> fields = ref.fields().iterator();
      while (fields.hasNext()) {
        Field fieldTmp = fields.next();
        if (fieldTmp.name().startsWith("this$")) { //$NON-NLS-1$
          enclosingThis = fieldTmp;
          break;
        }
      }
View Full Code Here

   */
  public IJavaFieldVariable getField(String name,
      String declaringTypeSignature) throws DebugException {
    ReferenceType ref = getUnderlyingReferenceType();
    try {
      Field field = null;
      Field fieldTmp = null;
      Iterator<Field> fields = ref.allFields().iterator();
      while (fields.hasNext()) {
        fieldTmp = fields.next();
        if (name.equals(fieldTmp.name())
            && declaringTypeSignature.equals(fieldTmp
                .declaringType().signature())) {
          field = fieldTmp;
          break;
        }
      }
View Full Code Here

TOP

Related Classes of com.sun.jdi.Field

Copyright © 2018 www.massapicom. 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.