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

415	-> byte code offset #78
    //   Java source line #416	-> byte code offset #80
    //   Java source line #417	-> byte code offset #97
    //   Java source line #418	-> byte code offset #99
    //   Java source line #419	-> byte code offset #116
    //   Java source line #420	-> byte code offset #118
    //   Java source line #421	-> byte code offset #123
    //   Java source line #420	-> byte code offset #126
    //   Java source line #422	-> byte code offset #131
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	134	0	this	JarComparator
    //   0	134	1	repository	IArtifactRepository
    //   0	134	2	descriptor	IArtifactDescriptor
    //   0	134	3	prefix	String
    //   1	131	4	file	File
    //   4	123	5	stream	java.io.BufferedOutputStream
    //   48	17	6	status	IStatus
    //   78	11	6	e	java.io.FileNotFoundException
    //   97	11	6	e	IOException
    //   116	8	7	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   6	75	78	java/io/FileNotFoundException
    //   6	75	97	java/io/IOException
    //   6	116	116	finally
  }
  
  /* Error */
  private File getLocalJarFile(InputStream inputStream, String entry, long size)
    throws IOException
  {
    // Byte code:
    //   0: aload_1
    //   1: lload_3
    //   2: l2i
    //   3: invokestatic 663	org/eclipse/equinox/p2/internal/repository/comparator/java/Utility:getInputStreamAsByteArray	(Ljava/io/InputStream;I)[B
    //   6: astore 5
    //   8: aconst_null
    //   9: astore 6
    //   11: aconst_null
    //   12: astore 7
    //   14: new 313	java/lang/StringBuffer
    //   17: dup
    //   18: ldc 14
    //   20: invokespecial 610	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   23: aload_0
    //   24: aload_2
    //   25: invokespecial 646	org/eclipse/equinox/p2/internal/repository/comparator/JarComparator:normalize	(Ljava/lang/String;)Ljava/lang/String;
    //   28: invokevirtual 612	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   31: invokevirtual 609	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   34: ldc 4
    //   36: invokestatic 587	java/io/File:createTempFile	(Ljava/lang/String;Ljava/lang/String;)Ljava/io/File;
    //   39: astore 6
    //   41: new 303	java/io/BufferedOutputStream
    //   44: dup
    //   45: new 306	java/io/FileOutputStream
    //   48: dup
    //   49: aload 6
    //   51: invokespecial 588	java/io/FileOutputStream:<init>	(Ljava/io/File;)V
    //   54: invokespecial 584	java/io/BufferedOutputStream:<init>	(Ljava/io/OutputStream;)V
    //   57: astore 7
    //   59: aload 7
    //   61: aload 5
    //   63: invokevirtual 583	java/io/BufferedOutputStream:write	([B)V
    //   66: aload 7
    //   68: invokevirtual 582	java/io/BufferedOutputStream:flush	()V
    //   71: goto +13 -> 84
    //   74: astore 8
    //   76: aload 7
    //   78: invokestatic 664	org/eclipse/equinox/p2/internal/repository/comparator/java/Utility:close	(Ljava/lang/Object;)V
    //   81: aload 8
    //   83: athrow
    //   84: aload 7
    //   86: invokestatic 664	org/eclipse/equinox/p2/internal/repository/comparator/java/Utility:close	(Ljava/lang/Object;)V
    //   89: aload 6
    //   91: areturn
    // Line number table:
    //   Java source line #426	-> byte code offset #0
    //   Java source line #428	-> byte code offset #8
    //   Java source line #429	-> byte code offset #11
    //   Java source line #431	-> byte code offset #14
    //   Java source line #432	-> byte code offset #41
    //   Java source line #433	-> byte code offset #59
    //   Java source line #434	-> byte code offset #66
    //   Java source line #435	-> byte code offset #74
    //   Java source line #436	-> byte code offset #76
    //   Java source line #437	-> byte code offset #81
    //   Java source line #436	-> byte code offset #84
    //   Java source line #438	-> byte code offset #89
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	92	0	this	JarComparator
    //   0	92	1	inputStream	InputStream
    //   0	92	2	entry	String
    //   0	92	3	size	long
    //   6	56	5	firstEntryClassFileBytes	byte[]
    //   9	81	6	tempFile	File
    //   12	73	7	stream	java.io.BufferedOutputStream
    //   74	8	8	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   14	74	74	finally
  }
  
  private boolean isSigningEntry(String entry)
  {
    return (entry.startsWith("meta-inf/")) && ((entry.endsWith(".sf")) || (entry.endsWith(".rsa")) || (entry.endsWith(".dsa")));
  }
}

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

import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.URIUtil;
import org.eclipse.equinox.p2.internal.repository.tools.Messages;
import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository;
import org.eclipse.equinox.p2.repository.tools.comparator.IArtifactComparator;
import org.eclipse.osgi.util.NLS;

