org.eclipse.equinox.p2.repository.tools_2.0.100.v20110815-1438

d_2
    //   26: caload
    //   27: bipush 41
    //   29: if_icmpne +5 -> 34
    //   32: iload_1
    //   33: ireturn
    //   34: aload_0
    //   35: iload_2
    //   36: invokestatic 370	org/eclipse/equinox/p2/internal/repository/comparator/java/Utility:scanTypeSignature	([CI)I
    //   39: istore_3
    //   40: iload_3
    //   41: ifge +11 -> 52
    //   44: new 246	java/lang/IllegalArgumentException
    //   47: dup
    //   48: invokespecial 333	java/lang/IllegalArgumentException:<init>	()V
    //   51: athrow
    //   52: iload_3
    //   53: iconst_1
    //   54: iadd
    //   55: istore_2
    //   56: iinc 1 1
    //   59: goto -35 -> 24
    //   62: pop
    //   63: new 246	java/lang/IllegalArgumentException
    //   66: dup
    //   67: invokespecial 333	java/lang/IllegalArgumentException:<init>	()V
    //   70: athrow
    // Line number table:
    //   Java source line #431	-> byte code offset #0
    //   Java source line #432	-> byte code offset #2
    //   Java source line #433	-> byte code offset #9
    //   Java source line #434	-> byte code offset #13
    //   Java source line #436	-> byte code offset #21
    //   Java source line #438	-> byte code offset #24
    //   Java source line #439	-> byte code offset #32
    //   Java source line #441	-> byte code offset #34
    //   Java source line #442	-> byte code offset #40
    //   Java source line #443	-> byte code offset #44
    //   Java source line #445	-> byte code offset #52
    //   Java source line #446	-> byte code offset #56
    //   Java source line #437	-> byte code offset #59
    //   Java source line #448	-> byte code offset #62
    //   Java source line #449	-> byte code offset #63
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	71	0	methodSignature	char[]
    //   1	56	1	count	int
    //   8	48	2	i	int
    //   39	14	3	e	int
    //   62	1	4	localArrayIndexOutOfBoundsException	ArrayIndexOutOfBoundsException
    // Exception table:
    //   from	to	target	type
    //   0	33	62	java/lang/ArrayIndexOutOfBoundsException
    //   34	62	62	java/lang/ArrayIndexOutOfBoundsException
  }
  
  /* Error */
  public static char[][] getParameterTypes(char[] methodSignature)
    throws IllegalArgumentException
  {
    // Byte code:
    //   0: aload_0
    //   1: invokestatic 355	org/eclipse/equinox/p2/internal/repository/comparator/java/Signature:getParameterCount	([C)I
    //   4: istore_1
    //   5: iload_1
    //   6: anewarray 243	[C
    //   9: astore_2
    //   10: iload_1
    //   11: ifne +5 -> 16
    //   14: aload_2
    //   15: areturn
    //   16: bipush 40
    //   18: aload_0
    //   19: invokestatic 350	org/eclipse/equinox/p2/internal/repository/comparator/java/CharOperation:indexOf	(C[C)I
    //   22: istore_3
    //   23: iload_3
    //   24: ifge +11 -> 35
    //   27: new 246	java/lang/IllegalArgumentException
    //   30: dup
    //   31: invokespecial 333	java/lang/IllegalArgumentException:<init>	()V
    //   34: athrow
    //   35: iinc 3 1
    //   38: iconst_0
    //   39: istore 4
    //   41: aload_0
    //   42: iload_3
    //   43: caload
    //   44: bipush 41
    //   46: if_icmpne +5 -> 51
    //   49: aload_2
    //   50: areturn
    //   51: aload_0
    //   52: iload_3
    //   53: invokestatic 370	org/eclipse/equinox/p2/internal/repository/comparator/java/Utility:scanTypeSignature	([CI)I
    //   56: istore 5
    //   58: iload 5
    //   60: ifge +11 -> 71
    //   63: new 246	java/lang/IllegalArgumentException
    //   66: dup
    //   67: invokespecial 333	java/lang/IllegalArgumentException:<init>	()V
    //   70: athrow
    //   71: aload_2
    //   72: iload 4
    //   74: aload_0
    //   75: iload_3
    //   76: iload 5
    //   78: iconst_1
    //   79: iadd
    //   80: invokestatic 354	org/eclipse/equinox/p2/internal/repository/comparator/java/CharOperation:subarray	([CII)[C
    //   83: aastore
    //   84: iinc 4 1
    //   87: iload 5
    //   89: iconst_1
    //   90: iadd
    //   91: istore_3
    //   92: goto -51 -> 41
    //   95: pop
    //   96: new 246	java/lang/IllegalArgumentException
    //   99: dup
    //   100: invokespecial 333	java/lang/IllegalArgumentException:<init>	()V
    //   103: athrow
    // Line number table:
    //   Java source line #466	-> byte code offset #0
    //   Java source line #467	-> byte code offset #5
    //   Java source line #468	-> byte code offset #10
    //   Java source line #469	-> byte code offset #14
    //   Java source line #471	-> byte code offset #16
    //   Java source line #472	-> byte code offset #23
    //   Java source line #473	-> byte code offset #27
    //   Java source line #475	-> byte code offset #35
    //   Java source line #476	-> byte code offset #38
    //   Java source line #478	-> byte code offset #41
    //   Java source line #479	-> byte code offset #49
    //   Java source line #481	-> byte code offset #51
    //   Java source line #482	-> byte code offset #58
    //   Java source line #483	-> byte code offset #63
    //   Java source line #485	-> byte code offset #71
    //   Java source line #486	-> byte code offset #84
    //   Java source line #487	-> byte code offset #87
    //   Java source line #477	-> byte code offset #92
    //   Java source line #489	-> byte code offset #95
    //   Java source line #490	-> byte code offset #96
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	104	0	methodSignature	char[]
    //   4	7	1	count	int
    //   9	63	2	result	char[][]
    //   22	70	3	i	int
    //   39	46	4	t	int
    //   56	32	5	e	int
    //   95	1	6	localArrayIndexOutOfBoundsException	ArrayIndexOutOfBoundsException
    // Exception table:
    //   from	to	target	type
    //   0	15	95	java/lang/ArrayIndexOutOfBoundsException
    //   16	50	95	java/lang/ArrayIndexOutOfBoundsException
    //   51	95	95	java/lang/ArrayIndexOutOfBoundsException
  }
  
  public static char[] getReturnType(char[] methodSignature)
    throws IllegalArgumentException
  {
    int paren = CharOperation.lastIndexOf(')', methodSignature);
    if (paren == -1) {
      throw new IllegalArgumentException();
    }
    int last = Utility.scanTypeSignature(methodSignature, paren + 1);
    return CharOperation.subarray(methodSignature, paren + 1, last + 1);
  }
  
  public static char[][] getTypeParameterBounds(char[] formalTypeParameterSignature)
    throws IllegalArgumentException
  {
    int p1 = CharOperation.indexOf(':', formalTypeParameterSignature);
    if (p1 < 0) {
      throw new IllegalArgumentException();
    }
    if (p1 == formalTypeParameterSignature.length - 1) {
      return CharOperation.NO_CHAR_CHAR;
    }
    int p2 = CharOperation.indexOf(':', formalTypeParameterSignature, p1 + 1);
    if (p2 < 0)
    {
      char[] classBound = CharOperation.subarray(formalTypeParameterSignature, p1 + 1, formalTypeParameterSignature.length);
      return new char[][] { classBound };
    }
    char[] classBound;
    char[] classBound;
    if (p2 == p1 + 1) {
      classBound = (char[])null;
    } else {
      classBound = CharOperation.subarray(formalTypeParameterSignature, p1 + 1, p2);
    }
    char[][] interfaceBounds = CharOperation.splitOn(':', formalTypeParameterSignature, p2 + 1, formalTypeParameterSignature.length);
    if (classBound == null) {
      return interfaceBounds;
    }
    int resultLength = interfaceBounds.length + 1;
    char[][] result = new char[resultLength][];
    result[0] = classBound;
    System.arraycopy(interfaceBounds, 0, result, 1, interfaceBounds.length);
    return result;
  }
  
  public static char[][] getTypeParameters(char[] methodOrTypeSignature)
    throws IllegalArgumentException
  {
    try
    {
      int length = methodOrTypeSignature.length;
      if (length == 0) {
        return CharOperation.NO_CHAR_CHAR;
      }
      if (methodOrTypeSignature[0] != '<') {
        return CharOperation.NO_CHAR_CHAR;
      }
      ArrayList<char[]> paramList = new ArrayList(1);
      int paramStart = 1;int i = 1;
      while (i < length)
      {
        if (methodOrTypeSignature[i] == '>')
        {
          int size = paramList.size();
          if (size == 0) {
            throw new IllegalArgumentException();
          }
          char[][] result;
          paramList.toArray(result = new char[size][]);
          return result;
        }
        i = CharOperation.indexOf(':', methodOrTypeSignature, i);
        if ((i < 0) || (i >= length)) {
          throw new IllegalArgumentException();
        }
        while (methodOrTypeSignature[i] == ':')
        {
          i++;
          switch (methodOrTypeSignature[i])
          {
          case ':': 
            break;
          case '>': 
            break;
          case 'L': 
            try
            {
              i = Utility.scanClassTypeSignature(methodOrTypeSignature, i);
              i++;
            }
            catch (IllegalArgumentException localIllegalArgumentException1) {}
          case '[': 
            try
            {
              i = Utility.scanArrayTypeSignature(methodOrTypeSignature, i);
              i++;
            }
            catch (IllegalArgumentException localIllegalArgumentException2) {}
          case 'T': 
            try
            {
              i = Utility.scanTypeVariableSignature(methodOrTypeSignature, i);
              i++;
            }
            catch (IllegalArgumentException localIllegalArgumentException3) {}
          }
        }
        paramList.add(CharOperation.subarray(methodOrTypeSignature, paramStart, i));
        paramStart = i;
      }
    }
    catch (ArrayIndexOutOfBoundsException localArrayIndexOutOfBoundsException) {}
    throw new IllegalArgumentException();
  }
  
  public static char[] toCharArray(char[] signature)
    throws IllegalArgumentException
  {
    int sigLength = signature.length;
    if ((sigLength == 0) || (signature[0] == '(') || (signature[0] == '<')) {
      return toCharArray(signature, CharOperation.NO_CHAR, null, true, true);
    }
    StringBuffer buffer = new StringBuffer(signature.length + 10);
    appendTypeSignature(signature, 0, true, buffer);
    char[] result = new char[buffer.length()];
    buffer.getChars(0, buffer.length(), result, 0);
    return result;
  }
  
  public static char[] toCharArray(char[] methodSignature, char[] methodName, char[][] parameterNames, boolean fullyQualifyTypeNames, boolean includeReturnType, boolean isVargArgs)
  {
    int firstParen = CharOperation.indexOf('(', methodSignature);
    if (firstParen == -1) {
      throw new IllegalArgumentException();
    }
    StringBuffer buffer = new StringBuffer(methodSignature.length + 10);
    if (includeReturnType)
    {
      char[] rts = getReturnType(methodSignature);
      appendTypeSignature(rts, 0, fullyQualifyTypeNames, buffer);
      buffer.append(' ');
    }
    if (methodName != null) {
      buffer.append(methodName);
    }
    buffer.append('(');
    char[][] pts = getParameterTypes(methodSignature);
    
    int max = pts.length;
    int index = max - 1;
    for (int i = index; i >= 0; i--)
    {
      if (pts[i][0] == '[') {
        break;
      }
      index--;
    }
    for (int i = 0; i < max; i++)
    {
      if (i == index) {
        appendTypeSignature(pts[i], 0, fullyQualifyTypeNames, buffer, isVargArgs);
      } else {
        appendTypeSignature(pts[i], 0, fullyQualifyTypeNames, buffer);
      }
      if (parameterNames != null)
      {
        buffer.append(' ');
        buffer.append(parameterNames[i]);
      }
      if (i != pts.length - 1)
      {
        buffer.append(',');
        buffer.append(' ');
      }
    }
    buffer.append(')');
    char[] result = new char[buffer.length()];
    buffer.getChars(0, buffer.length(), result, 0);
    return result;
  }
  
  private static int appendTypeSignature(char[] string, int start, boolean fullyQualifyTypeNames, StringBuffer buffer)
  {
    return appendTypeSignature(string, start, fullyQualifyTypeNames, buffer, false);
  }
  
  private static int appendTypeSignature(char[] string, int start, boolean fullyQualifyTypeNames, StringBuffer buffer, boolean isVarArgs)
  {
    if (start >= string.length) {
      throw new IllegalArgumentException();
    }
    char c = string[start];
    if (isVarArgs)
    {
      switch (c)
      {
      case '[': 
        return appendArrayTypeSignature(string, start, fullyQualifyTypeNames, buffer, true);
      }
      throw new IllegalArgumentException();
    }
    switch (c)
    {
    case '[': 
      return appendArrayTypeSignature(string, start, fullyQualifyTypeNames, buffer);
    case 'L': 
    case 'Q': 
      return appendClassTypeSignature(string, start, fullyQualifyTypeNames, buffer);
    case 'T': 
      int e = Utility.scanTypeVariableSignature(string, start);
      buffer.append(string, start + 1, e - start - 1);
      return e;
    case 'Z': 
      buffer.append(BOOLEAN);
      return start;
    case 'B': 
      buffer.append(BYTE);
      return start;
    case 'C': 
      buffer.append(CHAR);
      return start;
    case 'D': 
      buffer.append(DOUBLE);
      return start;
    case 'F': 
      buffer.append(FLOAT);
      return start;
    case 'I': 
      buffer.append(INT);
      return start;
    case 'J': 
      buffer.append(LONG);
      return start;
    case 'S': 
      buffer.append(SHORT);
      return start;
    case 'V': 
      buffer.append(VOID);
      return start;
    case '!': 
      return appendCaptureTypeSignature(string, start, fullyQualifyTypeNames, buffer);
    case '*': 
    case '+': 
    case '-': 
      return appendTypeArgumentSignature(string, start, fullyQualifyTypeNames, buffer);
    }
    throw new IllegalArgumentException();
  }
  
  private static int appendArrayTypeSignature(char[] string, int start, boolean fullyQualifyTypeNames, StringBuffer buffer)
  {
    return appendArrayTypeSignature(string, start, fullyQualifyTypeNames, buffer, false);
  }
  
  private static int appendCaptureTypeSignature(char[] string, int start, boolean fullyQualifyTypeNames, StringBuffer buffer)
  {
    if (start >= string.length - 1) {
      throw new IllegalArgumentException();
    }
    char c = string[start];
    if (c != '!') {
      throw new IllegalArgumentException();
    }
    buffer.append(CAPTURE).append(' ');
    return appendTypeArgumentSignature(string, start + 1, fullyQualifyTypeNames, buffer);
  }
  
  private static int appendArrayTypeSignature(char[] string, int start, boolean fullyQualifyTypeNames, StringBuffer buffer, boolean isVarArgs)
  {
    int length = string.length;
    if (start >= length - 1) {
      throw new IllegalArgumentException();
    }
    char c = string[start];
    if (c != '[') {
      throw new IllegalArgumentException();
    }
    int index = start;
    c = string[(++index)];
    while (c == '[')
    {
      if (index >= length - 1) {
        throw new IllegalArgumentException();
      }
      c = string[(++index)];
    }
    int e = appendTypeSignature(string, index, fullyQualifyTypeNames, buffer);
    
    int i = 1;
    for (int dims = index - start; i < dims; i++) {
      buffer.append('[').append(']');
    }
    if (isVarArgs) {
      buffer.append('.').append('.').append('.');
    } else {
      buffer.append('[').append(']');
    }
    return e;
  }
  
  private static int appendClassTypeSignature(char[] string, int start, boolean fullyQualifyTypeNames, StringBuffer buffer)
  {
    if (start >= string.length - 2) {
      throw new IllegalArgumentException();
    }
    char c = string[start];
    if ((c != 'L') && (c != 'Q')) {
      throw new IllegalArgumentException();
    }
    boolean resolved = c == 'L';
    boolean removePackageQualifiers = !fullyQualifyTypeNames;
    if (!resolved) {
      removePackageQualifiers = false;
    }
    int p = start + 1;
    int checkpoint = buffer.length();
    int innerTypeStart = -1;
    boolean inAnonymousType = false;
    for (;;)
    {
      if (p >= string.length) {
        throw new IllegalArgumentException();
      }
      c = string[p];
      switch (c)
      {
      case ';': 
        return p;
      case '<': 
        int e = appendTypeArgumentSignatures(string, p, fullyQualifyTypeNames, buffer);
        
        removePackageQualifiers = false;
        p = e;
        break;
      case '.': 
        if (removePackageQualifiers) {
          buffer.setLength(checkpoint);
        } else {
          buffer.append('.');
        }
        break;
      case '/': 
        if (removePackageQualifiers) {
          buffer.setLength(checkpoint);
        } else {
          buffer.append('/');
        }
        break;
      case '$': 
        innerTypeStart = buffer.length();
        inAnonymousType = false;
        if (resolved)
        {
          removePackageQualifiers = false;
          
          buffer.append('.');
        }
        break;
      default: 
        if ((innerTypeStart != -1) && (!inAnonymousType) && (Character.isDigit(c)))
        {
          inAnonymousType = true;
          buffer.setLength(innerTypeStart);
          buffer.insert(checkpoint, "new ");
          buffer.append("(){}");
        }
        if (!inAnonymousType) {
          buffer.append(c);
        }
        innerTypeStart = -1;
      }
      p++;
    }
  }
  
  private static int appendTypeArgumentSignatures(char[] string, int start, boolean fullyQualifyTypeNames, StringBuffer buffer)
  {
    if (start >= string.length - 1) {
      throw new IllegalArgumentException();
    }
    char c = string[start];
    if (c != '<') {
      throw new IllegalArgumentException();
    }
    buffer.append('<');
    int p = start + 1;
    int count = 0;
    for (;;)
    {
      if (p >= string.length) {
        throw new IllegalArgumentException();
      }
      c = string[p];
      if (c == '>')
      {
        buffer.append('>');
        return p;
      }
      if (count != 0) {
        buffer.append(',');
      }
      int e = appendTypeArgumentSignature(string, p, fullyQualifyTypeNames, buffer);
      count++;
      p = e + 1;
    }
  }
  
  private static int appendTypeArgumentSignature(char[] string, int start, boolean fullyQualifyTypeNames, StringBuffer buffer)
  {
    if (start >= string.length) {
      throw new IllegalArgumentException();
    }
    char c = string[start];
    switch (c)
    {
    case '*': 
      buffer.append('?');
      return start;
    case '+': 
      buffer.append("? extends ");
      return appendTypeSignature(string, start + 1, fullyQualifyTypeNames, buffer);
    case '-': 
      buffer.append("? super ");
      return appendTypeSignature(string, start + 1, fullyQualifyTypeNames, buffer);
    }
    return appendTypeSignature(string, start, fullyQualifyTypeNames, buffer);
  }
  
  public static char[] toCharArray(char[] methodSignature, char[] methodName, char[][] parameterNames, boolean fullyQualifyTypeNames, boolean includeReturnType)
  {
    return toCharArray(methodSignature, methodName, parameterNames, fullyQualifyTypeNames, includeReturnType, false);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.p2.internal.repository.comparator.java.Signature
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.p2.internal.repository.comparator.java;

public class SignatureAttribute
  extends ClassFileAttribute
{
  private int signatureIndex;
  private char[] signature;
  
  SignatureAttribute(byte[] classFileBytes, ConstantPool constantPool, int offset)
    throws ClassFormatException
  {
    super(classFileBytes, constantPool, offset);
    int index = u2At(classFileBytes, 6, offset);
    signatureIndex = index;
    ConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(index);
    if (constantPoolEntry.getKind() != 1) {
      throw new ClassFormatException(3);
    }
    signature = constantPoolEntry.getUtf8Value();
  }
  
  public int getSignatureIndex()
  {
    return signatureIndex;
  }
  
  public char[] getSignature()
  {
    return signature;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.p2.internal.repository.comparator.java.SignatureAttribute
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.p2.internal.repository.comparator.java;

public class SourceFileAttribute
  extends ClassFileAttribute
{
  private int sourceFileIndex;
  private char[] sourceFileName;
  
  public SourceFileAttribute(byte[] classFileBytes, ConstantPool constantPool, int offset)
    throws ClassFormatException
  {
    super(classFileBytes, constantPool, offset);
    sourceFileIndex = u2At(classFileBytes, 6, offset);
    ConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(sourceFileIndex);
    if (constantPoolEntry.getKind() != 1) {
      throw new ClassFormatException(3);
    }
    sourceFileName = constantPoolEntry.getUtf8Value();
  }
  
  public int getSourceFileIndex()
  {
    return sourceFileIndex;
  }
  
  public char[] getSourceFileName()
  {
    return sourceFileName;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.p2.internal.repository.comparator.java.SourceFileAttribute
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.p2.internal.repository.comparator.java;

public abstract interface TypeConstants
{
  public static final char[] JAVA = "java".toCharArray();
  public static final char[] LANG = "lang".toCharArray();
  public static final char[] IO = "io".toCharArray();
  public static final char[] UTIL = "util".toCharArray();
  public static final char[] ANNOTATION = "annotation".toCharArray();
  public static final char[] REFLECT = "reflect".toCharArray();
  public static final char[] LENGTH = "length".toCharArray();
  public static final char[] CLONE = "clone".toCharArray();
  public static final char[] EQUALS = "equals".toCharArray();
  public static final char[] GETCLASS = "getClass".toCharArray();
  public static final char[] HASHCODE = "hashCode".toCharArray();
  public static final char[] OBJECT = "Object".toCharArray();
  public static final char[] MAIN = "main".toCharArray();
  public static final char[] SERIALVERSIONUID = "serialVersionUID".toCharArray();
  public static final char[] SERIALPERSISTENTFIELDS = "serialPersistentFields".toCharArray();
  public static final char[] READRESOLVE = "readResolve".toCharArray();
  public static final char[] WRITEREPLACE = "writeReplace".toCharArray();
  public static final char[] READOBJECT = "readObject".toCharArray();
  public static final char[] WRITEOBJECT = "writeObject".toCharArray();
  public static final char[] CharArray_JAVA_LANG_OBJECT = "java.lang.Object".toCharArray();
  public static final char[] CharArray_JAVA_LANG_ENUM = "java.lang.Enum".toCharArray();
  public static final char[] CharArray_JAVA_LANG_ANNOTATION_ANNOTATION = "java.lang.annotation.Annotation".toCharArray();
  public static final char[] CharArray_JAVA_IO_OBJECTINPUTSTREAM = "java.io.ObjectInputStream".toCharArray();
  public static final char[] CharArray_JAVA_IO_OBJECTOUTPUTSTREAM = "java.io.ObjectOutputStream".toCharArray();
  public static final char[] CharArray_JAVA_IO_OBJECTSTREAMFIELD = "java.io.ObjectStreamField".toCharArray();
  public static final char[] ANONYM_PREFIX = "new ".toCharArray();
  public static final char[] ANONYM_SUFFIX = "(){}".toCharArray();
  public static final char[] WILDCARD_NAME = { '?' };
  public static final char[] WILDCARD_SUPER = " super ".toCharArray();
  public static final char[] WILDCARD_EXTENDS = " extends ".toCharArray();
  public static final char[] WILDCARD_MINUS = { '-' };
  public static final char[] WILDCARD_STAR = { '*' };
  public static final char[] WILDCARD_PLUS = { '+' };
  public static final char[] WILDCARD_CAPTURE_NAME_PREFIX = "capture#".toCharArray();
  public static final char[] WILDCARD_CAPTURE_NAME_SUFFIX = "-of ".toCharArray();
  public static final char[] WILDCARD_CAPTURE = { '!' };
  public static final char[] BYTE = "byte".toCharArray();
  public static final char[] SHORT = "short".toCharArray();
  public static final char[] INT = "int".toCharArray();
  public static final char[] LONG = "long".toCharArray();
  public static final char[] FLOAT = "float".toCharArray();
  public static final char[] DOUBLE = "double".toCharArray();
  public static final char[] CHAR = "char".toCharArray();
  public static final char[] BOOLEAN = "boolean".toCharArray();
  public static final char[] NULL = "null".toCharArray();
  public static final char[] VOID = "void".toCharArray();
  public static final char[] VALUE = "value".toCharArray();
  public static final char[] VALUES = "values".toCharArray();
  public static final char[] VALUEOF = "valueOf".toCharArray();
  public static final char[] UPPER_SOURCE = "SOURCE".toCharArray();
  public static final char[] UPPER_CLASS = "CLASS".toCharArray();
  public static final char[] UPPER_RUNTIME = "RUNTIME".toCharArray();
  public static final char[] ANNOTATION_PREFIX = "@".toCharArray();
  public static final char[] ANNOTATION_SUFFIX = "()".toCharArray();
  public static final char[] TYPE = "TYPE".toCharArray();
  public static final char[] UPPER_FIELD = "FIELD".toCharArray();
  public static final char[] UPPER_METHOD = "METHOD".toCharArray();
  public static final char[] UPPER_PARAMETER = "PARAMETER".toCharArray();
  public static final char[] UPPER_CONSTRUCTOR = "CONSTRUCTOR".toCharArray();
  public static final char[] UPPER_LOCAL_VARIABLE = "LOCAL_VARIABLE".toCharArray();
  public static final char[] UPPER_ANNOTATION_TYPE = "ANNOTATION_TYPE".toCharArray();
  public static final char[] UPPER_PACKAGE = "PACKAGE".toCharArray();
  public static final char[][] JAVA_LANG = { JAVA, LANG };
  public static final char[][] JAVA_IO = { JAVA, IO };
  public static final char[][] JAVA_LANG_ANNOTATION_ANNOTATION = { JAVA, LANG, ANNOTATION, "Annotation".toCharArray() };
  public static final char[][] JAVA_LANG_ASSERTIONERROR = { JAVA, LANG, "AssertionError".toCharArray() };
  public static final char[][] JAVA_LANG_CLASS = { JAVA, LANG, "Class".toCharArray() };
  public static final char[][] JAVA_LANG_CLASSNOTFOUNDEXCEPTION = { JAVA, LANG, "ClassNotFoundException".toCharArray() };
  public static final char[][] JAVA_LANG_CLONEABLE = { JAVA, LANG, "Cloneable".toCharArray() };
  public static final char[][] JAVA_LANG_ENUM = { JAVA, LANG, "Enum".toCharArray() };
  public static final char[][] JAVA_LANG_EXCEPTION = { JAVA, LANG, "Exception".toCharArray() };
  public static final char[][] JAVA_LANG_ERROR = { JAVA, LANG, "Error".toCharArray() };
  public static final char[][] JAVA_LANG_ILLEGALARGUMENTEXCEPTION = { JAVA, LANG, "IllegalArgumentException".toCharArray() };
  public static final char[][] JAVA_LANG_ITERABLE = { JAVA, LANG, "Iterable".toCharArray() };
  public static final char[][] JAVA_LANG_NOCLASSDEFERROR = { JAVA, LANG, "NoClassDefError".toCharArray() };
  public static final char[][] JAVA_LANG_OBJECT = { JAVA, LANG, OBJECT };
  public static final char[][] JAVA_LANG_STRING = { JAVA, LANG, "String".toCharArray() };
  public static final char[][] JAVA_LANG_STRINGBUFFER = { JAVA, LANG, "StringBuffer".toCharArray() };
  public static final char[][] JAVA_LANG_STRINGBUILDER = { JAVA, LANG, "StringBuilder".toCharArray() };
  public static final char[][] JAVA_LANG_SYSTEM = { JAVA, LANG, "System".toCharArray() };
  public static final char[][] JAVA_LANG_RUNTIMEEXCEPTION = { JAVA, LANG, "RuntimeException".toCharArray() };
  public static final char[][] JAVA_LANG_THROWABLE = { JAVA, LANG, "Throwable".toCharArray() };
  public static final char[][] JAVA_LANG_REFLECT_CONSTRUCTOR = { JAVA, LANG, REFLECT, "Constructor".toCharArray() };
  public static final char[][] JAVA_IO_PRINTSTREAM = { JAVA, IO, "PrintStream".toCharArray() };
  public static final char[][] JAVA_IO_SERIALIZABLE = { JAVA, IO, "Serializable".toCharArray() };
  public static final char[][] JAVA_LANG_BYTE = { JAVA, LANG, "Byte".toCharArray() };
  public static final char[][] JAVA_LANG_SHORT = { JAVA, LANG, "Short".toCharArray() };
  public static final char[][] JAVA_LANG_CHARACTER = { JAVA, LANG, "Character".toCharArray() };
  public static final char[][] JAVA_LANG_INTEGER = { JAVA, LANG, "Integer".toCharArray() };
  public static final char[][] JAVA_LANG_LONG = { JAVA, LANG, "Long".toCharArray() };
  public static final char[][] JAVA_LANG_FLOAT = { JAVA, LANG, "Float".toCharArray() };
  public static final char[][] JAVA_LANG_DOUBLE = { JAVA, LANG, "Double".toCharArray() };
  public static final char[][] JAVA_LANG_BOOLEAN = { JAVA, LANG, "Boolean".toCharArray() };
  public static final char[][] JAVA_LANG_VOID = { JAVA, LANG, "Void".toCharArray() };
  public static final char[][] JAVA_UTIL_COLLECTION = { JAVA, UTIL, "Collection".toCharArray() };
  public static final char[][] JAVA_UTIL_ITERATOR = { JAVA, UTIL, "Iterator".toCharArray() };
  public static final char[][] JAVA_LANG_DEPRECATED = { JAVA, LANG, "Deprecated".toCharArray() };
  public static final char[][] JAVA_LANG_ANNOTATION_DOCUMENTED = { JAVA, LANG, ANNOTATION, "Documented".toCharArray() };
  public static final char[][] JAVA_LANG_ANNOTATION_INHERITED = { JAVA, LANG, ANNOTATION, "Inherited".toCharArray() };
  public static final char[][] JAVA_LANG_OVERRIDE = { JAVA, LANG, "Override".toCharArray() };
  public static final char[][] JAVA_LANG_ANNOTATION_RETENTION = { JAVA, LANG, ANNOTATION, "Retention".toCharArray() };
  public static final char[][] JAVA_LANG_SUPPRESSWARNINGS = { JAVA, LANG, "SuppressWarnings".toCharArray() };
  public static final char[][] JAVA_LANG_ANNOTATION_TARGET = { JAVA, LANG, ANNOTATION, "Target".toCharArray() };
  public static final char[][] JAVA_LANG_ANNOTATION_RETENTIONPOLICY = { JAVA, LANG, ANNOTATION, "RetentionPolicy".toCharArray() };
  public static final char[][] JAVA_LANG_ANNOTATION_ELEMENTTYPE = { JAVA, LANG, ANNOTATION, "ElementType".toCharArray() };
  public static final char[][] JAVA_LANG_REFLECT_FIELD = { JAVA, LANG, REFLECT, "Field".toCharArray() };
  public static final char[][] JAVA_LANG_REFLECT_METHOD = { JAVA, LANG, REFLECT, "Method".toCharArray() };
  public static final char[][] JAVA_IO_OBJECTSTREAMEXCEPTION = { JAVA, IO, "ObjectStreamException".toCharArray() };
  public static final char[][] JAVA_IO_EXTERNALIZABLE = { JAVA, IO, "Externalizable".toCharArray() };
  public static final char[][] JAVA_IO_IOEXCEPTION = { JAVA, IO, "IOException".toCharArray() };
  public static final char[][] JAVA_IO_OBJECTOUTPUTSTREAM = { JAVA, IO, "ObjectOutputStream".toCharArray() };
  public static final char[][] JAVA_IO_OBJECTINPUTSTREAM = { JAVA, IO, "ObjectInputStream".toCharArray() };
  public static final int CONSTRAINT_EQUAL = 0;
  public static final int CONSTRAINT_EXTENDS = 1;
  public static final int CONSTRAINT_SUPER = 2;
  public static final int OK = 0;
  public static final int UNCHECKED = 1;
  public static final int MISMATCH = 2;
  public static final char[] INIT = "<init>".toCharArray();
  public static final char[] CLINIT = "<clinit>".toCharArray();
  public static final char[] SYNTHETIC_SWITCH_ENUM_TABLE = "$SWITCH_TABLE$".toCharArray();
  public static final char[] SYNTHETIC_ENUM_VALUES = "ENUM$VALUES".toCharArray();
  public static final char[] SYNTHETIC_ASSERT_DISABLED = "$assertionsDisabled".toCharArray();
  public static final char[] SYNTHETIC_CLASS = "class$".toCharArray();
  public static final char[] SYNTHETIC_OUTER_LOCAL_PREFIX = "val$".toCharArray();
  public static final char[] SYNTHETIC_ENCLOSING_INSTANCE_PREFIX = "this$".toCharArray();
  public static final char[] SYNTHETIC_ACCESS_METHOD_PREFIX = "access$".toCharArray();
  public static final char[] PACKAGE_INFO_NAME = "package-info".toCharArray();
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.p2.internal.repository.comparator.java.TypeConstants
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.p2.internal.repository.comparator.java;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Arrays;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;

public class Utility
{
  public static final int[] EMPTY_INT_ARRAY = new int[0];
  public static final String EMPTY_STRING = "";
  private static final int DEFAULT_READING_SIZE = 8192;
  private static final char[] BOOLEAN = "boolean".toCharArray();
  private static final char[] BYTE = "byte".toCharArray();
  private static final char[] CHAR = "char".toCharArray();
  private static final char[] DOUBLE = "double".toCharArray();
  private static final char[] FLOAT = "float".toCharArray();
  private static final char[] INT = "int".toCharArray();
  private static final char[] LONG = "long".toCharArray();
  private static final char[] SHORT = "short".toCharArray();
  private static final char[] VOID = "void".toCharArray();
  private static final char[] INIT = "<init>".toCharArray();
  
  public static byte[] getZipEntryByteContent(ZipEntry ze, ZipFile zip)
    throws IOException
  {
    InputStream stream = null;
    try
    {
      stream = zip.getInputStream(ze);
      if (stream == null) {
        throw new IOException("Invalid zip entry name : " + ze.getName());
      }
      return getInputStreamAsByteArray(stream, (int)ze.getSize());
    }
    finally
    {
      close(stream);
    }
  }
  
  public static void close(Object object)
  {
    if (object == null) {
      return;
    }
    try
    {
      if ((object instanceof InputStream)) {
        ((InputStream)object).close();
      } else if ((object instanceof OutputStream)) {
        ((OutputStream)object).close();
      } else if ((object instanceof ZipFile)) {
        ((ZipFile)object).close();
      }
    }
    catch (IOException localIOException) {}
  }
  
  public static byte[] getInputStreamAsByteArray(InputStream stream, int length)
    throws IOException
  {
    byte[] contents;
    if (length == -1)
    {
      byte[] contents = new byte[0];
      int contentsLength = 0;
      int amountRead = -1;
      do
      {
        int amountRequested = Math.max(stream.available(), 8192);
        if (contentsLength + amountRequested > contents.length) {
          System.arraycopy(contents, 0, contents = new byte[contentsLength + amountRequested], 0, contentsLength);
        }
        amountRead = stream.read(contents, contentsLength, amountRequested);
        if (amountRead > 0) {
          contentsLength += amountRead;
        }
      } while (amountRead != -1);
      if (contentsLength < contents.length) {
        System.arraycopy(contents, 0, contents = new byte[contentsLength], 0, contentsLength);
      }
    }
    else
    {
      contents = new byte[length];
      int len = 0;
      int readSize = 0;
      while ((readSize != -1) && (len != length))
      {
        len += readSize;
        readSize = stream.read(contents, len, length - len);
      }
    }
    return contents;
  }
  
  public static ClassFileAttribute getAttribute(MethodInfo methodInfo, char[] attributeName)
  {
    ClassFileAttribute[] attributes = methodInfo.getAttributes();
    int i = 0;
    for (int max = attributes.length; i < max; i++) {
      if (Arrays.equals(attributes[i].getAttributeName(), attributeName)) {
        return attributes[i];
      }
    }
    return null;
  }
  
  public static ClassFileAttribute getAttribute(FieldInfo fieldInfo, char[] attributeName)
  {
    ClassFileAttribute[] attributes = fieldInfo.getAttributes();
    int i = 0;
    for (int max = attributes.length; i < max; i++) {
      if (Arrays.equals(attributes[i].getAttributeName(), attributeName)) {
        return attributes[i];
      }
    }
    return null;
  }
  
  public static ClassFileAttribute getAttribute(ClassFileReader classFileReader, char[] attributeName)
  {
    ClassFileAttribute[] attributes = classFileReader.getAttributes();
    int i = 0;
    for (int max = attributes.length; i < max; i++) {
      if (Arrays.equals(attributes[i].getAttributeName(), attributeName)) {
        return attributes[i];
      }
    }
    return null;
  }
  
  public static int scanTypeSignature(char[] string, int start)
  {
    if (start >= string.length) {
      throw new IllegalArgumentException();
    }
    char c = string[start];
    switch (c)
    {
    case '[': 
      return scanArrayTypeSignature(string, start);
    case 'L': 
    case 'Q': 
      return scanClassTypeSignature(string, start);
    case 'T': 
      return scanTypeVariableSignature(string, start);
    case 'B': 
    case 'C': 
    case 'D': 
    case 'F': 
    case 'I': 
    case 'J': 
    case 'S': 
    case 'V': 
    case 'Z': 
      return scanBaseTypeSignature(string, start);
    case '!': 
      return scanCaptureTypeSignature(string, start);
    case '*': 
    case '+': 
    case '-': 
      return scanTypeBoundSignature(string, start);
    }
    throw new IllegalArgumentException();
  }
  
  public static int scanBaseTypeSignature(char[] string, int start)
  {
    if (start >= string.length) {
      throw new IllegalArgumentException();
    }
    char c = string[start];
    if ("BCDFIJSVZ".indexOf(c) >= 0) {
      return start;
    }
    throw new IllegalArgumentException();
  }
  
  public static int scanArrayTypeSignature(char[] string, int start)
  {
    int length = string.length;
    if (start >= length - 1) {
      throw new IllegalArgumentException();
    }
    char c = string[start];
    if (c != '[') {
      throw new IllegalArgumentException();
    }
    c = string[(++start)];
    while (c == '[')
    {
      if (start >= length - 1) {
        throw new IllegalArgumentException();
      }
      c = string[(++start)];
    }
    return scanTypeSignature(string, start);
  }
  
  public static int scanCaptureTypeSignature(char[] string, int start)
  {
    if (start >= string.length - 1) {
      throw new IllegalArgumentException();
    }
    char c = string[start];
    if (c != '!') {
      throw new IllegalArgumentException();
    }
    return scanTypeBoundSignature(string, start + 1);
  }
  
  public static int scanTypeVariableSignature(char[] string, int start)
  {
    if (start >= string.length - 2) {
      throw new IllegalArgumentException();
    }
    char c = string[start];
    if (c != 'T') {
      throw new IllegalArgumentException();
    }
    int id = scanIdentifier(string, start + 1);
    c = string[(id + 1)];
    if (c == ';') {
      return id + 1;
    }
    throw new IllegalArgumentException();
  }
  
  public static int scanIdentifier(char[] string, int start)
  {
    if (start >= string.length) {
      throw new IllegalArgumentException();
    }
    int p = start;
    do
    {
      char c = string[p];
      if ((c == '<') || (c == '>') || (c == ':') || (c == ';') || (c == '.') || (c == '/')) {
        return p - 1;
      }
      p++;
    } while (p != string.length);
    return p - 1;
  }
  
  public static int scanClassTypeSignature(char[] string, int start)
  {
    if (start >= string.length - 2) {
      throw new IllegalArgumentException();
    }
    char c = string[start];
    if ((c != 'L') && (c != 'Q')) {
      return -1;
    }
    int p = start + 1;
    for (;;)
    {
      if (p >= string.length) {
        throw new IllegalArgumentException();
      }
      c = string[p];
      if (c == ';') {
        return p;
      }
      if (c == '<')
      {
        int e = scanTypeArgumentSignatures(string, p);
        p = e;
      }
      else if ((c == '.') || (c == '/'))
      {
        int id = scanIdentifier(string, p + 1);
        p = id;
      }
      p++;
    }
  }
  
  public static int scanTypeBoundSignature(char[] string, int start)
  {
    if (start >= string.length) {
      throw new IllegalArgumentException();
    }
    char c = string[start];
    switch (c)
    {
    case '*': 
      return start;
    case '+': 
    case '-': 
      if (start >= string.length - 2) {
        throw new IllegalArgumentException();
      }
      break;
    case ',': 
    default: 
      throw new IllegalArgumentException();
    }
    c = string[(++start)];
    switch (c)
    {
    ca
1 2 3 4 5 6 7 8 9 10 11 12

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