sa-jdi

ion exc) {}
      return 0;
    }
    
    public int max()
    {
      return max;
    }
    
    public int min()
    {
      return min;
    }
  }
  
  class StringArgumentImpl
    extends ConnectorImpl.ArgumentImpl
    implements Connector.StringArgument
  {
    StringArgumentImpl(String name, String label, String description, String value, boolean mustSpecify)
    {
      super(name, label, description, value, mustSpecify);
    }
    
    public boolean isValid(String value)
    {
      return true;
    }
  }
  
  class SelectedArgumentImpl
    extends ConnectorImpl.ArgumentImpl
    implements Connector.SelectedArgument
  {
    private final List choices;
    
    SelectedArgumentImpl(String name, String label, String description, String value, boolean mustSpecify, List choices)
    {
      super(name, label, description, value, mustSpecify);
      this.choices = Collections.unmodifiableList(new ArrayList(choices));
    }
    
    public List choices()
    {
      return choices;
    }
    
    public boolean isValid(String value)
    {
      return choices.contains(value);
    }
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.jdi.ConnectorImpl
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.jdi;

import com.sun.jdi.DoubleType;
import com.sun.jdi.InvalidTypeException;
import com.sun.jdi.PrimitiveValue;
import com.sun.jdi.VirtualMachine;

public class DoubleTypeImpl
  extends PrimitiveTypeImpl
  implements DoubleType
{
  DoubleTypeImpl(VirtualMachine vm)
  {
    super(vm);
  }
  
  public String signature()
  {
    return "D";
  }
  
  PrimitiveValue convert(PrimitiveValue value)
    throws InvalidTypeException
  {
    return vm.mirrorOf(((PrimitiveValueImpl)value).checkedDoubleValue());
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.jdi.DoubleTypeImpl
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.jdi;

import com.sun.jdi.DoubleValue;
import com.sun.jdi.InvalidTypeException;
import com.sun.jdi.Type;
import com.sun.jdi.VirtualMachine;

public class DoubleValueImpl
  extends PrimitiveValueImpl
  implements DoubleValue
{
  private double value;
  
  DoubleValueImpl(VirtualMachine aVm, double aValue)
  {
    super(aVm);
    
    value = aValue;
  }
  
  public boolean equals(Object obj)
  {
    if ((obj != null) && ((obj instanceof DoubleValue))) {
      return (value == ((DoubleValue)obj).value()) && (super.equals(obj));
    }
    return false;
  }
  
  public int compareTo(Object obj)
  {
    double other = ((DoubleValue)obj).value();
    if (value() < other) {
      return -1;
    }
    if (value() == other) {
      return 0;
    }
    return 1;
  }
  
  public int hashCode()
  {
    return intValue();
  }
  
  public Type type()
  {
    return vm.theDoubleType();
  }
  
  public double value()
  {
    return value;
  }
  
  public boolean booleanValue()
  {
    return value != 0.0D;
  }
  
  public byte byteValue()
  {
    return (byte)(int)value;
  }
  
  public char charValue()
  {
    return (char)(int)value;
  }
  
  public short shortValue()
  {
    return (short)(int)value;
  }
  
  public int intValue()
  {
    return (int)value;
  }
  
  public long longValue()
  {
    return value;
  }
  
  public float floatValue()
  {
    return (float)value;
  }
  
  public double doubleValue()
  {
    return value;
  }
  
  byte checkedByteValue()
    throws InvalidTypeException
  {
    if ((value > 127.0D) || (value < -128.0D)) {
      throw new InvalidTypeException("Can't convert " + value + " to byte");
    }
    return super.checkedByteValue();
  }
  
  char checkedCharValue()
    throws InvalidTypeException
  {
    if ((value > 65535.0D) || (value < 0.0D)) {
      throw new InvalidTypeException("Can't convert " + value + " to char");
    }
    return super.checkedCharValue();
  }
  
  short checkedShortValue()
    throws InvalidTypeException
  {
    if ((value > 32767.0D) || (value < -32768.0D)) {
      throw new InvalidTypeException("Can't convert " + value + " to short");
    }
    return super.checkedShortValue();
  }
  
  int checkedIntValue()
    throws InvalidTypeException
  {
    if ((value > 2.147483647E9D) || (value < -2.147483648E9D)) {
      throw new InvalidTypeException("Can't convert " + value + " to int");
    }
    return super.checkedIntValue();
  }
  
  long checkedLongValue()
    throws InvalidTypeException
  {
    long longValue = value;
    if (longValue != value) {
      throw new InvalidTypeException("Can't convert " + value + " to long");
    }
    return super.checkedLongValue();
  }
  
  float checkedFloatValue()
    throws InvalidTypeException
  {
    float floatValue = (float)value;
    if (floatValue != value) {
      throw new InvalidTypeException("Can't convert " + value + " to float");
    }
    return super.checkedFloatValue();
  }
  
  public String toString()
  {
    return "" + value;
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.jdi.DoubleValueImpl
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.jdi;

import com.sun.jdi.ClassNotLoadedException;
import com.sun.jdi.ReferenceType;
import com.sun.jdi.Type;
import com.sun.jdi.VirtualMachine;
import sun.jvm.hotspot.oops.AccessFlags;
import sun.jvm.hotspot.oops.Array;
import sun.jvm.hotspot.oops.BooleanField;
import sun.jvm.hotspot.oops.ByteField;
import sun.jvm.hotspot.oops.CharField;
import sun.jvm.hotspot.oops.DoubleField;
import sun.jvm.hotspot.oops.FieldIdentifier;
import sun.jvm.hotspot.oops.FieldType;
import sun.jvm.hotspot.oops.FloatField;
import sun.jvm.hotspot.oops.IntField;
import sun.jvm.hotspot.oops.LongField;
import sun.jvm.hotspot.oops.Oop;
import sun.jvm.hotspot.oops.OopField;
import sun.jvm.hotspot.oops.ShortField;
import sun.jvm.hotspot.oops.Symbol;

public class FieldImpl
  extends TypeComponentImpl
  implements com.sun.jdi.Field
{
  private JNITypeParser signatureParser;
  private sun.jvm.hotspot.oops.Field saField;
  
  FieldImpl(VirtualMachine vm, ReferenceTypeImpl declaringType, sun.jvm.hotspot.oops.Field saField)
  {
    super(vm, declaringType);
    this.saField = saField;
    getParser();
  }
  
  private void getParser()
  {
    if (signatureParser == null)
    {
      Symbol sig1 = saField.getSignature();
      signature = sig1.asString();
      signatureParser = new JNITypeParser(signature);
    }
  }
  
  sun.jvm.hotspot.oops.Field ref()
  {
    return saField;
  }
  
  ValueImpl getValue()
  {
    return getValue(saField.getFieldHolder());
  }
  
  ValueImpl getValue(Oop target)
  {
    sun.jvm.hotspot.oops.Field saField = ref();
    FieldType ft = saField.getFieldType();
    ValueImpl valueImpl;
    if (ft.isArray())
    {
      OopField of = (OopField)saField;
      valueImpl = vm.arrayMirror((Array)of.getValue(target));
    }
    else
    {
      ValueImpl valueImpl;
      if (ft.isObject())
      {
        OopField of = (OopField)saField;
        valueImpl = vm.objectMirror(of.getValue(target));
      }
      else
      {
        ValueImpl valueImpl;
        if (ft.isByte())
        {
          ByteField bf = (ByteField)saField;
          valueImpl = (ByteValueImpl)vm.mirrorOf(bf.getValue(target));
        }
        else
        {
          ValueImpl valueImpl;
          if (ft.isChar())
          {
            CharField cf = (CharField)saField;
            valueImpl = (CharValueImpl)vm.mirrorOf(cf.getValue(target));
          }
          else
          {
            ValueImpl valueImpl;
            if (ft.isDouble())
            {
              DoubleField df = (DoubleField)saField;
              valueImpl = (DoubleValueImpl)vm.mirrorOf(df.getValue(target));
            }
            else
            {
              ValueImpl valueImpl;
              if (ft.isFloat())
              {
                FloatField ff = (FloatField)saField;
                valueImpl = (FloatValueImpl)vm.mirrorOf(ff.getValue(target));
              }
              else
              {
                ValueImpl valueImpl;
                if (ft.isInt())
                {
                  IntField iif = (IntField)saField;
                  valueImpl = (IntegerValueImpl)vm.mirrorOf(iif.getValue(target));
                }
                else
                {
                  ValueImpl valueImpl;
                  if (ft.isLong())
                  {
                    LongField lf = (LongField)saField;
                    valueImpl = (LongValueImpl)vm.mirrorOf(lf.getValue(target));
                  }
                  else
                  {
                    ValueImpl valueImpl;
                    if (ft.isShort())
                    {
                      ShortField sf = (ShortField)saField;
                      valueImpl = (ShortValueImpl)vm.mirrorOf(sf.getValue(target));
                    }
                    else
                    {
                      ValueImpl valueImpl;
                      if (ft.isBoolean())
                      {
                        BooleanField bf = (BooleanField)saField;
                        valueImpl = (BooleanValueImpl)vm.mirrorOf(bf.getValue(target));
                      }
                      else
                      {
                        throw new RuntimeException("Should not reach here");
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
    ValueImpl valueImpl;
    return valueImpl;
  }
  
  public boolean equals(Object obj)
  {
    if ((obj != null) && ((obj instanceof FieldImpl)))
    {
      FieldImpl other = (FieldImpl)obj;
      return (declaringType().equals(other.declaringType())) && (ref().equals(other.ref())) && (super.equals(obj));
    }
    return false;
  }
  
  public boolean isTransient()
  {
    return saField.isTransient();
  }
  
  public boolean isVolatile()
  {
    return saField.isVolatile();
  }
  
  public boolean isEnumConstant()
  {
    return saField.isEnumConstant();
  }
  
  public Type type()
    throws ClassNotLoadedException
  {
    return findType(signature());
  }
  
  public String typeName()
  {
    getParser();
    return signatureParser.typeName();
  }
  
  public String genericSignature()
  {
    Symbol genSig = saField.getGenericSignature();
    return genSig != null ? genSig.asString() : null;
  }
  
  public int compareTo(Object object)
  {
    com.sun.jdi.Field field = (com.sun.jdi.Field)object;
    ReferenceTypeImpl declaringType = (ReferenceTypeImpl)declaringType();
    int rc = declaringType.compareTo(field.declaringType());
    if (rc == 0) {
      rc = declaringType.indexOf(this) - declaringType.indexOf(field);
    }
    return rc;
  }
  
  public String toString()
  {
    StringBuffer buf = new StringBuffer();
    
    buf.append(declaringType().name());
    buf.append('.');
    buf.append(name());
    return buf.toString();
  }
  
  public String name()
  {
    FieldIdentifier myName = saField.getID();
    return myName.getName();
  }
  
  public int modifiers()
  {
    return saField.getAccessFlagsObj().getStandardFlags();
  }
  
  public boolean isPackagePrivate()
  {
    return saField.isPackagePrivate();
  }
  
  public boolean isPrivate()
  {
    return saField.isPrivate();
  }
  
  public boolean isProtected()
  {
    return saField.isProtected();
  }
  
  public boolean isPublic()
  {
    return saField.isPublic();
  }
  
  public boolean isStatic()
  {
    return saField.isStatic();
  }
  
  public boolean isFinal()
  {
    return saField.isFinal();
  }
  
  public boolean isSynthetic()
  {
    return saField.isSynthetic();
  }
  
  public int hashCode()
  {
    return saField.hashCode();
  }
  
  private Type findType(String signature)
    throws ClassNotLoadedException
  {
    ReferenceTypeImpl enclosing = (ReferenceTypeImpl)declaringType();
    return enclosing.findType(signature);
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.jdi.FieldImpl
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.jdi;

import com.sun.jdi.FloatType;
import com.sun.jdi.InvalidTypeException;
import com.sun.jdi.PrimitiveValue;
import com.sun.jdi.VirtualMachine;

public class FloatTypeImpl
  extends PrimitiveTypeImpl
  implements FloatType
{
  FloatTypeImpl(VirtualMachine vm)
  {
    super(vm);
  }
  
  public String signature()
  {
    return "F";
  }
  
  PrimitiveValue convert(PrimitiveValue value)
    throws InvalidTypeException
  {
    return vm.mirrorOf(((PrimitiveValueImpl)value).checkedFloatValue());
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.jdi.FloatTypeImpl
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.jdi;

import com.sun.jdi.FloatValue;
import com.sun.jdi.InvalidTypeException;
import com.sun.jdi.Type;
import com.sun.jdi.VirtualMachine;

public class FloatValueImpl
  extends PrimitiveValueImpl
  implements FloatValue
{
  private float value;
  
  FloatValueImpl(VirtualMachine aVm, float aValue)
  {
    super(aVm);
    
    value = aValue;
  }
  
  public boolean equals(Object obj)
  {
    if ((obj != null) && ((obj instanceof FloatValue))) {
      return (value == ((FloatValue)obj).value()) && (super.equals(obj));
    }
    return false;
  }
  
  public int hashCode()
  {
    return intValue();
  }
  
  public int compareTo(Object obj)
  {
    float other = ((FloatValue)obj).value();
    if (value() < other) {
      return -1;
    }
    if (value() == other) {
      return 0;
    }
    return 1;
  }
  
  public Type type()
  {
    return vm.theFloatType();
  }
  
  public float value()
  {
    return value;
  }
  
  public boolean booleanValue()
  {
    return value != 0.0D;
  }
  
  public byte byteValue()
  {
    return (byte)(int)value;
  }
  
  public char charValue()
  {
    return (char)(int)value;
  }
  
  public short shortValue()
  {
    return (short)(int)value;
  }
  
  public int intValue()
  {
    return (int)value;
  }
  
  public long longValue()
  {
    return value;
  }
  
  public float floatValue()
  {
    return value;
  }
  
  public double doubleValue()
  {
    return value;
  }
  
  byte checkedByteValue()
    throws InvalidTypeException
  {
    if ((value > 127.0F) || (value < -128.0F)) {
      throw new InvalidTypeException("Can't convert " + value + " to byte");
    }
    return super.checkedByteValue();
  }
  
  char checkedCharValue()
    throws InvalidTypeException
  {
    if ((value > 65535.0F) || (value < 0.0F)) {
      throw new InvalidTypeException("Can't convert " + value + " to char");
    }
    return super.checkedCharValue();
  }
  
  short checkedShortValue()
    throws InvalidTypeException
  {
    if ((value > 32767.0F) || (value < -32768.0F)) {
      throw new InvalidTypeException("Can't convert " + value + " to short");
    }
    return super.checkedShortValue();
  }
  
  int checkedIntValue()
    throws InvalidTypeException
  {
    int intValue = (int)value;
    if (intValue != value) {
      throw new InvalidTypeException("Can't convert " + value + " to int");
    }
    return super.checkedIntValue();
  }
  
  long checkedLongValue()
    throws InvalidTypeException
  {
    long longValue = value;
    if ((float)longValue != value) {
      throw new InvalidTypeException("Can't convert " + value + " to long");
    }
    return super.checkedLongValue();
  }
  
  public String toString()
  {
    return "" + value;
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.jdi.FloatValueImpl
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.jdi;

import com.sun.jdi.IntegerType;
import com.sun.jdi.InvalidTypeException;
import com.sun.jdi.PrimitiveValue;
import com.sun.jdi.VirtualMachine;

public class IntegerTypeImpl
  extends PrimitiveTypeImpl
  implements IntegerType
{
  IntegerTypeImpl(VirtualMachine vm)
  {
    super(vm);
  }
  
  public String signature()
  {
    return "I";
  }
  
  PrimitiveValue convert(PrimitiveValue value)
    throws InvalidTypeException
  {
    return vm.mirrorOf(((PrimitiveValueImpl)value).checkedIntValue());
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.jdi.IntegerTypeImpl
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.jdi;

import com.sun.jdi.IntegerValue;
import com.sun.jdi.InvalidTypeException;
import com.sun.jdi.Type;
import com.sun.jdi.VirtualMachine;

public class IntegerValueImpl
  extends PrimitiveValueImpl
  implements IntegerValue
{
  private int value;
  
  IntegerValueImpl(VirtualMachine aVm, int aValue)
  {
    super(aVm);
    
    value = aValue;
  }
  
  public boolean equals(Object obj)
  {
    if ((obj != null) && ((obj instanceof IntegerValue))) {
      return (value == ((IntegerValue)obj).value()) && (super.equals(obj));
    }
    return false;
  }
  
  public int hashCode()
  {
    return intValue();
  }
  
  public int compareTo(Object obj)
  {
    int other = ((IntegerValue)obj).value();
    return value() - other;
  }
  
  public Type type()
  {
    return vm.theIntegerType();
  }
  
  public int value()
  {
    return value;
  }
  
  public boolean booleanValue()
  {
    return value != 0;
  }
  
  public byte byteValue()
  {
    return (byte)value;
  }
  
  public char charValue()
  {
    return (char)value;
  }
  
  public short shortValue()
  {
    return (short)value;
  }
  
  public int intValue()
  {
    return value;
  }
  
  public long longValue()
  {
    return value;
  }
  
  public float floatValue()
  {
    return value;
  }
  
  public double doubleValue()
  {
    return value;
  }
  
  byte checkedByteValue()
    throws InvalidTypeException
  {
    if ((value > 127) || (value < -128)) {
      throw new InvalidTypeException("Can't convert " + value + " to byte");
    }
    return super.checkedByteValue();
  }
  
  char checkedCharValue()
    throws InvalidTypeException
  {
    if ((value > 65535) || (value < 0)) {
      throw new InvalidTypeException("Can't convert " + value + " to char");
    }
    return super.checkedCharValue();
  }
  
  short checkedShortValue()
    throws InvalidTypeException
  {
    if ((value > 32767) || (value < 32768)) {
      throw new InvalidTypeException("Can't convert " + value + " to short");
    }
    return super.checkedShortValue();
  }
  
  public String toString()
  {
    return "" + value;
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.jdi.IntegerValueImpl
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.jdi;

import com.sun.jdi.ClassNotPreparedException;
import com.sun.jdi.ClassType;
import com.sun.jdi.InterfaceType;
import com.sun.jdi.ReferenceType;
import com.sun.jdi.VirtualMachine;
import java.lang.ref.SoftReference;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import sun.jvm.hotspot.oops.InstanceKlass;

public class InterfaceTypeImpl
  extends ReferenceTypeImpl
  implements InterfaceType
{
  private SoftReference superInterfacesCache = null;
  private SoftReference subInterfacesCache = null;
  private SoftReference implementorsCache = null;
  
  protected InterfaceTypeImpl(VirtualMachine aVm, InstanceKlass aRef)
  {
    super(aVm, aRef);
  }
  
  public List superinterfaces()
    throws ClassNotPreparedException
  {
    List superinterfaces = superInterfacesCache != null ? (List)superInterfacesCache.get() : null;
    if (superinterfaces == null)
    {
      checkPrepared();
      superinterfaces = Collections.unmodifiableList(getInterfaces());
      superInterfacesCache = new SoftReference(superinterfaces);
    }
    return superinterfaces;
  }
  
  public List subinterfaces()
  {
    List subinterfaces = subInterfacesCache != null ? (List)subInterfacesCache.get() : null;
    if (subinterfaces == null)
    {
      List all = vm.allClasses();
      subinterfaces = new ArrayList();
      Iterator iter = all.iterator();
      while (iter.hasNext())
      {
        ReferenceType refType = (ReferenceType)iter.next();
        if ((refType instanceof InterfaceType))
        {
          InterfaceType interfaze = (InterfaceType)refType;
          if ((interfaze.isPrepared()) && (interfaze.superinterfaces().contains(this))) {
            subinterfaces.add(interfaze);
          }
        }
      }
      subinterfaces = Collections.unmodifiableList(subinterfaces);
      subInterfacesCache = new SoftReference(subinterfaces);
    }
    return subinterfaces;
  }
  
  public List implementors()
  {
    List implementors = implementorsCache != null ? (List)implementorsCache.get() : null;
    if (implementors == null)
    {
      List all = vm.allClasses();
      implementors = new ArrayList();
      Iterator iter = all.iterator();
      while (iter.hasNext())
      {
        ReferenceType refType = (ReferenceType)iter.next();
        if ((refType instanceof ClassType))
        {
          ClassType clazz = (ClassType)refType;
          if ((clazz.isPrepared()) && (clazz.interfaces().contains(this))) {
            implementors.add(clazz);
          }
        }
      }
      implementors = Collections.unmodifiableList(implementors);
      implementorsCache = new SoftReference(implementors);
    }
    return implementors;
  }
  
  void addVisibleMethods(Map methodMap)
  {
    Iterator iter = superinterfaces().iterator();
    while (iter.hasNext())
    {
      InterfaceTypeImpl interfaze = (InterfaceTypeImpl)iter.next();
      interfaze.addVisibleMethods(methodMap);
    }
    addToMethodMap(methodMap, methods());
  }
  
  List getAllMethods()
  {
    ArrayList list = new ArrayList(methods());
    
    List interfaces = allSuperinterfaces();
    Iterator iter = interfaces.iterator();
    while (iter.hasNext())
    {
      InterfaceType interfaze = (InterfaceType)iter.next();
      list.addAll(interfaze.methods());
    }
    return list;
  }
  
  List allSuperinterfaces()
  {
    ArrayList list = new ArrayList();
    addSuperinterfaces(list);
    return list;
  }
  
  void addSuperinterfaces(List list)
  {
    List immediate = new ArrayList(superinterfaces());
    Iterator iter = immediate.iterator();
    while (iter.hasNext())
    {
      InterfaceType interfaze = (InterfaceType)iter.next();
      if (list.contains(interfaze)) {
        iter.remove();
      }
    }
    list.addAll(immediate);
    
    iter = immediate.iterator();
    while (iter.hasNext())
    {
      InterfaceTypeImpl interfaze = (InterfaceTypeImpl)iter.next();
      interfaze.addSuperinterfaces(list);
    }
  }
  
  boolean isAssignableTo(ReferenceType type)
  {
    if (equals(type)) {
      return true;
    }
    List supers = superinterfaces();
    Iterator iter = supers.iterator();
    while (iter.hasNext())
    {
      InterfaceTypeImpl interfaze = (InterfaceTypeImpl)iter.next();
      if (interfaze.isAssignableTo(type)) {
        return true;
      }
    }
    return false;
  }
  
  List inheritedTypes()
  {
    return superinterfaces();
  }
  
  public boolean isInitialized()
  {
    return isPrepared();
  }
  
  public String toString()
  {
    return "interface " + name() + " (" + loaderString() + ")";
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.jdi.InterfaceTypeImpl
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.jdi;

import java.util.ArrayList;
import java.util.List;

public class JNITypeParser
{
  static final char SIGNATURE_ENDCLASS = ';';
  static final char SIGNATURE_FUNC = '(';
  static final char SIGNATURE_ENDFUNC = ')';
  private String signature;
  private List typeNameList;
  private List signatureList;
  private int currentIndex;
  
  JNITypeParser(String signature)
  {
    this.signature = signature;
  }
  
  static String typeNameToSignature(String signature)
  {
    StringBuffer buffer = new StringBuffer();
    int firstIndex = signature.indexOf('[');
    int index = firstIndex;
    while (index != -1)
    {
      buffer.append('[');
      index = signature.indexOf('[', index + 1);
    }
    if (firstIndex != -1) {
      signature = signature.substring(0, firstIndex);
    }
    if (signature.equals("boolean"))
    {
      buffer.append('Z');
    }
    else if (signature.equals("byte"))
    {
      buffer.append('B');
    }
    else if (signature.equals("char"))
    {
      buffer.append('C');
    }
    else if (signature.equals("short"))
    {
      buffer.append('S');
    }
    else if (signature.equals("int"))
    {
      buffer.append('I');
    }
    else if (signature.equals("long"))
    {
      buffer.append('J');
    }
    else if (signature.equals("float"))
    {
      buffer.append('F');
    }
    else if (signature.equals("double"))
    {
      buffer.append('D');
    }
    else
    {
      buffer.append('L');
      buffer.append(signature.replace('.', '/'));
      buffer.append(';');
    }
    return buffer.toString();
  }
  
  String typeName()
  {
    return (String)typeNameList().get(typeNameList().size() - 1);
  }
  
  List argumentTypeNames()
  {
    return typeNameList().subList(0, typeNameList().size() - 1);
  }
  
  String signature()
  {
    return (String)signatureList().get(signatureList().size() - 1);
  }
  
  List argumentSignatures()
  {
    return signatureList().subList(0, signatureList().size() - 1);
  }
  
  int dimensionCount()
  {
    int count = 0;
    String signature = signature();
    while (signature.charAt(count) == '[') {
      count++;
    }
    return count;
  }
  
  String componentSignature(int level)
  {
    return signature().substring(level);
  }
  
  private synchronized List signatureList()
  {
    if (signatureList == null)
    {
      signatureList = new ArrayList(10);
      
      currentIndex = 0;
      while (currentIndex < signature.length())
      {
        String elem = nextSignature();
        signatureList.add(elem);
      }
      if (signatureList.size() == 0) {
        throw new IllegalArgumentException("Invalid JNI signature '" + signature + "'");
      }
    }
    return signatureList;
  }
  
  private synchronized List typeNameList()
  {
    if (typeNameList == null)
    {
      typeNameList = new ArrayList(10);
      
      currentIndex = 0;
      while (currentIndex < signature.length())
      {
        String elem = nextTypeName();
        typeNameList.add(elem);
      }
      if (typeNameList.size() == 0) {
        throw new IllegalArgumentException("Invalid JNI signature '" + signature + "'");
      }
    }
    return typeNameList;
  }
  
  private String nextSignature()
  {
    char key = signature.charAt(currentIndex++);
    switch (key)
    {
    case '[': 
      return key + nextSignature();
    case 'L': 
      int endClass = signature.indexOf(';', currentIndex);
      
      String retVal = signature.substring(currentIndex - 1, endClass + 1);
      
      currentIndex = (endClass + 1);
      return retVal;
    case 'B': 
    case 'C': 
    case 'D': 
    case 'F': 
    case 'I': 
    case 'J': 
    case 'S': 
    case 'V': 
    case 'Z': 
      return String.valueOf(key);
    case '(': 
    case ')': 
      return nextSignature();
    }
    throw new IllegalArgumentException("Invalid JNI signature character '" + key + "'");
  }
  
  private String nextTypeName()
  {
    char key = signature.charAt(currentIndex++);
    switch (key)
    {
    case '[': 
      return nextTypeName() + "[]";
    case 'B': 
      return "byte";
    case 'C': 
      return "char";
    case 'L': 
      int endClass = signature.indexOf(';', currentIndex);
      
      String retVal = signature.substring(currentIndex, endClass);
      
      retVal = retVal.replace('/', '.');
      currentIndex = (endClass + 1);
      return retVal;
    case 'F': 
      return "float";
    case 'D': 
      return "double";
    case 'I': 
      return "int";
    case 'J': 
      return "long";
    case 'S': 
      return "short";
    case 'V': 
      return "void";
    case 'Z': 
      return "boolean";
    case '(': 
    case ')': 
      return nextTypeName();
    }
    throw new IllegalArgumentException("Invalid JNI signature character '" + key + "'");
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.jdi.JNITypeParser
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.jdi;

public abstract interface JVMTIThreadState
{
  public static final int JVMTI_THREAD_STATE_ALIVE = 1;
  public static final int JVMTI_THREAD_STATE_TERMINATED = 2;
  public static final int JVMTI_THREAD_STATE_RUNNABLE = 4;
  public static final int JVMTI_THREAD_STATE_WAITING = 8;
  public static final int JVMTI_THREAD_STATE_WAITING_INDEFINITELY = 16;
  public static final int JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT = 32;
  public static final int JVMTI_THREAD_STATE_SLEEPING = 64;
  public static final int JVMTI_THREAD_STATE_WAITING_FOR_NOTIFICATION = 128;
  public static final int JVMTI_THREAD_STATE_IN_OBJECT_WAIT = 256;
  public static final int JVMTI_THREAD_STATE_PARKED = 512;
  public static final int JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER = 1024;
  public static final int JVMTI_THREAD_STATE_SUSPENDED = 1048576;
  public static final int JVMTI_THREAD_STATE_INTERRUPTED = 2097152;
  public static final int JVMTI_THREAD_STATE_IN_NATIVE = 4194304;
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.jdi.JVMTIThreadState
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.jdi;

import com.sun.jdi.AbsentInformationException;

abstract interface LineInfo
{
  public abstract String liStratum();
  
  public abstract int liLineNumber();
  
  public abstract String liSourceName()
    throws AbsentInformationException;
  
  public abstract String liSourcePath()
    throws AbsentInformationException;
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.jdi.LineInfo
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.jdi;

import com.sun.jdi.AbsentInformationException;
import com.sun.jdi.ClassNotLoadedException;
import com.sun.jdi.InternalException;
import com.sun.jdi.LocalVariable;
import com.sun.jdi.Location;
import com.sun.jdi.Method;
import com.sun.jdi.StackFrame;
import com.sun.jdi.Type;
import com.sun.jdi.VirtualMachine;

public class LocalVariableImpl
  extends MirrorImpl
  implements LocalVariable, ValueContainer
{
  private final Method method;
  private final int slot;
  private final Location scopeStart;
  private final Location scopeEnd;
  private final String name;
  private final String signature;
  private final String genericSignature;
  
  LocalVariableImpl(VirtualMachine vm, Method method, int slot, Location scopeStart, Location scopeEnd, String name, String signature, String genericSignature)
  {
    super(vm);
    this.method = method;
    this.slot = slot;
    this.scopeStart = scopeStart;
    this.scopeEnd = scopeEnd;
    this.name = name;
    this.signature = signature;
    this.genericSignature = genericSignature;
  }
  
  public boolean equals(Object obj)
  {
    if ((obj != null) && ((obj instanceof LocalVariableImpl)))
    {
      LocalVariableImpl other = (LocalVariableImpl)obj;
      return (method.equals(method)) && (slot() == other.slot()) && (super.equals(obj));
    }
    return false;
  }
  
  public int hashCode()
  {
    return method.hashCode() + slot();
  }
  
  public int compareTo(Object object)
  {
    LocalVariableImpl other = (LocalVariableImpl)object;
    int rc = method.compareTo(method);
    if (rc == 0) {
      rc = slot() - other.slot();
    }
    return rc;
  }
  
  public String name()
  {
    return name;
  }
  
  public String typeName()
  {
    JNITypeParser parser = new JNITypeParser(signature);
    return parser.typeName();
  }
  
  public Type type()
    throws ClassNotLoadedException
  {
    return findType(signature());
  }
  
  public Type findType(String signature)
    throws ClassNotLoadedException
  {
    ReferenceTypeImpl enclosing = (ReferenceTypeImpl)method.declaringType();
    return enclosing.findType(signature);
  }
  
  public String signature()
  {
    return signature;
  }
  
  public String genericSignature()
  {
    return genericSignature;
  }
  
  public boolean isVisible(StackFrame frame)
  {
    Method frameMethod = frame.location().method();
    if (!frameMethod.equals(method)) {
      throw new IllegalArgumentException("frame method different than variable's method");
    }
    if (frameMethod.isNative()) {
      return false;
    }
    return (scopeStart.compareTo(frame.location()) <= 0) && (scopeEnd.compareTo(frame.location()) >= 0);
  }
  
  public boolean isArgument()
  {
    try
    {
      MethodImpl method = (MethodImpl)scopeStart.method();
      return slot < method.argSlotCount();
    }
    catch (AbsentInformationException e)
    {
      throw ((InternalException)new InternalException().initCause(e));
    }
  }
  
  int slot()
  {
    return slot;
  }
  
  boolean hides(LocalVariable other)
  {
    LocalVariableImpl otherImpl = (LocalVariableImpl)other;
    if ((!method.equals(method)) || (!name.equals(name))) {
      return false;
    }
    return scopeStart.compareTo(scopeStart) > 0;
  }
  
  public String toString()
  {
    return name() + " in " + method.toString() + "@" + scopeStart.toString();
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.jdi.LocalVariableImpl
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.jdi;

import com.sun.jdi.AbsentInformationException;
import com.sun.jdi.Location;
import com.sun.jdi.ReferenceType;
import com.sun.jdi.VirtualMachine;

public class LocationImpl
  extends MirrorImpl
  implements Location
{
  private final ReferenceTypeImpl declaringType;
  private com.sun.jdi.Method method;
  private sun.jvm.hotspot.oops.Method methodRef;
  private long codeIndex;
  private LineInfo baseLineInfo = null;
  private LineInfo otherLineInfo = null;
  
  LocationImpl(VirtualMachine vm, com.sun.jdi.Method method, long codeIndex)
  {
    super(vm);
    
    this.method = method;
    this.codeIndex = (method.isNative() ? -1L : codeIndex);
    declaringType = ((ReferenceTypeImpl)method.declaringType());
  }
  
  LocationImpl(VirtualMachine vm, ReferenceType declaringType, sun.jvm.hotspot.oops.Method methodRef, long codeIndex)
  {
    super(vm);
    
    method = null;
    this.codeIndex = codeIndex;
    this.declaringType = ((ReferenceTypeImpl)declaringType);
    this.methodRef = methodRef;
  }
  
  public boolean equals(Object obj)
  {
    if ((obj != null) && ((obj instanceof Location)))
    {
      Location other = (Location)obj;
      return (method().equals(other.method())) && (codeIndex() == other.codeIndex()) && (super.equals(obj));
    }
    return false;
  }
  
  public int hashCode()
  {
    return method().hashCode() + (int)codeIndex();
  }
  
  public int compareTo(Object object)
  {
    LocationImpl other = (LocationImpl)object;
    int rc = method().compareTo(other.method());
    if (rc == 0)
    {
      long diff = codeIndex() - other.codeIndex();
      if (diff < 0L) {
        return -1;
      }
      if (diff > 0L) {
        return 1;
      }
      return 0;
    }
    return rc;
  }
  
  public ReferenceType declaringType()
  {
    return declaringType;
  }
  
  public com.sun.jdi.Method method()
  {
    if (method == null)
    {
      method = declaringType.getMethodMirror(methodRef);
      if (method.isNative()) {
        codeIndex = -1L;
      }
    }
    return method;
  }
  
  public long codeIndex()
  {
    method();
    return codeIndex;
  }
  
  LineInfo getBaseLineInfo(SDE.Stratum stratum)
  {
    if (baseLineInfo != null) {
      return baseLineInfo;
    }
    MethodImpl methodImpl = (MethodImpl)method();
    LineInfo lineInfo = methodImpl.codeIndexToLineInfo(stratum, codeIndex());
    
    addBaseLineInfo(lineInfo);
    
    return lineInfo;
  }
  
  LineInfo getLineInfo(SDE.Stratum stratum)
  {
    if (stratum.isJava()) {
      return getBaseLineInfo(stratum);
    }
    LineInfo lineInfo = otherLineInfo;
    if ((lineInfo != null) && (stratum.id().equals(lineInfo.liStratum()))) {
      return lineInfo;
    }
    int baseLineNumber = lineNumber("Java");
    SDE.LineStratum lineStratum = stratum.lineStratum(declaringType, baseLineNumber);
    if ((lineStratum != null) && (lineStratum.lineNumber() != -1))
    {
      lineInfo = new StratumLineInfo(stratum.id(), lineStratum.lineNumber(), lineStratum.sourceName(), lineStratum.sourcePath());
    }
    else
    {
      MethodImpl methodImpl = (MethodImpl)method();
      lineInfo = methodImpl.codeIndexToLineInfo(stratum, codeIndex());
    }
    addStratumLineInfo(lineInfo);
    
    return lineInfo;
  }
  
  void addStratumLineInfo(LineInfo lineInfo)
  {
    otherLineInfo = lineInfo;
  }
  
  void addBaseLineInfo(LineInfo lineInfo)
  {
    baseLineInfo = lineInfo;
  }
  
  public String sourceName()
    throws AbsentInformationException
  {
    return sourceName(vm.getDefaultStratum());
  }
  
  public String sourceName(String stratumID)
    throws AbsentInformationException
  {
    return sourceName(declaringType.stratum(stratumID));
  }
  
  String sourceName(SDE.Stratum stratum)
    throws AbsentInformationException
  {
    return getLineInfo(stratum).liSourceName();
  }
  
  public String sourcePath()
    throws AbsentInformationException
  {
    return sourcePath(vm.getDefaultStratum());
  }
  
  public String sourcePath(String stratumID)
    throws AbsentInformationException
  {
    return sourcePath(declaringType.stratum(stratumID));
  }
  
  String sourcePath(SDE.Stratum stratum)
    throws AbsentInformationException
  {
    return getLineInfo(stratum).liSourcePath();
  }
  
  public int lineNumber()
  {
    return lineNumber(vm.getDefaultStratum());
  }
  
  public int lineNumber(String stratumID)
  {
    return lineNumber(declaringType.stratum(stratumID));
  }
  
  int lineNumber(SDE.Stratum stratum)
  {
    return getLineInfo(stratum).liLineNumber();
  }
  
  public String toString()
  {
    if (lineNumber() == -1) {
      return method().toString() + "+" + codeIndex();
    }
    return declaringType().name() + ":" + lineNumber();
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.jdi.LocationImpl
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.jdi;

import com.sun.jdi.InvalidTypeException;
import com.sun.jdi.LongType;
import com.sun.jdi.PrimitiveValue;
import com.sun.jdi.VirtualMachine;

public class LongTypeImpl
  extends PrimitiveTypeImpl
  implements LongType
{
  LongTypeImpl(VirtualMachine vm)
  {
    super(vm);
  }
  
  public String signature()
  {
    return "J";
  }
  
  PrimitiveValue convert(PrimitiveValue value)
    throws InvalidTypeException
  {
    return vm.mirrorOf(((PrimitiveValueImpl)value).checkedLongValue());
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.jdi.LongTypeImpl
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.jdi;

import com.sun.jdi.InvalidTypeException;
import com.sun.jdi.LongValue;
import com.sun.jdi.Type;
import com.sun.jdi.VirtualMachine;

public class LongValueImpl
  extends PrimitiveValueImpl
  implements LongValue
{
  private long value;
  
  LongValueImpl(VirtualMachine aVm, long aValue)
  {
    super(aVm);
    
    value = aValue;
  }
  
  public boolean equals(Object obj)
  {
    if ((obj != null) && ((obj instanceof LongValue))) {
      return (value == ((LongValue)obj).value()) && (super.equals(obj));
    }
    return false;
  }
  
  public int hashCode()
  {
    return intValue();
  }
  
  public int compareTo(Object obj)
  {
    long other = ((LongValue)obj).value();
    if (value() < other) {
      return -1;
    }
    if (value() == other) {
      return 0;
    }
    return 1;
  }
  
  public Type type()
  {
    return vm.theLongType();
  }
  
  public long value()
  {
    return value;
  }
  
  public boolean booleanValue()
  {
    return value != 0L;
  }
  
  public byte byteValue()
  {
    return (byte)(int
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2019. Infinite Loop Ltd