public class MD5ArtifactComparator
  implements IArtifactComparator
{
  public static String MD5_COMPARATOR_ID = "org.eclipse.equinox.artifact.md5.comparator";
  
  public IStatus compare(IArtifactRepository source, IArtifactDescriptor sourceDescriptor, IArtifactRepository destination, IArtifactDescriptor destDescriptor)
  {
    String sourceMD5 = sourceDescriptor.getProperty("download.md5");
    String destMD5 = destDescriptor.getProperty("download.md5");
    if ((sourceMD5 == null) && (destMD5 == null)) {
      return new Status(1, "org.eclipse.equinox.p2.artifact.repository", NLS.bind(Messages.info_noMD5Infomation, sourceDescriptor));
    }
    if (sourceMD5 == null) {
      return new Status(1, "org.eclipse.equinox.p2.artifact.repository", NLS.bind(Messages.info_noMD5InRepository, source, sourceDescriptor));
    }
    if (destMD5 == null) {
      return new Status(1, "org.eclipse.equinox.p2.artifact.repository", NLS.bind(Messages.info_noMD5InRepository, destination, destDescriptor));
    }
    if (sourceMD5.equals(destMD5)) {
      return Status.OK_STATUS;
    }
    return new Status(2, "org.eclipse.equinox.p2.artifact.repository", NLS.bind(Messages.warning_differentMD5, new Object[] { URIUtil.toUnencodedString(sourceDescriptor.getRepository().getLocation()), URIUtil.toUnencodedString(destDescriptor.getRepository().getLocation()), sourceDescriptor }));
  }
}

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

public class Annotation
  extends ClassFileStruct
{
  private static final AnnotationComponent[] NO_ENTRIES = new AnnotationComponent[0];
  private int typeIndex;
  private char[] typeName;
  private int componentsNumber;
  private AnnotationComponent[] components;
  private int readOffset;
  
  public Annotation(byte[] classFileBytes, ConstantPool constantPool, int offset)
    throws ClassFormatException
  {
    int index = u2At(classFileBytes, 0, offset);
    typeIndex = index;
    if (index != 0)
    {
      ConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(index);
      if (constantPoolEntry.getKind() != 1) {
        throw new ClassFormatException(3);
      }
      typeName = constantPoolEntry.getUtf8Value();
    }
    else
    {
      throw new ClassFormatException(3);
    }
    int length = u2At(classFileBytes, 2, offset);
    componentsNumber = length;
    readOffset = 4;
    if (length != 0)
    {
      components = new AnnotationComponent[length];
      for (int i = 0; i < length; i++)
      {
        AnnotationComponent component = new AnnotationComponent(classFileBytes, constantPool, offset + readOffset);
        components[i] = component;
        readOffset += component.sizeInBytes();
      }
    }
    else
    {
      components = NO_ENTRIES;
    }
  }
  
  public int getTypeIndex()
  {
    return typeIndex;
  }
  
  public int getComponentsNumber()
  {
    return componentsNumber;
  }
  
  public AnnotationComponent[] getComponents()
  {
    return components;
  }
  
  int sizeInBytes()
  {
    return readOffset;
  }
  
  public char[] getTypeName()
  {
    return typeName;
  }
}

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

public class AnnotationComponent
  extends ClassFileStruct
{
  private int componentNameIndex;
  private char[] componentName;
  private AnnotationComponentValue componentValue;
  private int readOffset;
  
  public AnnotationComponent(byte[] classFileBytes, ConstantPool constantPool, int offset)
    throws ClassFormatException
  {
    int nameIndex = u2At(classFileBytes, 0, offset);
    componentNameIndex = nameIndex;
    if (nameIndex != 0)
    {
      ConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(nameIndex);
      if (constantPoolEntry.getKind() != 1) {
        throw new ClassFormatException(3);
      }
      componentName = constantPoolEntry.getUtf8Value();
    }
    readOffset = 2;
    AnnotationComponentValue value = new AnnotationComponentValue(classFileBytes, constantPool, offset + readOffset);
    componentValue = value;
    readOffset += value.sizeInBytes();
  }
  
  public int getComponentNameIndex()
  {
    return componentNameIndex;
  }
  
  public char[] getComponentName()
  {
    return componentName;
  }
  
  public AnnotationComponentValue getComponentValue()
  {
    return componentValue;
  }
  
  int sizeInBytes()
  {
    return readOffset;
  }
}

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

