org.eclipse.pde.api.tools_1.0.301.v20111129-2053

   break;
                    }
                  }
                }
              }
            }
          }
          addDelta(
            getElementType(type), 
            1, 
            found ? 67 : 25, 
            restrictionsForMethodAddition, 
            initialDescriptorRestrictions, 
            0, 
            method.getModifiers(), 
            type1, 
            getKeyForMethod(method, type), 
            new String[] { Util.getDescriptorName(type), methodDisplayName });
        }
        else
        {
          addDelta(
            getElementType(type), 
            1, 
            found ? 36 : 25, 
            restrictionsForMethodAddition, 
            initialDescriptorRestrictions, 
            0, 
            method.getModifiers(), 
            type1, 
            getKeyForMethod(method, type), 
            new String[] { Util.getDescriptorName(type), methodDisplayName });
        }
      }
    }
    else {
      addDelta(
        getElementType(type), 
        1, 
        method.isConstructor() ? 8 : 25, 
        restrictionsForMethodAddition, 
        initialDescriptorRestrictions, 
        0, 
        method.getModifiers(), 
        type1, 
        getKeyForMethod(method, type), 
        new String[] { Util.getDescriptorName(type), methodDisplayName });
    }
  }
  
  private String getKeyForMethod(IApiMethod method, IApiType type)
  {
    StringBuffer buffer = new StringBuffer();
    if (method.isConstructor())
    {
      String name = type.getName();
      int index = name.lastIndexOf('.');
      int dollarIndex = name.lastIndexOf('$');
      if ((dollarIndex != -1) && (type.isMemberType())) {
        buffer.append(type.getName().substring(dollarIndex + 1));
      } else {
        buffer.append(type.getName().substring(index + 1));
      }
    }
    else
    {
      buffer.append(method.getName());
    }
    String genericSignature = method.getGenericSignature();
    if (genericSignature != null) {
      buffer.append(genericSignature);
    } else {
      buffer.append(method.getSignature());
    }
    return String.valueOf(buffer);
  }
  
  private static boolean isAPI(int visibility, IApiType memberTypeDescriptor)
  {
    int access = memberTypeDescriptor.getModifiers();
    
    return (VisibilityModifiers.isAPI(visibility)) && ((Flags.isPublic(access)) || (Flags.isProtected(access)));
  }
  
  private IApiTypeRoot getType(String typeName, IApiComponent component, IApiBaseline baseline)
    throws CoreException
  {
    String packageName = Signatures.getPackageName(typeName);
    IApiComponent[] components = baseline.resolvePackage(component, packageName);
    if (components == null)
    {
      String msg = MessageFormat.format(ComparatorMessages.ClassFileComparator_1, new String[] { packageName, baseline.getName(), component.getSymbolicName() });
      if (Debug) {
        System.err.println("TYPE LOOKUP: " + msg);
      }
      reportStatus(new Status(4, component.getSymbolicName(), msg));
      return null;
    }
    IApiTypeRoot result = Util.getClassFile(components, typeName);
    if (result == null)
    {
      String msg = MessageFormat.format(ComparatorMessages.ClassFileComparator_2, new String[] { typeName, baseline.getName(), component.getSymbolicName() });
      if (Debug) {
        System.err.println("TYPE LOOKUP: " + msg);
      }
      reportStatus(new Status(4, component.getSymbolicName(), msg));
      return null;
    }
    return result;
  }
  
  private int getElementType(IApiType type)
  {
    if (type.isAnnotation()) {
      return 1;
    }
    if (type.isEnum()) {
      return 6;
    }
    if (type.isInterface()) {
      return 8;
    }
    return 4;
  }
  
  private int getElementType(IApiMethod method)
  {
    if (method.isConstructor()) {
      return 5;
    }
    return 9;
  }
  
  private int getTargetType(IApiMethod method)
  {
    if (method.isConstructor()) {
      return 8;
    }
    return 25;
  }
  
  private int getElementType(IApiMember member)
  {
    switch (member.getType())
    {
    case 2: 
      return getElementType((IApiType)member);
    case 6: 
      return getElementType((IApiMethod)member);
    }
    return 7;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.internal.comparator.ClassFileComparator
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.internal.comparator;

import org.eclipse.osgi.util.NLS;

public class ComparatorMessages
  extends NLS
{
  private static final String BUNDLE_NAME = "org.eclipse.pde.api.tools.internal.comparator.comparatormessages";
  public static String ClassFileComparator_0;
  public static String ClassFileComparator_1;
  public static String ClassFileComparator_2;
  
  static
  {
    NLS.initializeMessages("org.eclipse.pde.api.tools.internal.comparator.comparatormessages", ComparatorMessages.class);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.internal.comparator.ComparatorMessages
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.internal.comparator;

import java.io.PrintWriter;
import java.io.StringWriter;
import org.eclipse.pde.api.tools.internal.problems.ApiProblemFactory;
import org.eclipse.pde.api.tools.internal.provisional.comparator.DeltaProcessor;
import org.eclipse.pde.api.tools.internal.provisional.comparator.DeltaVisitor;
import org.eclipse.pde.api.tools.internal.provisional.comparator.IDelta;
import org.eclipse.pde.api.tools.internal.util.Util;

public class Delta
  implements IDelta
{
  private static final IDelta[] EMPTY_CHILDREN = new IDelta[0];
  private static final int INITIAL_SIZE = 4;
  public static final int MODIFIERS_MASK = 65535;
  public static final int NEW_MODIFIERS_OFFSET = 16;
  public static final int RESTRICTIONS_MASK = 65535;
  public static final int PREVIOUS_RESTRICTIONS_OFFSET = 16;
  private IDelta[] children;
  private String componentID;
  private String[] datas;
  private int deltasCounter;
  private int elementType;
  private int flags;
  private String key;
  private int kind;
  private int modifiers;
  private int restrictions;
  private String typeName;
  
  private static void print(IDelta delta, PrintWriter writer)
  {
    writer.print("delta (elementType: ");
    switch (delta.getElementType())
    {
    case 7: 
      writer.print("field");
      break;
    case 1: 
      writer.print("annotation type");
      break;
    case 4: 
      writer.print("class type");
      break;
    case 8: 
      writer.print("interface type");
      break;
    case 6: 
      writer.print("enum type");
      break;
    case 2: 
      writer.print("API component type");
      break;
    case 9: 
      writer.print("method");
      break;
    case 5: 
      writer.print("constructor");
      break;
    case 3: 
      writer.print("API baseline");
    }
    writer.print(", kind : ");
    writer.print(delta.getKind());
    writer.print(", flags : ");
    writer.print(delta.getFlags());
    writer.print(')');
    writer.print('-');
    writer.print(Util.getDetail(delta));
  }
  
  public Delta() {}
  
  public Delta(String componentID, int elementType, int kind, int flags, int restrictions, int oldModifiers, int newModifiers, String typeName, String key, String data)
  {
    this(componentID, elementType, kind, flags, restrictions, 0, oldModifiers, newModifiers, typeName, key, new String[] { data });
  }
  
  public Delta(String componentID, int elementType, int kind, int flags, int restrictions, int previousRestrictions, int oldModifiers, int newModifiers, String typeName, String key, String[] datas)
  {
    this.componentID = componentID;
    this.elementType = elementType;
    this.kind = kind;
    this.flags = flags;
    modifiers = ((newModifiers & 0xFFFF) << 16 | oldModifiers & 0xFFFF);
    this.typeName = (typeName == null ? "" : typeName);
    this.restrictions = ((previousRestrictions & 0xFFFF) << 16 | restrictions & 0xFFFF);
    this.key = key;
    this.datas = datas;
  }
  
  public Delta(String componentID, int elementType, int kind, int flags, String typeName, String key, String data)
  {
    this(componentID, elementType, kind, flags, 0, 0, 0, typeName, key, data);
  }
  
  public void accept(DeltaVisitor visitor)
  {
    if ((visitor.visit(this)) && 
      (children != null))
    {
      int i = 0;
      for (int max = deltasCounter; i < max; i++)
      {
        IDelta delta = children[i];
        delta.accept(visitor);
      }
    }
    visitor.endVisit(this);
  }
  
  public void add(IDelta delta)
  {
    if (delta == null) {
      return;
    }
    if (children == null)
    {
      children = new Delta[4];
      deltasCounter = 0;
    }
    int length = children.length;
    if (deltasCounter == length) {
      System.arraycopy(children, 0, children = new IDelta[length * 2], 0, length);
    }
    children[(deltasCounter++)] = delta;
  }
  
  public boolean equals(Object obj)
  {
    if (this == obj) {
      return true;
    }
    if (obj == null) {
      return false;
    }
    if (!(obj instanceof Delta)) {
      return false;
    }
    Delta other = (Delta)obj;
    if (elementType != elementType) {
      return false;
    }
    if (flags != flags) {
      return false;
    }
    if (kind != kind) {
      return false;
    }
    if (modifiers != modifiers) {
      return false;
    }
    if (restrictions != restrictions) {
      return false;
    }
    if (typeName == null)
    {
      if (typeName != null) {
        return false;
      }
    }
    else if (!typeName.equals(typeName)) {
      return false;
    }
    if (key == null)
    {
      if (key != null) {
        return false;
      }
    }
    else if (!key.equals(key)) {
      return false;
    }
    if (datas == null)
    {
      if (datas != null) {
        return false;
      }
    }
    else
    {
      if (datas == null) {
        return false;
      }
      if (datas.length != datas.length) {
        return false;
      }
      int i = 0;
      for (int max = datas.length; i < max; i++) {
        if (!datas[i].equals(datas[i])) {
          return false;
        }
      }
    }
    if (componentID == null)
    {
      if (componentID != null) {
        return false;
      }
    }
    else if (!componentID.equals(componentID)) {
      return false;
    }
    return true;
  }
  
  public String getComponentVersionId()
  {
    return componentID;
  }
  
  public String getComponentId()
  {
    if (componentID == null) {
      return null;
    }
    int index = componentID.indexOf('(');
    return componentID.substring(0, index);
  }
  
  public String[] getArguments()
  {
    if (datas == null) {
      return new String[] { typeName };
    }
    return datas;
  }
  
  public IDelta[] getChildren()
  {
    if (children == null) {
      return EMPTY_CHILDREN;
    }
    int resizeLength = deltasCounter;
    if (resizeLength != children.length) {
      System.arraycopy(children, 0, children = new IDelta[resizeLength], 0, resizeLength);
    }
    return children;
  }
  
  public int getElementType()
  {
    return elementType;
  }
  
  public int getFlags()
  {
    return flags;
  }
  
  public String getKey()
  {
    return key;
  }
  
  public int getKind()
  {
    return kind;
  }
  
  public String getMessage()
  {
    if (DeltaProcessor.isCompatible(this)) {
      return Messages.getCompatibleLocalizedMessage(this);
    }
    int id = ApiProblemFactory.getProblemMessageId(268435456, 
      elementType, kind, flags);
    return ApiProblemFactory.getLocalizedMessage(id, datas != null ? datas : null);
  }
  
  public int getNewModifiers()
  {
    return modifiers >>> 16;
  }
  
  public int getOldModifiers()
  {
    return modifiers & 0xFFFF;
  }
  
  public int getCurrentRestrictions()
  {
    return restrictions & 0xFFFF;
  }
  
  public int getPreviousRestrictions()
  {
    return restrictions >>> 16;
  }
  
  public String getTypeName()
  {
    return typeName;
  }
  
  public int hashCode()
  {
    int result = 1;
    result = 31 * result + (datas == null ? 0 : datas.hashCode());
    result = 31 * result + elementType;
    result = 31 * result + flags;
    result = 31 * result + (key == null ? 0 : key.hashCode());
    result = 31 * result + (typeName == null ? 0 : typeName.hashCode());
    result = 31 * result + kind;
    result = 31 * result + modifiers;
    result = 31 * result + restrictions;
    result = 31 * result + (componentID == null ? 0 : componentID.hashCode());
    return result;
  }
  
  public boolean isEmpty()
  {
    return deltasCounter == 0;
  }
  
  public String toString()
  {
    StringWriter writer = new StringWriter();
    PrintWriter printWriter = new PrintWriter(writer);
    if (children == null)
    {
      print(this, printWriter);
    }
    else
    {
      printWriter.print('[');
      int i = 0;
      for (int max = deltasCounter; i < max; i++)
      {
        if (i > 0) {
          printWriter.println(',');
        }
        printWriter.print(children[i]);
      }
      printWriter.print(']');
    }
    return String.valueOf(writer.getBuffer());
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.internal.comparator.Delta
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.internal.comparator;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.pde.api.tools.internal.provisional.comparator.ApiComparator;
import org.eclipse.pde.api.tools.internal.provisional.comparator.DeltaProcessor;
import org.eclipse.pde.api.tools.internal.provisional.comparator.DeltaVisitor;
import org.eclipse.pde.api.tools.internal.provisional.comparator.IDelta;
import org.eclipse.pde.api.tools.internal.util.Util;
import org.w3c.dom.Document;
import org.w3c.dom.Element;

public class DeltaXmlVisitor
  extends DeltaVisitor
{
  private Document fDoc;
  private Element fDeltas;
  
  public DeltaXmlVisitor()
    throws CoreException
  {
    fDoc = Util.newDocument();
    fDeltas = fDoc.createElement("deltas");
    fDoc.appendChild(fDeltas);
  }
  
  public boolean visit(IDelta delta)
  {
    if (delta == ApiComparator.NO_DELTA) {
      return false;
    }
    if (delta.getChildren().length == 0) {
      processLeafDelta(delta);
    }
    return true;
  }
  
  protected void processLeafDelta(IDelta delta)
  {
    Element deltaElement = fDoc.createElement("delta");
    deltaElement.setAttribute("flags", Integer.toString(delta.getFlags()));
    deltaElement.setAttribute("kind", Util.getDeltaKindName(delta));
    deltaElement.setAttribute("element_type", Util.getDeltaElementType(delta));
    deltaElement.setAttribute("key", delta.getKey());
    String typeName = delta.getTypeName();
    if (typeName != null) {
      deltaElement.setAttribute("type_name", typeName);
    }
    deltaElement.setAttribute("compatible", Boolean.toString(DeltaProcessor.isCompatible(delta)));
    deltaElement.setAttribute("oldModifiers", Integer.toString(delta.getOldModifiers()));
    deltaElement.setAttribute("newModifiers", Integer.toString(delta.getNewModifiers()));
    deltaElement.setAttribute("restrictions", Integer.toString(delta.getCurrentRestrictions()));
    String apiComponentID = delta.getComponentVersionId();
    if (apiComponentID != null) {
      deltaElement.setAttribute("componentId", apiComponentID);
    }
    deltaElement.setAttribute("message", delta.getMessage());
    String[] messageArguments = delta.getArguments();
    int length = messageArguments.length;
    if (length > 0)
    {
      Element messageArgumentsElement = fDoc.createElement("message_arguments");
      for (int j = 0; j < length; j++)
      {
        Element messageArgumentElement = fDoc.createElement("message_argument");
        messageArgumentElement.setAttribute("value", String.valueOf(messageArguments[j]));
        messageArgumentsElement.appendChild(messageArgumentElement);
      }
      deltaElement.appendChild(messageArgumentsElement);
    }
    fDeltas.appendChild(deltaElement);
  }
  
  public void endVisit(IDelta delta) {}
  
  public String getXML()
    throws CoreException
  {
    return Util.serializeDocument(fDoc);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.internal.comparator.DeltaXmlVisitor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.internal.comparator;

import com.ibm.icu.text.MessageFormat;
import java.io.PrintStream;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import org.eclipse.jdt.core.Flags;
import org.eclipse.osgi.util.NLS;
import org.eclipse.pde.api.tools.internal.provisional.RestrictionModifiers;
import org.eclipse.pde.api.tools.internal.provisional.comparator.IDelta;

public class Messages
  extends NLS
{
  private static Hashtable fMessages = null;
  public static String problem_message_not_found;
  
  static
  {
    NLS.initializeMessages("org.eclipse.pde.api.tools.internal.comparator.messages", Messages.class);
  }
  
  public static Hashtable loadMessageTemplates(Locale loc)
  {
    ResourceBundle bundle = null;
    String bundleName = "org.eclipse.pde.api.tools.internal.comparator.compatible_delta_messages";
    try
    {
      bundle = ResourceBundle.getBundle(bundleName, loc);
    }
    catch (MissingResourceException e)
    {
      System.out.println("Missing resource : " + bundleName.replace('.', '/') + ".properties for locale " + loc);
      throw e;
    }
    Hashtable templates = new Hashtable(700);
    Enumeration keys = bundle.getKeys();
    while (keys.hasMoreElements())
    {
      String key = (String)keys.nextElement();
      try
      {
        int messageID = Integer.parseInt(key);
        templates.put(new Integer(messageID), bundle.getString(key));
      }
      catch (NumberFormatException localNumberFormatException) {}catch (MissingResourceException localMissingResourceException1) {}
    }
    return templates;
  }
  
  public static String getCompatibleLocalizedMessage(Delta delta)
  {
    if (fMessages == null) {
      fMessages = loadMessageTemplates(Locale.getDefault());
    }
    Integer key = new Integer(getKey(delta));
    String message = (String)fMessages.get(key);
    if (message == null) {
      return MessageFormat.format(problem_message_not_found, new String[] { String.valueOf(key) });
    }
    String[] arguments = delta.getArguments();
    if (arguments.length != 0) {
      return MessageFormat.format(message, arguments);
    }
    return message;
  }
  
  private static int getKey(IDelta delta)
  {
    switch (delta.getElementType())
    {
    case 1: 
      switch (delta.getKind())
      {
      case 1: 
        switch (delta.getFlags())
        {
        case 27: 
          return 1;
        case 72: 
          return 110;
        }
        break;
      case 2: 
        switch (delta.getFlags())
        {
        case 11: 
          return 101;
        }
        break;
      case 3: 
        switch (delta.getFlags())
        {
        case 72: 
          return 111;
        }
        break;
      }
      break;
    case 2: 
      switch (delta.getKind())
      {
      case 1: 
        switch (delta.getFlags())
        {
        case 13: 
          return 2;
        case 46: 
          return 3;
        case 70: 
          return 109;
        }
        break;
      case 2: 
        switch (delta.getFlags())
        {
        case 52: 
          return 4;
        case 59: 
          return 95;
        case 60: 
          return 96;
        }
        break;
      case 3: 
        if (delta.getFlags() == 13) {
          return 5;
        }
        break;
      }
      break;
    case 3: 
      switch (delta.getKind())
      {
      case 1: 
        if (delta.getFlags() == 3) {
          return 6;
        }
        break;
      }
      break;
    case 4: 
      switch (delta.getKind())
      {
      case 1: 
        switch (delta.getFlags())
        {
        case 72: 
          return 110;
        case 7: 
          return 7;
        case 8: 
          return 8;
        case 16: 
          if (Flags.isProtected(delta.getNewModifiers())) {
            return 9;
          }
          if (Flags.isStatic(delta.getNewModifiers())) {
            return 10;
          }
          if (Flags.isPublic(delta.getNewModifiers())) {
            return 11;
          }
          return 80;
        case 25: 
          if (!Flags.isAbstract(delta.getNewModifiers())) {
            return 12;
          }
          return 13;
        case 36: 
          return 14;
        case 39: 
          return 15;
        case 48: 
          return 16;
        case 51: 
          return 17;
        case 67: 
          return 97;
        case 37: 
          return 108;
        }
        break;
      case 2: 
        switch (delta.getFlags())
        {
        case 1: 
          return 19;
        case 15: 
          return 21;
        case 18: 
          return 22;
        case 22: 
          return 23;
        case 31: 
          return 94;
        case 11: 
          return 101;
        case 30: 
          return 105;
        }
        break;
      case 3: 
        switch (delta.getFlags())
        {
        case 72: 
          return 111;
        case 7: 
          return 25;
        case 8: 
        case 63: 
          return 26;
        case 17: 
          return 27;
        case 16: 
        case 61: 
          if (Flags.isProtected(delta.getOldModifiers())) {
            return 28;
          }
          return 29;
        case 26: 
          return 30;
        case 25: 
        case 62: 
          if (Flags.isProtected(delta.getOldModifiers())) {
            return 31;
          }
          return 32;
        case 48: 
          if (Flags.isProtected(delta.getOldModifiers())) {
            return 33;
          }
          return 34;
        }
        break;
      }
      break;
    case 6: 
      switch (delta.getKind())
      {
      case 1: 
        switch (delta.getFlags())
        {
        case 8: 
          return 35;
        case 12: 
          return 36;
        case 25: 
          return 37;
        case 72: 
          return 110;
        }
        break;
      case 3: 
        switch (delta.getFlags())
        {
        case 8: 
        case 63: 
          return 38;
        case 72: 
          return 111;
        }
        break;
      case 2: 
        switch (delta.getFlags())
        {
        case 11: 
          return 101;
        }
        break;
      }
      break;
    case 7: 
      switch (delta.getKind())
      {
      case 1: 
        switch (delta.getFlags())
        {
        case 47: 
          return 18;
        case 54: 
          return 40;
        case 72: 
          return 110;
        }
        break;
      case 2: 
        switch (delta.getFlags())
        {
        case 19: 
          return 41;
        case 20: 
          if (Flags.isProtected(delta.getNewModifiers())) {
            return 42;
          }
          return 43;
        case 21: 
          return 44;
        case 22: 
          return 45;
        case 31: 
          return 46;
        case 35: 
          return 47;
        case 45: 
          return 48;
        case 54: 
          if (Flags.isProtected(delta.getNewModifiers())) {
            return 50;
          }
          return 51;
        case 46: 
          return 78;
        case 57: 
          return 92;
        case 58: 
          return 93;
        case 11: 
          return 98;
        case 33: 
          return 103;
        case 38: 
          return 104;
        }
        break;
      case 3: 
        switch (delta.getFlags())
        {
        case 54: 
          if (Flags.isProtected(delta.getNewModifiers())) {
            return 52;
          }
          return 53;
        case 72: 
          return 111;
        }
        break;
      }
      break;
    case 10: 
      if ((delta.getKind() == 2) && (delta.getFlags() == 50)) {
        return 24;
      }
      break;
    case 8: 
      switch (delta.getKind())
      {
      case 1: 
        switch (delta.getFlags())
        {
        case 72: 
          return 110;
        case 16: 
          return 54;
        case 25: 
          return 55;
        case 48: 
          return 56;
        case 36: 
          return 57;
        case 51: 
          return 58;
        case 67: 
          return 97;
        case 69: 
          return 107;
        }
        break;
      case 2: 
        switch (delta.getFlags())
        {
        case 15: 
          return 79;
        case 11: 
          return 101;
        }
        break;
      case 3: 
        switch (delta.getFlags())
        {
        case 17: 
          return 60;
        case 26: 
          return 61;
        case 72: 
          return 111;
        }
        break;
      }
      break;
    case 9: 
      switch (delta.getKind())
      {
      case 1: 
        switch (delta.getFlags())
        {
        case 72: 
          return 110;
        case 2: 
          return 62;
        case 5: 
          return 63;
        case 51: 
          return 64;
        case 53: 
          return 65;
        case 47: 
          return 18;
        case 37: 
          return 106;
        }
        break;
      case 2: 
        switch (delta.getFlags())
        {
        case 1: 
          return 66;
        case 2: 
          return 67;
        case 4: 
          return 68;
        case 18: 
          return 69;
        case 22: 
          return 70;
        case 29: 
          return 71;
        case 32: 
          return 72;
        case 34: 
          return 73;
        case 40: 
          return 74;
        case 31: 
          if (RestrictionModifiers.isExtendRestriction(delta.getCurrentRestrictions())) {
            return 81;
          }
          if (RestrictionModifiers.isOverrideRestriction(delta.getCurrentRestrictions())) {
            return 82;
          }
          return 83;
        case 33: 
          return 84;
        case 11: 
          return 99;
        case 38: 
          return 102;
        }
        break;
      case 3: 
        switch (delta.getFlags())
        {
        case 5: 
          return 76;
        case 53: 
          return 77;
        case 72: 
          return 111;
        }
        break;
      }
      break;
    case 5: 
      switch (delta.getKind())
      {
      case 1: 
        switch (delta.getFlags())
        {
        case 72: 
          return 110;
        case 5: 
          return 85;
        case 51: 
          return 64;
        case 53: 
          return 86;
        case 47: 
          return 18;
        }
        break;
      case 2: 
        switch (delta.getFlags())
        {
        case 4: 
          return 87;
        case 22: 
          return 89;
        case 11: 
          return 100;
        }
        break;
      case 3: 
        switch (delta.getFlags())
        {
        case 5: 
          return 90;
        case 53: 
          return 91;
        case 72: 
          return 111;
        }
        break;
      }
      break;
    }
    return 0;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.internal.comparator.Messages
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.internal.comparator;

import org.objectweb.asm.signature.SignatureVisitor;

final class SignatureDecoder
  implements SignatureVisitor
{
  static final int CLASS_BOUND = 1;
  static final int DEFAULT = 0;
  static final int INTERFACE_BOUND = 2;
  static final int SUPER_CLASS = 3;
  static final int NORMAL_TYPE_ARGUMENT = 4;
  static final int EXTENDS_TYPE_ARGUMENT = 5;
  static final int SUPER_TYPE_ARGUMENT = 6;
  int mode = 0;
  SignatureDescriptor signatureDescriptor;
  
  public SignatureDecoder(SignatureDescriptor signatureDescriptor)
  {
    this.signatureDescriptor = signatureDescriptor;
  }
  
  public SignatureVisitor visitArrayType()
  {
    return this;
  }
  
  public void visitBaseType(char descriptor) {}
  
  public SignatureVisitor visitClassBound()
  {
    mode = 1;
    return this;
  }
  
  public void visitClassType(String name)
  {
    String classTypeName = name.replace('/', '.');
    switch (mode)
    {
    case 1: 
      signatureDescriptor.setClassBound(classTypeName);
      break;
    case 2: 
      signatureDescriptor.addInterfaceBound(classTypeName);
      break;
    case 3: 
      signatureDescriptor.setSuperclass(classTypeName);
      break;
    case 4: 
    case 5: 
    case 6: 
      signatureDescriptor.addTypeArgument(classTypeName);
    }
    mode = 0;
  }
  
  public void visitEnd() {}
  
  public SignatureVisitor visitExceptionType()
  {
    return this;
  }
  
  public void visitFormalTypeParameter(String name)
  {
    signatureDescriptor.addTypeParameterDescriptor(name);
  }
  
  public void visitInnerClassType(String name) {}
  
  public SignatureVisitor visitInterface()
  {
    return this;
  }
  
  public SignatureVisitor visitInterfaceBound()
  {
    mode = 2;
    return this;
  }
  
  public SignatureVisitor visitParameterType()
  {
    return this;
  }
  
  public SignatureVisitor visitReturnType()
  {
    return this;
  }
  
  public SignatureVisitor visitSuperclass()
  {
    mode = 3;
    return this;
  }
  
  public void visitTypeArgument() {}
  
  public SignatureVisitor visitTypeArgument(char wildcard)
  {
    switch (wildcard)
    {
    case '+': 
      mode = 5;
      break;
    case '-': 
      mode = 6;
      break;
    case '=': 
      mode = 4;
    }
    return this;
  }
  
  public void visitTypeVariable(String name) {}
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.internal.comparator.SignatureDecoder
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.internal.comparator;

class SignatureDescriptor
{
  private static final TypeParameterDescriptor[] EMPTY_TYPE_PARAMETER_DESCRIPTORS = new TypeParameterDescriptor[0];
  private static final String[] EMPTY_TYPE_ARGUMENTS = new String[0];
  static final int INITIAL_SIZE = 1;
  TypeParameterDescriptor currentTypeParameterDescriptor;
  String superClass;
  TypeParameterDescriptor[] typeParameterDescriptors;
  int typeParameterDescriptorsCounter;
  String[] typeArguments;
  int typeArgumentsCounter;
  
  public void addInterfaceBound(String bound)
  {
    currentTypeParameterDescriptor.addInterfaceBound(bound);
  }
  
  public void addTypeArgument(String typeArgument)
  {
    if (typeArguments == null)
    {
      typeArguments = new String[1];
      typeArgumentsCounter = 0;
    }
    else
    {
      int length = typeArguments.length;
      if (length == typeArgumentsCounter) {
        System.arraycopy(typeArguments, 0, typeArguments = new String[length * 2], 0, length);
      }
    }
    typeArguments[(typeArgumentsCounter++)] = typeArgument;
  }
  
  public void addTypeParameterDescriptor(String name)
  {
    if (typeParameterDescriptors == null)
    {
      typeParameterDescriptors = new TypeParameterDescriptor[1];
      typeParameterDescriptorsCounter = 0;
    }
    else
    {
      int length = typeParameterDescriptors.length;
      if (typeParameterDescriptorsCounter == length) {
        System.arraycopy(typeParameterDescriptors, 0, typeParameterDescriptors = new TypeParameterDescriptor[length * 2], 0, length);
      }
    }
    TypeParameterDescriptor typeParameterDescriptor = new TypeParameterDescriptor(name);
    currentTypeParameterDescriptor = typeParameterDescriptor;
    typeParameterDescriptors[(typeParameterDescriptorsCounter++)] = typeParameterDescriptor;
  }
  
  public TypeParameterDescriptor[] getTypeParameterDescriptors()
  {
    if (typeParameterDescriptors == null) {
      return EMPTY_TYPE_PARAMETER_DESCRIPTORS;
    }
    int length = typeParameterDescriptors.length;
    if (typeParameterDescriptorsCounter != length) {
      System.arraycopy(typeParameterDescriptors, 0, typeParameterDescriptors = new TypeParameterDescriptor[typeParameterDescriptorsCounter], 0, typeParameterDescriptorsCounter);
    }
    return typeParameterDescriptors;
  }
  
  public String[] getTypeArguments()
  {
    if (typeArguments == null) {
      return EMPTY_TYPE_ARGUMENTS;
    }
    int length = typeArguments.length;
    if (typeArgumentsCounter != length) {
      System.arraycopy(typeArguments, 0, typeArguments = new String[typeArgumentsCounter], 0, typeArgumentsCounter);
    }
    return typeArguments;
  }
  
  public void setClassBound(String bound)
  {
    currentTypeParameterDescriptor.setClassBound(bound);
  }
  
  public void setSuperclass(String superclass)
  {
    superClass = superclass;
  }
  
  public String toString()
  {
    StringBuffer buffer = new StringBuffer();
    int i = 0;
    for (int max = typeParameterDescriptorsCounter; i < max; i++)
    {
      if (i > 0) {
        buffer.append(',');
      }
      buffer.append(typeParameterDescriptors[i]);
    }
    buffer.append("superclass: " + superClass);
    int i = 0;
    for (int max = typeArgumentsCounter; i < max; i++)
    {
      if (i > 0) {
        buffer.append(',');
      }
      buffer.append(typeArguments[i]);
    }
    return String.valueOf(buffer);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.internal.comparator.SignatureDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.internal.comparator;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.eclipse.pde.api.tools.internal.util.Util;

class TypeParameterDescriptor
{
  private static final String JAVA_LANG_OBJECT = "java.lang.Object";
  String classBound;
  List interfaceBounds;
  String name;
  
  public TypeParameterDescriptor(String name)
  {
    this.name = name;
  }
  
  public void addInterfaceBound(String bound)
  {
    if (interfaceBounds == null) {
      interfaceBounds = new ArrayList();
    }
    interfaceBounds.add(bound);
  }
  
  public void setClassBound(String bound)
  {
    if ("java.lang.Object".equals(bound)) {
      return;
    }
    classBound = bound;
  }
  
  public String toString()
  {
    StringBuffer buffer = new StringBuffer();
    buffer.append("type parameter ").append(name).append(" : ").append(Util.LINE_DELIMITER);
    if (classBound != null) {
      buffer.append("class bound : ").append(classBound).append(Util.LINE_DELIMITER);
    }
    if (interfaceBounds != null)
    {
      buffer.append("interface bounds : ");
      int i = 0;
      for (Iterator iterator = interfaceBounds.iterator(); iterator.hasNext();)
      {
        if (i > 0) {
          buffer.append(',');
        }
        i++;
        buffer.append(iterator.next());
      }
      buffer.append(Util.LINE_DELIMITER);
    }
    return String.valueOf(buffer);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.internal.comparator.TypeParameterDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.internal.descriptors;

import org.eclipse.pde.api.tools.internal.provisional.descriptors.IComponentDescriptor;
import org.eclipse.pde.api.tools.internal.provisional.descriptors.IElementDescriptor;

public class ComponentDescriptorImpl
  extends NamedElementDescriptorImpl
  implements IComponentDescriptor
{
  private String componentid = null;
  private String version = null;
  
  public ComponentDescriptorImpl(String componentid, String version)
  {
    super(componentid);
    this.componentid = componentid;
    this.version = version;
  }
  
  public int getElementType()
  {
    return 8;
  }
  
  public int hashCode()
  {
    int hc = 0;
    if (version != null) {
      hc = version.hashCode();
    }
    return componentid.hashCode() + hc;
  }
  
  public boolean equals(Object obj)
  {
    if (((obj instanceof IComponentDescriptor)) && 
      (componentid.equals(((IComponentDescriptor)obj).getId())))
    {
      if (version == null) {
        return ((IComponentDescriptor)obj).getVersion() == null;
      }
      return version.equals(((IComponentDescriptor)obj).getVersion());
    }
    return false;
  }
  
  public String getId()
  {
    return componentid;
  }
  
  public IElementDescriptor[] getPath()
  {
    return null;
  }
  
  public String toString()
  {
    return componentid;
  }
  
  public String getVersion()
  {
    return version;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.internal.descriptors.ComponentDescriptorImpl
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.internal.descriptors;

import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.pde.api.tools.internal.provisional.descriptors.IElementDescriptor;
import org.eclipse.pde.api.tools.internal.util.Util;

public abstract class ElementDescriptorImpl
  implements IElementDescriptor, Comparable
{
  private static boolean Debug = Util.DEBUG;
  
  public static void setDebug(boolean debugValue)
  {
    Debug = (debugValue) || (Util.DEBUG);
  }
  
  public IElementDescriptor getParent()
  {
    return null;
  }
  
  public IElementDescriptor[] getPath()
  {
    List list = new ArrayList();
    IElementDescriptor element = this;
    while (element != null)
    {
      list.add(0, element);
      element = element.getParent();
    }
    return (IElementDescriptor[])list.toArray(new IElementDescriptor[list.size()]);
  }
  
  public int compareTo(Object o)
  {
    if ((o instanceof ElementDescriptorImpl))
    {
      ElementDescriptorImpl element = (ElementDescriptorImpl)o;
      return getComparable().compareTo(element.getComparable());
    }
    if (Debug) {
      System.err.println(o.getClass());
    }
    return -1;
  }
  
  protected abstract Comparable getComparable();
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.internal.descriptors.ElementDescriptorImpl
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.internal.descriptors;

import org.eclipse.pde.api.tools.internal.provisional.descriptors.IFieldDescriptor;
import org.eclipse.pde.api.tools.internal.provisional.descriptors.IReferenceTypeDescriptor;

public class FieldDescriptorImpl
  extends MemberDescriptorImpl
  implements IFieldDescriptor
{
  FieldDescriptorImpl(String name, IReferenceTypeDescriptor parent)
  {
    super(name, parent);
  }
  
  public String toString()
  {
    StringBuffer buffer = new StringBuffer();
    buffer.append(getEnclosingType().getQualifiedName());
    buffer.append("#");
    buffer.append(getName());
    return buffer.toString();
  }
  
  public boolean equals(Object obj)
  {
    if ((obj instanceof IFieldDescriptor))
    {
      IFieldDescriptor field = (IFieldDescriptor)obj;
      return (getName().equals(field.getName())) && (getEnclosingType().equals(field.getEnclosingType()));
    }
    return false;
  }
  
  public int hashCode()
  {
    return getName().hashCode() + getEnclosingType().hashCode();
  }
  
  public int getElementType()
  {
    return 5;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.pde.api.tools.internal.descriptors.FieldDescriptorImpl
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.pde.api.tools.internal.descriptors;

import org.eclipse.pde.api.tools.internal.provisional.descriptors.IElementDescriptor;
import org.eclipse.pde.api.tools.internal.provisional.descriptors.IMemberDescriptor;
import org.eclipse.pde.api.tools.internal.provisional.descriptors.IPackageDescriptor;
import org.eclipse.pde.api.tools.internal.provisional.descriptors.IReferenceTypeDescriptor;

public abstract class MemberDescriptorImpl
  extends NamedElementDescriptorImpl
  implements IMemberDescriptor
{
  private IElementDescriptor fParent;
  
  MemberDescriptorImpl(String name, IElementDescriptor parent)
  {
    super(name);
    fParent = parent;
  }
  
  public IReferenceTypeDescriptor getEnclosingType
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55

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