emma

 = " + m_class_index + ", name_and_type_index = " + m_name_and_type_index + ']';
  }
  
  protected CONSTANT_Methodref_info(UDataInputStream bytes)
    throws IOException
  {
    super(bytes);
  }
}

/* Location:
 * Qualified Name:     com.vladium.jcd.cls.constant.CONSTANT_Methodref_info
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.cls.constant;

import com.vladium.jcd.cls.ClassDef;
import com.vladium.jcd.cls.IConstantCollection;
import com.vladium.jcd.lib.UDataInputStream;
import com.vladium.jcd.lib.UDataOutputStream;
import java.io.IOException;

public final class CONSTANT_NameAndType_info
  extends CONSTANT_info
{
  public static final byte TAG = 12;
  public int m_name_index;
  public int m_descriptor_index;
  
  public CONSTANT_NameAndType_info(int name_index, int descriptor_index)
  {
    m_name_index = name_index;
    m_descriptor_index = descriptor_index;
  }
  
  public final byte tag()
  {
    return 12;
  }
  
  public String getName(ClassDef cls)
  {
    return getConstantsgetm_name_index)).m_value;
  }
  
  public String getDescriptor(ClassDef cls)
  {
    return getConstantsgetm_descriptor_index)).m_value;
  }
  
  public Object accept(ICONSTANTVisitor visitor, Object ctx)
  {
    return visitor.visit(this, ctx);
  }
  
  public String toString()
  {
    return "CONSTANT_NameAndType: [name_index = " + m_name_index + ", descriptor_index = " + m_descriptor_index + ']';
  }
  
  public void writeInClassFormat(UDataOutputStream out)
    throws IOException
  {
    super.writeInClassFormat(out);
    
    out.writeU2(m_name_index);
    out.writeU2(m_descriptor_index);
  }
  
  protected CONSTANT_NameAndType_info(UDataInputStream bytes)
    throws IOException
  {
    m_name_index = bytes.readU2();
    m_descriptor_index = bytes.readU2();
  }
}

/* Location:
 * Qualified Name:     com.vladium.jcd.cls.constant.CONSTANT_NameAndType_info
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.cls.constant;

import com.vladium.jcd.lib.UDataInputStream;
import com.vladium.jcd.lib.UDataOutputStream;
import java.io.IOException;

public final class CONSTANT_String_info
  extends CONSTANT_literal_info
{
  public static final byte TAG = 8;
  public int m_string_index;
  
  public CONSTANT_String_info(int string_index)
  {
    m_string_index = string_index;
  }
  
  public final byte tag()
  {
    return 8;
  }
  
  public Object accept(ICONSTANTVisitor visitor, Object ctx)
  {
    return visitor.visit(this, ctx);
  }
  
  public String toString()
  {
    return "CONSTANT_String: [string_index = " + m_string_index + ']';
  }
  
  public void writeInClassFormat(UDataOutputStream out)
    throws IOException
  {
    super.writeInClassFormat(out);
    
    out.writeU2(m_string_index);
  }
  
  protected CONSTANT_String_info(UDataInputStream bytes)
    throws IOException
  {
    m_string_index = bytes.readU2();
  }
}

/* Location:
 * Qualified Name:     com.vladium.jcd.cls.constant.CONSTANT_String_info
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.cls.constant;

import com.vladium.jcd.lib.UDataInputStream;
import com.vladium.jcd.lib.UDataOutputStream;
import java.io.IOException;

public final class CONSTANT_Utf8_info
  extends CONSTANT_info
{
  public static final byte TAG = 1;
  public String m_value;
  
  public CONSTANT_Utf8_info(String value)
  {
    m_value = value;
  }
  
  public final byte tag()
  {
    return 1;
  }
  
  public Object accept(ICONSTANTVisitor visitor, Object ctx)
  {
    return visitor.visit(this, ctx);
  }
  
  public String toString()
  {
    return "CONSTANT_Utf8: [" + m_value + ']';
  }
  
  public void writeInClassFormat(UDataOutputStream out)
    throws IOException
  {
    super.writeInClassFormat(out);
    
    out.writeUTF(m_value);
  }
  
  protected CONSTANT_Utf8_info(UDataInputStream bytes)
    throws IOException
  {
    m_value = bytes.readUTF();
  }
}

/* Location:
 * Qualified Name:     com.vladium.jcd.cls.constant.CONSTANT_Utf8_info
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.cls.constant;

import com.vladium.jcd.compiler.IClassFormatOutput;
import com.vladium.jcd.lib.UDataInputStream;
import com.vladium.jcd.lib.UDataOutputStream;
import java.io.IOException;

public abstract class CONSTANT_info
  implements Cloneable, IClassFormatOutput
{
  public abstract byte tag();
  
  public abstract Object accept(ICONSTANTVisitor paramICONSTANTVisitor, Object paramObject);
  
  public abstract String toString();
  
  public int width()
  {
    return 1;
  }
  
  public static CONSTANT_info new_CONSTANT_info(UDataInputStream bytes)
    throws IOException
  {
    byte tag = bytes.readByte();
    switch (tag)
    {
    case 1: 
      return new CONSTANT_Utf8_info(bytes);
    case 3: 
      return new CONSTANT_Integer_info(bytes);
    case 4: 
      return new CONSTANT_Float_info(bytes);
    case 5: 
      return new CONSTANT_Long_info(bytes);
    case 6: 
      return new CONSTANT_Double_info(bytes);
    case 7: 
      return new CONSTANT_Class_info(bytes);
    case 8: 
      return new CONSTANT_String_info(bytes);
    case 9: 
      return new CONSTANT_Fieldref_info(bytes);
    case 10: 
      return new CONSTANT_Methodref_info(bytes);
    case 11: 
      return new CONSTANT_InterfaceMethodref_info(bytes);
    case 12: 
      return new CONSTANT_NameAndType_info(bytes);
    }
    throw new IllegalStateException("CONSTANT_info: invalid tag value [" + tag + ']');
  }
  
  public Object clone()
  {
    try
    {
      return super.clone();
    }
    catch (CloneNotSupportedException e)
    {
      throw new InternalError(e.toString());
    }
  }
  
  public void writeInClassFormat(UDataOutputStream out)
    throws IOException
  {
    out.writeByte(tag());
  }
  
  public static String tagToString(CONSTANT_info constant)
  {
    switch (constant.tag())
    {
    case 1: 
      return "CONSTANT_Utf8";
    case 3: 
      return "CONSTANT_Integer";
    case 4: 
      return "CONSTANT_Float";
    case 5: 
      return "CONSTANT_Long";
    case 6: 
      return "CONSTANT_Double";
    case 7: 
      return "CONSTANT_Class";
    case 8: 
      return "CONSTANT_String";
    case 9: 
      return "CONSTANT_Fieldref";
    case 10: 
      return "CONSTANT_Methodref";
    case 11: 
      return "CONSTANT_InterfaceMethodref";
    case 12: 
      return "CONSTANT_NameAndType";
    }
    throw new IllegalStateException("CONSTANT_info: invalid tag value [" + constant.tag() + ']');
  }
}

/* Location:
 * Qualified Name:     com.vladium.jcd.cls.constant.CONSTANT_info
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.cls.constant;

public abstract class CONSTANT_literal_info
  extends CONSTANT_info
{}

/* Location:
 * Qualified Name:     com.vladium.jcd.cls.constant.CONSTANT_literal_info
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.cls.constant;

import com.vladium.jcd.lib.UDataInputStream;
import com.vladium.jcd.lib.UDataOutputStream;
import java.io.IOException;

public abstract class CONSTANT_ref_info
  extends CONSTANT_info
{
  public int m_class_index;
  public int m_name_and_type_index;
  
  public void writeInClassFormat(UDataOutputStream out)
    throws IOException
  {
    super.writeInClassFormat(out);
    
    out.writeU2(m_class_index);
    out.writeU2(m_name_and_type_index);
  }
  
  protected CONSTANT_ref_info(UDataInputStream bytes)
    throws IOException
  {
    m_class_index = bytes.readU2();
    m_name_and_type_index = bytes.readU2();
  }
  
  protected CONSTANT_ref_info(int class_index, int name_and_type_index)
  {
    m_class_index = class_index;
    m_name_and_type_index = name_and_type_index;
  }
}

/* Location:
 * Qualified Name:     com.vladium.jcd.cls.constant.CONSTANT_ref_info
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.cls.constant;

public abstract interface ICONSTANTVisitor
{
  public abstract Object visit(CONSTANT_Class_info paramCONSTANT_Class_info, Object paramObject);
  
  public abstract Object visit(CONSTANT_InterfaceMethodref_info paramCONSTANT_InterfaceMethodref_info, Object paramObject);
  
  public abstract Object visit(CONSTANT_Methodref_info paramCONSTANT_Methodref_info, Object paramObject);
  
  public abstract Object visit(CONSTANT_Fieldref_info paramCONSTANT_Fieldref_info, Object paramObject);
  
  public abstract Object visit(CONSTANT_Double_info paramCONSTANT_Double_info, Object paramObject);
  
  public abstract Object visit(CONSTANT_Float_info paramCONSTANT_Float_info, Object paramObject);
  
  public abstract Object visit(CONSTANT_Integer_info paramCONSTANT_Integer_info, Object paramObject);
  
  public abstract Object visit(CONSTANT_Long_info paramCONSTANT_Long_info, Object paramObject);
  
  public abstract Object visit(CONSTANT_String_info paramCONSTANT_String_info, Object paramObject);
  
  public abstract Object visit(CONSTANT_Utf8_info paramCONSTANT_Utf8_info, Object paramObject);
  
  public abstract Object visit(CONSTANT_NameAndType_info paramCONSTANT_NameAndType_info, Object paramObject);
}

/* Location:
 * Qualified Name:     com.vladium.jcd.cls.constant.ICONSTANTVisitor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.compiler;

import com.vladium.jcd.cls.ClassDef;
import com.vladium.jcd.lib.UDataOutputStream;
import java.io.IOException;
import java.io.OutputStream;

public abstract class ClassWriter
{
  public static void writeClassTable(ClassDef classTable, OutputStream out)
    throws IOException
  {
    classTable.writeInClassFormat(new UDataOutputStream(out));
  }
}

/* Location:
 * Qualified Name:     com.vladium.jcd.compiler.ClassWriter
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.compiler;

import com.vladium.jcd.cls.ClassDef;
import com.vladium.jcd.cls.IConstantCollection;
import com.vladium.jcd.cls.constant.CONSTANT_Integer_info;
import com.vladium.jcd.opcodes.IOpcodes;
import com.vladium.util.ByteArrayOStream;

public abstract class CodeGen
  implements IOpcodes
{
  public static void load_local_object_var(ByteArrayOStream out, int index)
  {
    if (index <= 3) {
      out.write(42 + index);
    } else if (index <= 255) {
      out.write2(25, index);
    } else {
      out.write4(196, 25, index >>> 8, index);
    }
  }
  
  public static void store_local_object_var(ByteArrayOStream out, int index)
  {
    if (index <= 3) {
      out.write(75 + index);
    } else if (index <= 255) {
      out.write2(58, index);
    } else {
      out.write4(196, 58, index >>> 8, index);
    }
  }
  
  public static void push_int_value(ByteArrayOStream out, ClassDef cls, int value)
  {
    if ((-1 <= value) && (value <= 5))
    {
      out.write(3 + value);
    }
    else if ((-128 <= value) && (value <= 127))
    {
      out.write2(16, value);
    }
    else if ((32768 <= value) && (value <= 32767))
    {
      out.write3(17, value >>> 8, value);
    }
    else
    {
      int index = cls.getConstants().add(new CONSTANT_Integer_info(value));
      if (index <= 255) {
        out.write2(18, index);
      } else {
        out.write3(19, index >>> 8, index);
      }
    }
  }
  
  public static void push_constant_index(ByteArrayOStream out, int index)
  {
    if (index <= 255) {
      out.write2(18, index);
    } else {
      out.write3(19, index >>> 8, index);
    }
  }
}

/* Location:
 * Qualified Name:     com.vladium.jcd.compiler.CodeGen
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.compiler;

import com.vladium.jcd.lib.UDataOutputStream;
import java.io.IOException;

public abstract interface IClassFormatOutput
{
  public abstract void writeInClassFormat(UDataOutputStream paramUDataOutputStream)
    throws IOException;
}

/* Location:
 * Qualified Name:     com.vladium.jcd.compiler.IClassFormatOutput
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.lib;

class Types$1 {}

/* Location:
 * Qualified Name:     com.vladium.jcd.lib.Types.1
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.lib;

import java.io.IOException;
import java.io.PushbackReader;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.List;

class Types$methodDescriptorCompiler
{
  Types$methodDescriptorCompiler(String methoddescriptor)
  {
    m_in = new PushbackReader(new StringReader(methoddescriptor));
  }
  
  String[] getResult()
  {
    String[] result = new String[m_result.size()];
    m_result.toArray(result);
    
    return result;
  }
  
  void methodDescriptor()
    throws IOException
  {
    consume('(');
    char c;
    while ((c = (char)m_in.read()) != ')')
    {
      m_in.unread(c);
      parameterDescriptor();
    }
    returnDescriptor();
  }
  
  void parameterDescriptor()
    throws IOException
  {
    fieldType();
    newToken();
  }
  
  void returnDescriptor()
    throws IOException
  {
    char c = (char)m_in.read();
    switch (c)
    {
    case 'V': 
      m_token.append(c);
      break;
    default: 
      m_in.unread(c);
      fieldType();
    }
  }
  
  void componentType()
    throws IOException
  {
    fieldType();
  }
  
  void objectType()
    throws IOException
  {
    consume('L');
    m_token.append('L');
    char c;
    while ((c = (char)m_in.read()) != ';') {
      m_token.append(c);
    }
    m_token.append(';');
  }
  
  void arrayType()
    throws IOException
  {
    consume('[');
    m_token.append('[');
    
    componentType();
  }
  
  void fieldType()
    throws IOException
  {
    char c = (char)m_in.read();
    m_in.unread(c);
    switch (c)
    {
    case 'L': 
      objectType();
      break;
    case '[': 
      arrayType();
      break;
    default: 
      baseType();
    }
  }
  
  void baseType()
    throws IOException
  {
    char c = (char)m_in.read();
    switch (c)
    {
    case 'B': 
    case 'C': 
    case 'D': 
    case 'F': 
    case 'I': 
    case 'J': 
    case 'S': 
    case 'Z': 
      m_token.append(c);
      break;
    case 'E': 
    case 'G': 
    case 'H': 
    case 'K': 
    case 'L': 
    case 'M': 
    case 'N': 
    case 'O': 
    case 'P': 
    case 'Q': 
    case 'R': 
    case 'T': 
    case 'U': 
    case 'V': 
    case 'W': 
    case 'X': 
    case 'Y': 
    default: 
      throw new IllegalArgumentException("unknown base type: " + c);
    }
  }
  
  private void consume(char expected)
    throws IOException
  {
    char c = (char)m_in.read();
    if (c != expected) {
      throw new IllegalArgumentException("consumed '" + c + "' while expecting '" + expected + "'");
    }
  }
  
  private void newToken()
  {
    m_result.add(m_token.toString());
    m_token.setLength(0);
  }
  
  final List m_result = new ArrayList();
  private StringBuffer m_token = new StringBuffer();
  private PushbackReader m_in;
}

/* Location:
 * Qualified Name:     com.vladium.jcd.lib.Types.methodDescriptorCompiler
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.lib;

final class Types$signatureCompiler
{
  Types$signatureCompiler(Types.1 x0)
  {
    this();
  }
  
  String signatureDescriptor(Class[] _parameterTypes, Class _returnType)
  {
    emit('(');parameterTypes(_parameterTypes);emit(')');returnType(_returnType);
    
    return m_desc.toString();
  }
  
  String typeDescriptor(Class type)
  {
    parameterType(type);
    
    return m_desc.toString();
  }
  
  private void parameterTypes(Class[] _parameterTypes)
  {
    if (_parameterTypes != null) {
      for (int p = 0; p < _parameterTypes.length; p++) {
        parameterType(_parameterTypes[p]);
      }
    }
  }
  
  private void returnType(Class _returnType)
  {
    if ((_returnType == null) || (_returnType == Void.TYPE)) {
      emit('V');
    } else {
      parameterType(_returnType);
    }
  }
  
  private void parameterType(Class _parameterType)
  {
    if (_parameterType != null) {
      if (_parameterType.isPrimitive())
      {
        if (Byte.TYPE == _parameterType) {
          emit('B');
        } else if (Character.TYPE == _parameterType) {
          emit('C');
        } else if (Double.TYPE == _parameterType) {
          emit('D');
        } else if (Float.TYPE == _parameterType) {
          emit('F');
        } else if (Integer.TYPE == _parameterType) {
          emit('I');
        } else if (Long.TYPE == _parameterType) {
          emit('J');
        } else if (Short.TYPE == _parameterType) {
          emit('S');
        } else if (Boolean.TYPE == _parameterType) {
          emit('Z');
        }
      }
      else if (_parameterType.isArray())
      {
        emit('[');parameterType(_parameterType.getComponentType());
      }
      else
      {
        emit('L');emit(Types.javaNameToVMName(_parameterType.getName()));emit(';');
      }
    }
  }
  
  private void emit(String s)
  {
    m_desc.append(s);
  }
  
  private void emit(char c)
  {
    m_desc.append(c);
  }
  
  private StringBuffer m_desc = new StringBuffer();
  
  private Types$signatureCompiler() {}
}

/* Location:
 * Qualified Name:     com.vladium.jcd.lib.Types.signatureCompiler
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.lib;

import java.lang.reflect.Array;

class Types$typeDescriptorCompiler
{
  Types$typeDescriptorCompiler(Types.1 x0)
  {
    this();
  }
  
  Class descriptorToClass(String typedescriptor)
    throws ClassNotFoundException
  {
    char first = typedescriptor.charAt(0);
    if (first == '[') {
      return arrayOf(typedescriptor.substring(1));
    }
    if (first == 'L') {
      return Class.forName(Types.vmNameToJavaName(typedescriptor.substring(1, typedescriptor.length() - 1)));
    }
    return primitive(first);
  }
  
  Class arrayOf(String typedescriptor)
    throws ClassNotFoundException
  {
    char first = typedescriptor.charAt(0);
    Class component;
    Class component;
    if (first == '[')
    {
      component = arrayOf(typedescriptor.substring(1));
    }
    else
    {
      Class component;
      if (first == 'L') {
        component = Class.forName(Types.vmNameToJavaName(typedescriptor.substring(1, typedescriptor.length() - 1)));
      } else {
        component = primitive(first);
      }
    }
    Object array = Array.newInstance(component, 0);
    return array.getClass();
  }
  
  Class primitive(char c)
    throws ClassNotFoundException
  {
    if (c == 'B') {
      return Byte.TYPE;
    }
    if (c == 'C') {
      return Character.TYPE;
    }
    if (c == 'D') {
      return Double.TYPE;
    }
    if (c == 'F') {
      return Float.TYPE;
    }
    if (c == 'I') {
      return Integer.TYPE;
    }
    if (c == 'J') {
      return Long.TYPE;
    }
    if (c == 'S') {
      return Short.TYPE;
    }
    if (c == 'Z') {
      return Boolean.TYPE;
    }
    throw new ClassNotFoundException("unknown base type: " + c);
  }
  
  private Types$typeDescriptorCompiler() {}
}

/* Location:
 * Qualified Name:     com.vladium.jcd.lib.Types.typeDescriptorCompiler
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.lib;

class Types$typeDescriptorCompiler2
{
  Types$typeDescriptorCompiler2(Types.1 x0)
  {
    this();
  }
  
  String descriptorToClass(String typedescriptor)
  {
    char first = typedescriptor.charAt(0);
    if (first == '[') {
      return arrayOf(typedescriptor.substring(1));
    }
    if (first == 'L') {
      return Types.vmNameToJavaName(typedescriptor.substring(1, typedescriptor.length() - 1));
    }
    return primitive(first);
  }
  
  String arrayOf(String typedescriptor)
  {
    char first = typedescriptor.charAt(0);
    String component;
    String component;
    if (first == '[')
    {
      component = arrayOf(typedescriptor.substring(1));
    }
    else
    {
      String component;
      if (first == 'L') {
        component = Types.vmNameToJavaName(typedescriptor.substring(1, typedescriptor.length() - 1));
      } else {
        component = primitive(first);
      }
    }
    String array = component + " []";
    return array;
  }
  
  String primitive(char c)
  {
    switch (c)
    {
    case 'B': 
      return "byte";
    case 'C': 
      return "char";
    case 'D': 
      return "double";
    case 'F': 
      return "float";
    case 'I': 
      return "int";
    case 'J': 
      return "long";
    case 'S': 
      return "short";
    case 'Z': 
      return "boolean";
    }
    throw new IllegalArgumentException("unknown primitive: " + c);
  }
  
  private Types$typeDescriptorCompiler2() {}
}

/* Location:
 * Qualified Name:     com.vladium.jcd.lib.Types.typeDescriptorCompiler2
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.lib;

import com.vladium.jcd.cls.IAccessFlags;
import java.io.IOException;
import java.io.PushbackReader;
import java.io.StringReader;
import java.lang.reflect.Array;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;

public abstract class Types
{
  public static String getClassPackageName(Class c)
  {
    String className = c.getName();
    int lastDot = className.lastIndexOf('.');
    return lastDot >= 0 ? className.substring(0, lastDot) : "";
  }
  
  public static String accessFlagsToString(int flags, boolean isClass)
  {
    StringBuffer result = new StringBuffer();
    
    boolean first = true;
    if (isClass) {
      for (int f = 0; f < IAccessFlags.ALL_ACC.length; f++)
      {
        int bit = IAccessFlags.ALL_ACC[f];
        if ((flags & bit) != 0)
        {
          if (first) {
            first = false;
          } else {
            result.append(" ");
          }
          if (bit == 32) {
            result.append("super");
          } else {
            result.append(IAccessFlags.ALL_ACC_NAMES[f]);
          }
        }
      }
    } else {
      for (int f = 0; f < IAccessFlags.ALL_ACC.length; f++)
      {
        int bit = IAccessFlags.ALL_ACC[f];
        if ((flags & bit) != 0)
        {
          if (first) {
            first = false;
          } else {
            result.append(" ");
          }
          result.append(IAccessFlags.ALL_ACC_NAMES[f]);
        }
      }
    }
    return result.toString();
  }
  
  public static String javaNameToVMName(String javaName)
  {
    if (javaName == null) {
      return null;
    }
    return javaName.replace('.', '/');
  }
  
  public static String vmNameToJavaName(String vmName)
  {
    if (vmName == null) {
      return null;
    }
    return vmName.replace('/', '.');
  }
  
  public static String signatureToDescriptor(Method method)
  {
    if (method == null) {
      throw new IllegalArgumentException("null input: method");
    }
    return signatureToDescriptor(method.getParameterTypes(), method.getReturnType());
  }
  
  public static String signatureToDescriptor(Class[] parameterTypes, Class returnType)
  {
    return new signatureCompiler(null).signatureDescriptor(parameterTypes, returnType);
  }
  
  public static String typeToDescriptor(Class type)
  {
    return new signatureCompiler(null).typeDescriptor(type);
  }
  
  public static Class descriptorToType(String typedescriptor)
    throws ClassNotFoundException
  {
    return new typeDescriptorCompiler(null).descriptorToClass(typedescriptor);
  }
  
  public static String descriptorToReturnType(String methoddescriptor)
  {
    int i1 = methoddescriptor.indexOf('(');
    int i2 = methoddescriptor.lastIndexOf(')');
    if ((i1 < 0) || (i2 <= 0) || (i1 >= i2) || (i2 >= methoddescriptor.length() - 1)) {
      throw new IllegalArgumentException("malformed method descriptor: [" + methoddescriptor + "]");
    }
    return methoddescriptor.substring(i2 + 1);
  }
  
  public static String[] descriptorToParameterTypes(String methoddescriptor)
  {
    try
    {
      methodDescriptorCompiler compiler = new methodDescriptorCompiler(methoddescriptor);
      compiler.methodDescriptor();
      return compiler.getResult();
    }
    catch (IOException e)
    {
      throw new IllegalArgumentException("error parsing [" + methoddescriptor + "]: " + e.toString());
    }
  }
  
  public static String signatureToMethodDescriptor(String[] parameterTypeDescriptors, String returnTypeDescriptor)
  {
    StringBuffer result = new StringBuffer("(");
    for (int p = 0; p < parameterTypeDescriptors.length; p++) {
      result.append(parameterTypeDescriptors[p]);
    }
    result.append(')');
    result.append(returnTypeDescriptor);
    
    return result.toString();
  }
  
  public static String typeDescriptorToUserName(String typedescriptor)
  {
    return new typeDescriptorCompiler2(null).descriptorToClass(typedescriptor);
  }
  
  public static String methodDescriptorToUserName(String methoddescriptor)
  {
    String[] parameterTypes = descriptorToParameterTypes(methoddescriptor);
    
    StringBuffer result = new StringBuffer("(");
    for (int p = 0; p < parameterTypes.length; p++)
    {
      if (p > 0) {
        result.append(", ");
      }
      String typeUserName = typeDescriptorToUserName(parameterTypes[p]);
      int lastDot = typeUserName.lastIndexOf('.');
      if ((lastDot < 0) || (!"java.lang.".equals(typeUserName.substring(0, lastDot + 1)))) {
        result.append(typeUserName);
      } else {
        result.append(typeUserName.substring(lastDot + 1));
      }
    }
    result.append(')');
    return result.toString();
  }
  
  public static String fullMethodDescriptorToUserName(String classJavaName, String methodName, String methoddescriptor)
  {
    if ("<init>".equals(methodName)) {
      methodName = simpleClassName(classJavaName);
    }
    if ("<clinit>".equals(methodName)) {
      methodName = "<static class initializer>";
    }
    return methodName + ' ' + methodDescriptorToUserName(methoddescriptor);
  }
  
  public static String fullMethodDescriptorToFullUserName(String classJavaName, String methodName, String methoddescriptor)
  {
    if ("<init>".equals(methodName)) {
      methodName = simpleClassName(classJavaName);
    }
    if ("<clinit>".equals(methodName)) {
      methodName = "<static class initializer>";
    }
    return classJavaName + '.' + methodName + ' ' + methodDescriptorToUserName(methoddescriptor);
  }
  
  private static String simpleClassName(String classJavaName)
  {
    int lastDot = classJavaName.lastIndexOf('.');
    if (lastDot < 0) {
      return classJavaName;
    }
    return classJavaName.substring(lastDot + 1);
  }
  
  private static final class signatureCompiler
  {
    signatureCompiler(Types.1 x0)
    {
      this();
    }
    
    String signatureDescriptor(Class[] _parameterTypes, Class _returnType)
    {
      emit('(');parameterTypes(_parameterTypes);emit(')');returnType(_returnType);
      
      return m_desc.toString();
    }
    
    String typeDescriptor(Class type)
    {
      parameterType(type);
      
      return m_desc.toString();
    }
    
    private void parameterTypes(Class[] _parameterTypes)
    {
      if (_parameterTypes != null) {
        for (int p = 0; p < _parameterTypes.length; p++) {
          parameterType(_parameterTypes[p]);
        }
      }
    }
    
    private void returnType(Class _returnType)
    {
      if ((_returnType == null) || (_returnType == Void.TYPE)) {
        emit('V');
      } else {
        parameterType(_returnType);
      }
    }
    
    private void parameterType(Class _parameterType)
    {
      if (_parameterType != null) {
        if (_parameterType.isPrimitive())
        {
          if (Byte.TYPE == _parameterType) {
            emit('B');
          } else if (Character.TYPE == _parameterType) {
            emit('C');
          } else if (Double.TYPE == _parameterType) {
            emit('D');
          } else if (Float.TYPE == _parameterType) {
            emit('F');
          } else if (Integer.TYPE == _parameterType) {
            emit('I');
          } else if (Long.TYPE == _parameterType) {
            emit('J');
          } else if (Short.TYPE == _parameterType) {
            emit('S');
          } else if (Boolean.TYPE == _parameterType) {
            emit('Z');
          }
        }
        else if (_parameterType.isArray())
        {
          emit('[');parameterType(_parameterType.getComponentType());
        }
        else
        {
          emit('L');emit(Types.javaNameToVMName(_parameterType.getName()));emit(';');
        }
      }
    }
    
    private void emit(String s)
    {
      m_desc.append(s);
    }
    
    private void emit(char c)
    {
      m_desc.append(c);
    }
    
    private StringBuffer m_desc = new StringBuffer();
    
    private signatureCompiler() {}
  }
  
  private static class typeDescriptorCompiler
  {
    typeDescriptorCompiler(Types.1 x0)
    {
      this();
    }
    
    Class descriptorToClass(String typedescriptor)
      throws ClassNotFoundException
    {
      char first = typedescriptor.charAt(0);
      if (first == '[') {
        return arrayOf(typedescriptor.substring(1));
      }
      if (first == 'L') {
        return Class.forName(Types.vmNameToJavaName(typedescriptor.substring(1, typedescriptor.length() - 1)));
      }
      return primitive(first);
    }
    
    Class arrayOf(String typedescriptor)
      throws ClassNotFoundException
    {
      char first = typedescriptor.charAt(0);
      Class component;
      Class component;
      if (first == '[')
      {
        component = arrayOf(typedescriptor.substring(1));
      }
      else
      {
        Class component;
        if (first == 'L') {
          component = Class.forName(Types.vmNameToJavaName(typedescriptor.substring(1, typedescriptor.length() - 1)));
        } else {
          component = primitive(first);
        }
      }
      Object array = Array.newInstance(component, 0);
      return array.getClass();
    }
    
    Class primitive(char c)
      throws ClassNotFoundException
    {
      if (c == 'B') {
        return Byte.TYPE;
      }
      if (c == 'C') {
        return Character.TYPE;
      }
      if (c == 'D') {
        return Double.TYPE;
      }
      if (c == 'F') {
        return Float.TYPE;
      }
      if (c == 'I') {
        return Integer.TYPE;
      }
      if (c == 'J') {
        return Long.TYPE;
      }
      if (c == 'S') {
        return Short.TYPE;
      }
      if (c == 'Z') {
        return Boolean.TYPE;
      }
      throw new ClassNotFoundException("unknown base type: " + c);
    }
    
    private typeDescriptorCompiler() {}
  }
  
  private static class typeDescriptorCompiler2
  {
    typeDescriptorCompiler2(Types.1 x0)
    {
      this();
    }
    
    String descriptorToClass(String typedescriptor)
    {
      char first = typedescriptor.charAt(0);
      if (first == '[') {
        return arrayOf(typedescriptor.substring(1));
      }
      if (first == 'L') {
        return Types.vmNameToJavaName(typedescriptor.substring(1, typedescriptor.length() - 1));
      }
      return primitive(first);
    }
    
    String arrayOf(String typedescriptor)
    {
      char first = typedescriptor.charAt(0);
      String component;
      String component;
      if (first == '[')
      {
        component = arrayOf(typedescriptor.substring(1));
      }
      else
      {
        String component;
        if (first == 'L') {
          component = Types.vmNameToJavaName(typedescriptor.substring(1, typedescriptor.length() - 1));
        } else {
          component = primitive(first);
        }
      }
      String array = component + " []";
      return array;
    }
    
    String primitive(char c)
    {
      switch (c)
      {
      case 'B': 
        return "byte";
      case 'C': 
        return "char";
      case 'D': 
        return "double";
      case 'F': 
        return "float";
      case 'I': 
        return "int";
      case 'J': 
        return "long";
      case 'S': 
        return "short";
      case 'Z': 
        return "boolean";
      }
      throw new IllegalArgumentException("unknown primitive: " + c);
    }
    
    private typeDescriptorCompiler2() {}
  }
  
  private static class methodDescriptorCompiler
  {
    methodDescriptorCompiler(String methoddescriptor)
    {
      m_in = new PushbackReader(new StringReader(methoddescriptor));
    }
    
    String[] getResult()
    {
      String[] result = new String[m_result.size()];
      m_result.toArray(result);
      
      return result;
    }
    
    void methodDescriptor()
      throws IOException
    {
      consume('(');
      char c;
      while ((c = (char)m_in.read()) != ')')
      {
        m_in.unread(c);
        parameterDescriptor();
      }
      returnDescriptor();
    }
    
    void parameterDescriptor()
      throws IOException
    {
      fieldType();
      newToken();
    }
    
    void returnDescriptor()
      throws IOException
    {
      char c = (char)m_in.read();
      switch (c)
      {
      case 'V': 
        m_token.append(c);
        break;
      default: 
        m_in.unread(c);
        fieldType();
      }
    }
    
    void componentType()
      throws IOException
    {
      fieldType();
    }
    
    void objectType()
      throws IOException
    {
      consume('L');
      m_token.append('L');
      char c;
      while ((c = (char)m_in.read()) != ';') {
        m_token.append(c);
      }
      m_token.append(';');
    }
    
    void arrayType()
      throws IOException
    {
      consume('[');
      m_token.append('[');
      
      componentType();
    }
    
    void fieldType()
      throws IOException
    {
      char c = (char)m_in.read();
      m_in.unread(c);
      switch (c)
      {
      case 'L': 
        objectType();
        break;
      case '[': 
        arrayType();
        break;
      default: 
        baseType();
      }
    }
    
    void baseType()
      throws IOException
    {
      char c = (char)m_in.read();
      switch (c)
      {
      case 'B': 
      case 'C': 
      case 'D': 
      case 'F': 
      case 'I': 
      case 'J': 
      case 'S': 
      case 'Z': 
        m_token.append(c);
        break;
      case 'E': 
      case 'G': 
      case 'H': 
      case 'K': 
      case 'L': 
      case 'M': 
      case 'N': 
      case 'O': 
      case 'P': 
      case 'Q': 
      case 'R': 
      case 'T': 
      case 'U': 
      case 'V': 
      case 'W': 
      case 'X': 
      case 'Y': 
      default: 
        throw new IllegalArgumentException("unknown base type: " + c);
      }
    }
    
    private void consume(char expected)
      throws IOException
    {
      char c = (char)m_in.read();
      if (c != expected) {
        throw new IllegalArgumentException("consumed '" + c + "' while expecting '" + expected + "'");
      }
    }
    
    private void newToken()
    {
      m_result.add(m_token.toString());
      m_token.setLength(0);
    }
    
    final List m_result = new ArrayList();
    private StringBuffer m_token = new StringBuffer();
    private PushbackReader m_in;
  }
}

/* Location:
 * Qualified Name:     com.vladium.jcd.lib.Types
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.lib;

import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;

public final class UDataInputStream
  extends DataInputStream
{
  public UDataInputStream(InputStream _in)
  {
    super(_in);
  }
  
  public final int readU2()
    throws IOException
  {
    short value = readShort();
    
    return value & 0xFFFF;
  }
  
  public final long readU4()
    throws IOException
  {
    int value = readInt();
    
    return value & 0xFFFFFFFF;
  }
}

/* Location:
 * Qualified Name:     com.vladium.jcd.lib.UDataInputStream
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.lib;

import java.io.DataOutputStream;
import java.io.IOException;
import java.io.OutputStream;

public final class UDataOutputStream
  extends DataOutputStream
{
  public UDataOutputStream(OutputStream _out)
  {
    super(_out);
  }
  
  public final void writeU2(int uint)
    throws IOException
  {
    writeShort((short)uint);
  }
  
  public final void writeU4(long ulong)
    throws IOException
  {
    writeInt((int)ulong);
  }
}

/* Location:
 * Qualified Name:     com.vladium.jcd.lib.UDataOutputStream
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.opcodes;

public abstract interface IOpcodeVisitor
{
  public abstract void visit(int paramInt1, boolean paramBoolean, int paramInt2, Object paramObject);
}

/* Location:
 * Qualified Name:     com.vladium.jcd.opcodes.IOpcodeVisitor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package com.vladium.jcd.opcodes;

public final class IOpcodes$clinit
{
  static final boolean[] _CONDITIONAL_BRANCHES;
  static final boolean[] _COMPOUND_CONDITIONAL_BRANCHES;
  static final boolean[] _UNCONDITIONAL_BRANCHES;
  static final boolean[] _BRANCHES;
  static final int[] _NARROW_SIZE;
  static final int[] _WIDE_SIZE;
  
  static
  {
    int opcodeCount = IOpcodes.MNEMONICS.length;
    
    _CONDITIONAL_BRANCHES = new boolean[opcodeCount];
    
    _CONDITIONAL_BRANCHES['?'] = true;
    _CONDITIONAL_BRANCHES['?'] = true;
    _CONDITIONAL_BRANCHES['?'] = true;
    _CONDITIONAL_BRANCHES['?'] = true;
    _CONDITIONAL_BRANCHES['?'] = true;
    _CONDITIONAL_BRANCHES['?'] = true;
    _CONDITIONAL_BRANCHES['�'] = true;
    _CONDITIONAL_BRANCHES['�'] = true;
    _CONDITIONAL_BRANCHES['?'] = true;
    _CONDITIONAL_BRANCHES['�'] = true;
    _CONDITIONAL_BRANCHES['�'] = true;
    _CONDITIONAL_BRANCHES['�'] = true;
    _CONDITIONAL_BRANCHES['�'] = true;
    _CONDITIONAL_BRANCHES['�'] = true;
    _CONDITIONAL_BRANCHES['�'] = true;
    _CONDITIONAL_BRANCHES['�'] = true;
    
    _COMPOUND_CONDITIONAL_BRANCHES = new boolean[opcodeCount];
    
    _COMPOUND_CONDITIONAL_BRANCHES['�'] = true;
    _COMPOUND_CONDITIONAL_BRANCHES['�'] = true;
    
    _UNCONDITIONAL_BRANCHES = new boolean[opcodeCount];
    
    _UNCONDITIONAL_BRANCHES['�'] = true;
    _UNCONDITIONAL_BRANCHES['�'] = true;
    _UNCONDITIONAL_BRANCHES['�'] = true;
    _UNCONDITIONAL_BRANCHES['�'] = true;
    _UNCONDITIONAL_BRANCHES['�'] = true;
    
    _UNCONDITIONAL_BRANCHES['�'] = true;
    _UNCONDITIONAL_BRANCHES['�'] = true;
    _UNCONDITIONAL_BRANCHES['�'] = true;
    _UNCONDITIONAL_BRANCHES['�'] = true;
    _UNCONDITIONAL_BRANCHES['�'] = true;
    _UNCONDITIONAL_BRANCHES['�'] = true;
    
    _UNCONDITIONAL_BRANCHES['�'] = true;
    
    _BRANCHES = new boolean[opcodeCount];
    for (int o = 0; o < opcodeCount; o++) {
      if (_CONDITIONAL_BRANCHES[o] != 0) {
        _BRANCHES[o] = true;
      }
    }
    for (int o = 0; o < opcodeCount; o++) {
      if (_COMPOUND_CONDITIONAL_BRANCHES[o] != 0) {
        _BRANCHES[o] = true;
      }
    }
    for (int o = 0; o < opcodeCount; o++) {
      if (_UNCONDITIONAL_BRANCHES[o] != 0) {
        _BRANCHES[o] = true;
      }
    }
    _NARROW_SIZE = new int[opcodeCount];
    for (int o = 0; o < opcodeCount; o++) {
      _NARROW_SIZE[o] = 1;
    }
    _NARROW_SIZE[16] = 2;
    _NARROW_SIZE[17] = 3;
    
    _NARROW_SIZE[18] = 2;
    _NARROW_SIZE[19] = 3;
    _NARROW_SIZE[20] = 3;
    
    _NARROW_SIZE[21] = 2;
    _NARROW_SIZE[22] = 2;
    _NARROW_SIZE[23] = 2;
    _NARROW_SIZE[24] = 2;
    _NARROW_SIZE[25] = 2;
    _NARROW_SIZE[54] = 2;
    _NARROW_SIZE[55] = 2;
    _NARROW_SIZE[56] = 2;
    _NARROW_SIZE[57] = 2;
    _NARROW_SIZE[58] = 2;
    
    _NARROW_SIZE['?'] = 3;
    
    _NARROW_SIZE['?'] = 3;
    _NARROW_SIZE['?'] = 3;
    _NARROW_SIZE['?'] = 3;
    _NARROW_SIZE['?'] = 3;
    _NARROW_SIZE['?'] = 3;
    _NARROW_SIZE['?'] = 3;
    _NARROW_SIZE['?'] = 3;
    _NARROW_SIZE['�'] = 3;
    _NARROW_SIZE['�'] = 3;
    _NARROW_SIZE['�'] = 3;
    _NARROW_SIZE['�'] = 3;
    _NARROW_SIZE['�'] = 3;
    _NARROW_SIZE['�'] = 3;
    _NARROW_
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22

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-2017. Infinite Loop Ltd