public class AnnotationComponentValue
  extends ClassFileStruct
{
  public static final int BYTE_TAG = 66;
  public static final int CHAR_TAG = 67;
  public static final int DOUBLE_TAG = 68;
  public static final int FLOAT_TAG = 70;
  public static final int INTEGER_TAG = 73;
  public static final int LONG_TAG = 74;
  public static final int SHORT_TAG = 83;
  public static final int BOOLEAN_TAG = 90;
  public static final int STRING_TAG = 115;
  public static final int ENUM_TAG = 101;
  public static final int CLASS_TAG = 99;
  public static final int ANNOTATION_TAG = 64;
  public static final int ARRAY_TAG = 91;
  private static final AnnotationComponentValue[] NO_VALUES = new AnnotationComponentValue[0];
  private AnnotationComponentValue[] annotationComponentValues;
  private Annotation annotationValue;
  private ConstantPoolEntry classInfo;
  private int classFileInfoIndex;
  private ConstantPoolEntry constantValue;
  private int constantValueIndex;
  private int enumConstantTypeNameIndex;
  private int enumConstantNameIndex;
  private char[] enumConstantTypeName;
  private char[] enumConstantName;
  private int readOffset;
  private int tag;
  private int valuesNumber;
  
  public AnnotationComponentValue(byte[] classFileBytes, ConstantPool constantPool, int offset)
    throws ClassFormatException
  {
    classFileInfoIndex = -1;
    constantValueIndex = -1;
    enumConstantTypeNameIndex = -1;
    enumConstantNameIndex = -1;
    int t = u1At(classFileBytes, 0, offset);
    tag = t;
    readOffset = 1;
    switch (t)
    {
    case 66: 
    case 67: 
    case 68: 
    case 70: 
    case 73: 
    case 74: 
    case 83: 
    case 90: 
    case 115: 
      int constantIndex = u2At(classFileBytes, readOffset, offset);
      constantValueIndex = constantIndex;
      if (constantIndex != 0)
      {
        ConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(constantIndex);
        switch (constantPoolEntry.getKind())
        {
        case 1: 
        case 3: 
        case 4: 
        case 5: 
        case 6: 
          break;
        case 2: 
        default: 
          throw new ClassFormatException(3);
        }
        constantValue = constantPoolEntry;
      }
      readOffset += 2;
      break;
    case 101: 
      int index = u2At(classFileBytes, readOffset, offset);
      enumConstantTypeNameIndex = index;
      if (index != 0)
      {
        ConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(index);
        if (constantPoolEntry.getKind() != 1) {
          throw new ClassFormatException(3);
        }
        enumConstantTypeName = constantPoolEntry.getUtf8Value();
      }
      readOffset += 2;
      index = u2At(classFileBytes, readOffset, offset);
      enumConstantNameIndex = index;
      if (index != 0)
      {
        ConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(index);
        if (constantPoolEntry.getKind() != 1) {
          throw new ClassFormatException(3);
        }
        enumConstantName = constantPoolEntry.getUtf8Value();
      }
      readOffset += 2;
      break;
    case 99: 
      int classFileIndex = u2At(classFileBytes, readOffset, offset);
      classFileInfoIndex = classFileIndex;
      if (classFileIndex != 0)
      {
        ConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(classFileIndex);
        if (constantPoolEntry.getKind() != 1) {
          throw new ClassFormatException(3);
        }
        classInfo = constantPoolEntry;
      }
      readOffset += 2;
      break;
    case 64: 
      Annotation annotation = new Annotation(classFileBytes, constantPool, readOffset + offset);
      annotationValue = annotation;
      readOffset += annotation.sizeInBytes();
      break;
    case 91: 
      int numberOfValues = u2At(classFileBytes, readOffset, offset);
      valuesNumber = numberOfValues;
      readOffset += 2;
      if (numberOfValues != 0)
      {
        annotationComponentValues = new AnnotationComponentValue[numberOfValues];
        for (int i = 0; i < numberOfValues; i++)
        {
          AnnotationComponentValue value = new AnnotationComponentValue(classFileBytes, constantPool, offset + readOffset);
          annotationComponentValues[i] = value;
          readOffset += value.sizeInBytes();
        }
      }
      else
      {
        annotationComponentValues = NO_VALUES;
      }
      break;
    }
  }
  
  public AnnotationComponentValue[] getAnnotationComponentValues()
  {
    return annotationComponentValues;
  }
  
  public Annotation getAnnotationValue()
  {
    return annotationValue;
  }
  
  public ConstantPoolEntry getClassInfo()
  {
    return classInfo;
  }
  
  public int getClassInfoIndex()
  {
    return classFileInfoIndex;
  }
  
  public ConstantPoolEntry getConstantValue()
  {
    return constantValue;
  }
  
  public int getConstantValueIndex()
  {
    return constantValueIndex;
  }
  
  public char[] getEnumConstantName()
  {
    return enumConstantName;
  }
  
  public int getEnumConstantNameIndex()
  {
    return enumConstantNameIndex;
  }
  
  public char[] getEnumConstantTypeName()
  {
    return enumConstantTypeName;
  }
  
  public int getEnumConstantTypeNameIndex()
  {
    return enumConstantTypeNameIndex;
  }
  
  public int getTag()
  {
    return tag;
  }
  
  public int getValuesNumber()
  {
    return valuesNumber;
  }
  
  int sizeInBytes()
  {
    return readOffset;
  }
}

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

public class AnnotationDefaultAttribute
  extends ClassFileAttribute
{
  private AnnotationComponentValue memberValue;
  
  public AnnotationDefaultAttribute(byte[] classFileBytes, ConstantPool constantPool, int offset)
    throws ClassFormatException
  {
    super(classFileBytes, constantPool, offset);
    memberValue = new AnnotationComponentValue(classFileBytes, constantPool, offset + 6);
  }
  
  public AnnotationComponentValue getMemberValue()
  {
    return memberValue;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.p2.internal.repository.comparator.java.AnnotationDefaultAttribute
 * 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 AttributeNamesConstants
{
  public static final char[] SYNTHETIC = "Synthetic".toCharArray();
  public static final char[] CONSTANT_VALUE = "ConstantValue".toCharArray();
  public static final char[] LINE_NUMBER = "LineNumberTable".toCharArray();
  public static final char[] LOCAL_VARIABLE = "LocalVariableTable".toCharArray();
  public static final char[] INNER_CLASSES = "InnerClasses".toCharArray();
  public static final char[] CODE = "Code".toCharArray();
  public static final char[] EXCEPTIONS = "Exceptions".toCharArray();
  public static final char[] SOURCE = "SourceFile".toCharArray();
  public static final char[] DEPRECATED = "Deprecated".toCharArray();
  public static final char[] SIGNATURE = "Signature".toCharArray();
  public static final char[] ENCLOSING_METHOD = "EnclosingMethod".toCharArray();
  public static final char[] LOCAL_VARIABLE_TYPE_TABLE = "LocalVariableTypeTable".toCharArray();
  public static final char[] RUNTIME_VISIBLE_ANNOTATIONS = "RuntimeVisibleAnnotations".toCharArray();
  public static final char[] RUNTIME_INVISIBLE_ANNOTATIONS = "RuntimeInvisibleAnnotations".toCharArray();
  public static final char[] RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS = "RuntimeVisibleParameterAnnotations".toCharArray();
  public static final char[] RUNTIME_INVISIBLE_PARAMETER_ANNOTATIONS = "RuntimeInvisibleParameterAnnotations".toCharArray();
  public static final char[] ANNOTATION_DEFAULT = "AnnotationDefault".toCharArray();
  public static final char[] STACK_MAP_TABLE = "StackMapTable".toCharArray();
  public static final char[] STACK_MAP = "StackMap".toCharArray();
  public static final char[] VAR_ARGS = "Varargs".toCharArray();
}

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

public final class CharOperation
{
  public static final char[] This = "this".toCharArray();
  public static final char[] JAVA_LANG_ANNOTATION_DOCUMENTED = "Ljava/lang/annotation/Documented;".toCharArray();
  public static final char[] JAVA_LANG_ANNOTATION_ELEMENTTYPE = "Ljava/lang/annotation/ElementType;".toCharArray();
  public static final char[] JAVA_LANG_ANNOTATION_RETENTION = "Ljava/lang/annotation/Retention;".toCharArray();
  public static final char[] JAVA_LANG_ANNOTATION_RETENTIONPOLICY = "Ljava/lang/annotation/RetentionPolicy;".toCharArray();
  public static final char[] JAVA_LANG_ANNOTATION_TARGET = "Ljava/lang/annotation/Target;".toCharArray();
  public static final char[] JAVA_LANG_DEPRECATED = "Ljava/lang/Deprecated;".toCharArray();
  public static final char[] JAVA_LANG_ANNOTATION_INHERITED = "Ljava/lang/annotation/Inherited;".toCharArray();
  public static final char[] NO_CHAR = new char[0];
  public static final char[][] NO_CHAR_CHAR = new char[0][];
  
  public static final int hashCode(char[] array)
  {
    int length = array.length;
    int hash = length == 0 ? '\037' : array[0];
    if (length < 8)
    {
      int i = length;
      do
      {
        hash = hash * 31 + array[i];i--;
      } while (i > 0);
    }
    else
    {
      int i = length - 1;
      for (int last = i > 16 ? i - 16 : 0; i > last; i -= 2) {
        hash = hash * 31 + array[i];
      }
    }
    return hash & 0x7FFFFFFF;
  }
  
  public static final int lastIndexOf(char toBeFound, char[] array)
  {
    int i = array.length;
    do
    {
      if (toBeFound == array[i]) {
        return i;
      }
      i--;
    } while (i >= 0);
    return -1;
  }
  
  public static final char[][] splitOn(char divider, char[] array)
  {
    int length = array == null ? 0 : array.length;
    if (length == 0) {
      return NO_CHAR_CHAR;
    }
    int wordCount = 1;
    for (int i = 0; i < length; i++) {
      if (array[i] == divider) {
        wordCount++;
      }
    }
    char[][] split = new char[wordCount][];
    int last = 0;int currentWord = 0;
    for (int i = 0; i < length; i++) {
      if (array[i] == divider)
      {
        split[currentWord] = new char[i - last];
        System.arraycopy(array, last, split[(currentWord++)], 0, i - last);
        last = i + 1;
      }
    }
    split[currentWord] = new char[length - last];
    System.arraycopy(array, last, split[currentWord], 0, length - last);
    return split;
  }
  
  public static final int indexOf(char toBeFound, char[] array, int start)
  {
    for (int i = start; i < array.length; i++) {
      if (toBeFound == array[i]) {
        return i;
      }
    }
    return -1;
  }
  
  public static final char[] concat(char prefix, char[] array, char suffix)
  {
    if (array == null) {
      return new char[] { prefix, suffix };
    }
    int length = array.length;
    char[] result = new char[length + 2];
    result[0] = prefix;
    System.arraycopy(array, 0, result, 1, length);
    result[(length + 1)] = suffix;
    return result;
  }
  
  public static final char[] concat(char[] first, char[] second, char[] third)
  {
    if (first == null) {
      return concat(second, third);
    }
    if (second == null) {
      return concat(first, third);
    }
    if (third == null) {
      return concat(first, second);
    }
    int length1 = first.length;
    int length2 = second.length;
    int length3 = third.length;
    char[] result = new char[length1 + length2 + length3];
    System.arraycopy(first, 0, result, 0, length1);
    System.arraycopy(second, 0, result, length1, length2);
    System.arraycopy(third, 0, result, length1 + length2, length3);
    return result;
  }
  
  public static final char[] concat(char[] first, char[] second)
  {
    if (first == null) {
      return second;
    }
    if (second == null) {
      return first;
    }
    int length1 = first.length;
    int length2 = second.length;
    char[] result = new char[length1 + length2];
    System.arraycopy(first, 0, result, 0, length1);
    System.arraycopy(second, 0, result, length1, length2);
    return result;
  }
  
  public static final void replace(char[] array, char toBeReplaced, char replacementChar)
  {
    if (toBeReplaced != replacementChar)
    {
      int i = 0;
      for (int max = array.length; i < max; i++) {
        if (array[i] == toBeReplaced) {
          array[i] = replacementChar;
        }
      }
    }
  }
  
  public static final char[] replaceOnCopy(char[] array, char toBeReplaced, char replacementChar)
  {
    char[] result = (char[])null;
    int i = 0;
    for (int length = array.length; i < length; i++)
    {
      char c = array[i];
      if (c == toBeReplaced)
      {
        if (result == null)
        {
          result = new char[length];
          System.arraycopy(array, 0, result, 0, i);
        }
        result[i] = replacementChar;
      }
      else if (result != null)
      {
        result[i] = c;
      }
    }
    if (result == null) {
      return array;
    }
    return result;
  }
  
  public static final int indexOf(char toBeFound, char[] array)
  {
    return indexOf(toBeFound, array, 0);
  }
  
  public static final char[] subarray(char[] array, int start, int end)
  {
    if (end == -1) {
      end = array.length;
    }
    if (start > end) {
      return null;
    }
    if (start < 0) {
      return null;
    }
    if (end > array.length) {
      return null;
    }
    char[] result = new char[end - start];
    System.arraycopy(array, start, result, 0, end - start);
    return result;
  }
  
  public static final char[][] subarray(char[][] array, int start, int end)
  {
    if (end == -1) {
      end = array.length;
    }
    if (start > end) {
      return null;
    }
    if (start < 0) {
      return null;
    }
    if (end > array.length) {
      return null;
    }
    char[][] result = new char[end - start][];
    System.arraycopy(array, start, result, 0, end - start);
    return result;
  }
  
  public static final char[][] splitOn(char divider, char[] array, int start, int end)
  {
    int length = array == null ? 0 : array.length;
    if ((length == 0) || (start > end)) {
      return NO_CHAR_CHAR;
    }
    int wordCount = 1;
    for (int i = start; i < end; i++) {
      if (array[i] == divider) {
        wordCount++;
      }
    }
    char[][] split = new char[wordCount][];
    int last = start;int currentWord = 0;
    for (int i = start; i < end; i++) {
      if (array[i] == divider)
      {
        split[currentWord] = new char[i - last];
        System.arraycopy(array, last, split[(currentWord++)], 0, i - last);
        last = i + 1;
      }
    }
    split[currentWord] = new char[end - last];
    System.arraycopy(array, last, split[currentWord], 0, end - last);
    return split;
  }
}

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

public class ClassFileAttribute
  extends ClassFileStruct
{
  public static final ClassFileAttribute[] NO_ATTRIBUTES = new ClassFileAttribute[0];
  private long attributeLength;
  private int attributeNameIndex;
  private char[] attributeName;
  
  public ClassFileAttribute(byte[] classFileBytes, ConstantPool constantPool, int offset)
    throws ClassFormatException
  {
    attributeNameIndex = u2At(classFileBytes, 0, offset);
    attributeLength = u4At(classFileBytes, 2, offset);
    ConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(attributeNameIndex);
    if (constantPoolEntry.getKind() != 1) {
      throw new ClassFormatException(3);
    }
    attributeName = constantPoolEntry.getUtf8Value();
  }
  
  public int getAttributeNameIndex()
  {
    return attributeNameIndex;
  }
  
  public char[] getAttributeName()
  {
    return attributeName;
  }
  
  public long getAttributeLength()
  {
    return attributeLength;
  }
}

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

import java.util.Arrays;

public class ClassFileReader
  extends ClassFileStruct
{
  public static final int ALL = 65535;
  public static final int CONSTANT_POOL = 1;
  public static final int METHOD_INFOS = 3;
  public static final int FIELD_INFOS = 5;
  public static final int SUPER_INTERFACES = 9;
  public static final int CLASSFILE_ATTRIBUTES = 17;
  public static final int METHOD_BODIES = 32;
  public static final int ALL_BUT_METHOD_BODIES = 65503;
  private static final FieldInfo[] NO_FIELD_INFOS = new FieldInfo[0];
  private static final char[][] NO_INTERFACES_NAMES = CharOperation.NO_CHAR_CHAR;
  private static final MethodInfo[] NO_METHOD_INFOS = new MethodInfo[0];
  private int accessFlags;
  private ClassFileAttribute[] attributes;
  private int attributesCount;
  private char[] className;
  private int classNameIndex;
  private ConstantPool constantPool;
  private FieldInfo[] fields;
  private int fieldsCount;
  private InnerClassesAttribute innerClassesAttribute;
  private int[] interfaceIndexes;
  private char[][] interfaceNames;
  private int interfacesCount;
  private int magicNumber;
  private int majorVersion;
  private MethodInfo[] methods;
  private int methodsCount;
  private int minorVersion;
  private SourceFileAttribute sourceFileAttribute;
  private char[] superclassName;
  private int superclassNameIndex;
  
  public ClassFileReader(byte[] classFileBytes, int decodingFlags)
    throws ClassFormatException
  {
    try
    {
      magicNumber = ((int)u4At(classFileBytes, 0, 0));
      if (magicNumber != -889275714) {
        throw new ClassFormatException(8);
      }
      int readOffset = 10;
      minorVersion = u2At(classFileBytes, 4, 0);
      majorVersion = u2At(classFileBytes, 6, 0);
      if ((decodingFlags & 0x1) == 0) {
        return;
      }
      int constantPoolCount = u2At(classFileBytes, 8, 0);
      
      int[] constantPoolOffsets = new int[constantPoolCount];
      for (int i = 1; i < constantPoolCount; i++)
      {
        int tag = u1At(classFileBytes, readOffset, 0);
        switch (tag)
        {
        case 1: 
          constantPoolOffsets[i] = readOffset;
          readOffset += u2At(classFileBytes, readOffset + 1, 0);
          readOffset += 3;
          break;
        case 3: 
          constantPoolOffsets[i] = readOffset;
          readOffset += 5;
          break;
        case 4: 
          constantPoolOffsets[i] = readOffset;
          readOffset += 5;
          break;
        case 5: 
          constantPoolOffsets[i] = readOffset;
          readOffset += 9;
          i++;
          break;
        case 6: 
          constantPoolOffsets[i] = readOffset;
          readOffset += 9;
          i++;
          break;
        case 7: 
          constantPoolOffsets[i] = readOffset;
          readOffset += 3;
          break;
        case 8: 
          constantPoolOffsets[i] = readOffset;
          readOffset += 3;
          break;
        case 9: 
          constantPoolOffsets[i] = readOffset;
          readOffset += 5;
          break;
        case 10: 
          constantPoolOffsets[i] = readOffset;
          readOffset += 5;
          break;
        case 11: 
          constantPoolOffsets[i] = readOffset;
          readOffset += 5;
          break;
        case 12: 
          constantPoolOffsets[i] = readOffset;
          readOffset += 5;
          break;
        case 2: 
        default: 
          throw new ClassFormatException(7);
        }
      }
      constantPool = new ConstantPool(classFileBytes, constantPoolOffsets);
      
      accessFlags = u2At(classFileBytes, readOffset, 0);
      readOffset += 2;
      
      classNameIndex = u2At(classFileBytes, readOffset, 0);
      className = getConstantClassNameAt(classFileBytes, constantPoolOffsets, classNameIndex);
      readOffset += 2;
      
      superclassNameIndex = u2At(classFileBytes, readOffset, 0);
      readOffset += 2;
      if (superclassNameIndex != 0) {
        superclassName = getConstantClassNameAt(classFileBytes, constantPoolOffsets, superclassNameIndex);
      }
      interfacesCount = u2At(classFileBytes, readOffset, 0);
      readOffset += 2;
      interfaceNames = NO_INTERFACES_NAMES;
      interfaceIndexes = Utility.EMPTY_INT_ARRAY;
      if (interfacesCount != 0) {
        if ((decodingFlags & 0x9) != 1)
        {
          interfaceNames = new char[interfacesCount][];
          interfaceIndexes = new int[interfacesCount];
          for (int i = 0; i < interfacesCount; i++)
          {
            interfaceIndexes[i] = u2At(classFileBytes, readOffset, 0);
            interfaceNames[i] = getConstantClassNameAt(classFileBytes, constantPoolOffsets, interfaceIndexes[i]);
            readOffset += 2;
          }
        }
        else
        {
          readOffset += 2 * interfacesCount;
        }
      }
      fieldsCount = u2At(classFileBytes, readOffset, 0);
      readOffset += 2;
      fields = NO_FIELD_INFOS;
      if (fieldsCount != 0) {
        if ((decodingFlags & 0x5) != 1)
        {
          fields = new FieldInfo[fieldsCount];
          for (int i = 0; i < fieldsCount; i++)
          {
            FieldInfo field = new FieldInfo(classFileBytes, constantPool, readOffset);
            fields[i] = field;
            readOffset += field.sizeInBytes();
          }
        }
        else
        {
          for (int i = 0; i < fieldsCount; i++)
          {
            int attributeCountForField = u2At(classFileBytes, 6, readOffset);
            readOffset += 8;
            if (attributeCountForField != 0) {
              for (int j = 0; j < attributeCountForField; j++)
              {
                int attributeLength = (int)u4At(classFileBytes, 2, readOffset);
                readOffset += 6 + attributeLength;
              }
            }
          }
        }
      }
      methodsCount = u2At(classFileBytes, readOffset, 0);
      readOffset += 2;
      methods = NO_METHOD_INFOS;
      if (methodsCount != 0) {
        if ((decodingFlags & 0x3) != 1)
        {
          methods = new MethodInfo[methodsCount];
          for (int i = 0; i < methodsCount; i++)
          {
            MethodInfo method = new MethodInfo(classFileBytes, constantPool, readOffset, decodingFlags);
            methods[i] = method;
            readOffset += method.sizeInBytes();
          }
        }
        else
        {
          for (int i = 0; i < methodsCount; i++)
          {
            int attributeCountForMethod = u2At(classFileBytes, 6, readOffset);
            readOffset += 8;
            if (attributeCountForMethod != 0) {
              for (int j = 0; j < attributeCountForMethod; j++)
              {
                int attributeLength = (int)u4At(classFileBytes, 2, readOffset);
                readOffset += 6 + attributeLength;
              }
            }
          }
        }
      }
      attributesCount = u2At(classFileBytes, readOffset, 0);
      readOffset += 2;
      
      int attributesIndex = 0;
      attributes = ClassFileAttribute.NO_ATTRIBUTES;
      if (attributesCount != 0) {
        if ((decodingFlags & 0x11) != 1)
        {
          attributes = new ClassFileAttribute[attributesCount];
          for (int i = 0; i < attributesCount; i++)
          {
            int utf8Offset = constantPoolOffsets[u2At(classFileBytes, readOffset, 0)];
            char[] attributeName = utf8At(classFileBytes, utf8Offset + 3, 0, u2At(classFileBytes, utf8Offset + 1, 0));
            if (Arrays.equals(attributeName, AttributeNamesConstants.INNER_CLASSES))
            {
              innerClassesAttribute = new InnerClassesAttribute(classFileBytes, constantPool, readOffset);
              attributes[(attributesIndex++)] = innerClassesAttribute;
            }
            else if (Arrays.equals(attributeName, AttributeNamesConstants.SOURCE))
            {
              sourceFileAttribute = new SourceFileAttribute(classFileBytes, constantPool, readOffset);
              attributes[(attributesIndex++)] = sourceFileAttribute;
            }
            else if (Arrays.equals(attributeName, AttributeNamesConstants.ENCLOSING_METHOD))
            {
              attributes[(attributesIndex++)] = new EnclosingMethodAttribute(classFileBytes, constantPool, readOffset);
            }
            else if (Arrays.equals(attributeName, AttributeNamesConstants.SIGNATURE))
            {
              attributes[(attributesIndex++)] = new SignatureAttribute(classFileBytes, constantPool, readOffset);
            }
            else if (Arrays.equals(attributeName, AttributeNamesConstants.RUNTIME_VISIBLE_ANNOTATIONS))
            {
              attributes[(attributesIndex++)] = new RuntimeVisibleAnnotationsAttribute(classFileBytes, constantPool, readOffset);
            }
            else if (Arrays.equals(attributeName, AttributeNamesConstants.RUNTIME_INVISIBLE_ANNOTATIONS))
            {
              attributes[(attributesIndex++)] = new RuntimeInvisibleAnnotationsAttribute(classFileBytes, constantPool, readOffset);
            }
            else
            {
              attributes[(attributesIndex++)] = new ClassFileAttribute(classFileBytes, constantPool, readOffset);
            }
            readOffset = (int)(readOffset + (6L + u4At(classFileBytes, readOffset + 2, 0)));
          }
        }
        else
        {
          for (int i = 0; i < attributesCount; i++) {
            readOffset = (int)(readOffset + (6L + u4At(classFileBytes, readOffset + 2, 0)));
          }
        }
      }
      if (readOffset != classFileBytes.length) {
        throw new ClassFormatException(4);
      }
    }
    catch (ClassFormatException e)
    {
      throw e;
    }
    catch (ArrayIndexOutOfBoundsException localArrayIndexOutOfBoundsException)
    {
      throw new ClassFormatException(2);
    }
    catch (Exception e)
    {
      e.printStackTrace();
      throw new ClassFormatException(2);
    }
    int[] constantPoolOffsets;
    int constantPoolCount;
  }
  
  public int getAccessFlags()
  {
    return accessFlags;
  }
  
  public int getAttributeCount()
  {
    return attributesCount;
  }
  
  public ClassFileAttribute[] getAttributes()
  {
    return attributes;
  }
  
  public int getClassIndex()
  {
    return classNameIndex;
  }
  
  public char[] getClassName()
  {
    return className;
  }
  
  private char[] getConstantClassNameAt(byte[] classFileBytes, int[] constantPoolOffsets, int constantPoolIndex)
  {
    int utf8Offset = constantPoolOffsets[u2At(classFileBytes, constantPoolOffsets[constantPoolIndex] + 1, 0)];
    return utf8At(classFileBytes, utf8Offset + 3, 0, u2At(classFileBytes, utf8Offset + 1, 0));
  }
  
  public ConstantPool getConstantPool()
  {
    return constantPool;
  }
  
  public FieldInfo[] getFieldInfos()
  {
    return fields;
  }
  
  public int getFieldsCount()
  {
    return fieldsCount;
  }
  
  public InnerClassesAttribute getInnerClassesAttribute()
  {
    return innerClassesAttribute;
  }
  
  public int[] getInterfaceIndexes()
  {
    return interfaceIndexes;
  }
  
  public char[][] getInterfaceNames()
  {
    return interfaceNames;
  }
  
  public int getMagic()
  {
    return magicNumber;
  }
  
  public int getMajorVersion()
  {
    return majorVersion;
  }
  
  public MethodInfo[] getMethodInfos()
  {
    return methods;
  }
  
  public int getMethodsCount()
  {
    return methodsCount;
  }
  
  public int getMinorVersion()
  {
    return minorVersion;
  }
  
  public SourceFileAttribute getSourceFileAttribute()
  {
    return sourceFileAttribute;
  }
  
  public int getSuperclassIndex()
  {
    return superclassNameIndex;
  }
  
  public char[] getSuperclassName()
  {
    return superclassName;
  }
  
  public boolean isClass()
  {
    return !isInterface();
  }
  
  public boolean isInterface()
  {
    return (getAccessFlags() & 0x200) != 0;
  }
}

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

public abstract class ClassFileStruct
{
  protected double doubleAt(byte[] reference, int relativeOffset, int structOffset)
  {
    return Double.longBitsToDouble(i8At(reference, relativeOffset, structOffset));
  }
  
  protected float floatAt(byte[] reference, int relativeOffset, int structOffset)
  {
    return Float.intBitsToFloat(i4At(reference, relativeOffset, structOffset));
  }
  
  protected int i1At(byte[] reference, int relativeOffset, int structOffset)
  {
    return reference[(relativeOffset + structOffset)];
  }
  
  protected int i2At(byte[] reference, int relativeOffset, int structOffset)
  {
    int position = relativeOffset + structOffset;
    return (reference[(position++)] << 8) + (reference[position] & 0xFF);
  }
  
  protected int i4At(byte[] reference, int relativeOffset, int structOffset)
  {
    int position = relativeOffset + structOffset;
    return ((reference[(position++)] & 0xFF) << 24) + ((reference[(position++)] & 0xFF) << 16) + ((reference[(position++)] & 0xFF) << 8) + (reference[position] & 0xFF);
  }
  
  protected long i8At(byte[] reference, int relativeOffset, int structOffset)
  {
    int posi
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