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

guments[i].equals(arguments[i]);
    }
    return equal;
  }
  
  private int argumentsHashcode(String[] arguments)
  {
    if (fMessageArguments == null) {
      return 0;
    }
    int hashcode = 0;
    for (int i = 0; i < fMessageArguments.length; i++) {
      hashcode += fMessageArguments[i].hashCode();
    }
    return hashcode;
  }
  
  public String toString()
  {
    StringBuffer buffer = new StringBuffer();
    buffer.append("API problem: ");
    buffer.append(fResourcePath != null ? fResourcePath : "no path").append("\n");
    buffer.append("\tseverity: ");
    buffer.append(Util.getSeverity(getSeverity())).append("\n");
    buffer.append("\tcategory: ");
    buffer.append(getProblemCategory(getCategory())).append("\n");
    buffer.append("\telement kind: ");
    buffer.append(getProblemElementKind(getCategory(), getElementKind())).append("\n");
    buffer.append("\tkind: ");
    buffer.append(getProblemKind(getCategory(), getKind())).append("\n");
    buffer.append("\tflags: ");
    buffer.append(getProblemFlagsName(getCategory(), getFlags())).append("\n");
    buffer.append("\tmessage id: ");
    buffer.append(getMessageid());
    buffer.append("\n\tmessage: ");
    buffer.append(getMessage());
    return buffer.toString();
  }
  
  public int hashCode()
  {
    return getId() + (
      fResourcePath != null ? fResourcePath.hashCode() : 0) + 
      argumentsHashcode(fMessageArguments) + (
      fTypeName != null ? fTypeName.hashCode() : 0);
  }
  
  public String getTypeName()
  {
    return fTypeName;
  }
  
  public static String getDescriptorKind(int kind)
  {
    switch (kind)
    {
    case 1: 
      return "PACKAGE";
    case 5: 
      return "FIELD";
    case 6: 
      return "METHOD";
    case 2: 
      return "REFERENCE_TYPE";
    case 7: 
      return "RESOURCE";
    }
    return "UNKNOWN_ELEMENT_KIND";
  }
  
  public static String getTagsProblemKindName(int kind)
  {
    switch (kind)
    {
    case 1: 
      return "INVALID_SINCE_TAGS";
    case 2: 
      return "MALFORMED_SINCE_TAGS";
    case 3: 
      return "MISSING_SINCE_TAGS";
    }
    return "UNKNOWN_KIND";
  }
  
  public static String getUsageProblemKindName(int kind)
  {
    switch (kind)
    {
    case 1: 
      return "ILLEGAL_EXTEND";
    case 4: 
      return "ILLEGAL_IMPLEMENT";
    case 2: 
      return "ILLEGAL_INSTANTIATE";
    case 3: 
      return "ILLEGAL_REFERENCE";
    case 5: 
      return "ILLEGAL_OVERRIDE";
    case 6: 
      return "API_LEAK";
    case 7: 
      return "UNSUPPORTED_TAG_USE";
    case 9: 
      return "INVALID_REFERENCE_IN_SYSTEM_LIBRARIES";
    case 10: 
      return "UNUSED_PROBLEM_FILTERS";
    }
    return "UNKNOWN_KIND";
  }
  
  public static String getVersionProblemKindName(int kind)
  {
    switch (kind)
    {
    case 2: 
      return "MINOR_VERSION_CHANGE";
    case 1: 
      return "MAJOR_VERSION_CHANGE";
    case 3: 
      return "MAJOR_VERSION_CHANGE_NO_BREAKAGE";
    case 4: 
      return "MINOR_VERSION_CHANGE_NO_NEW_API";
    case 5: 
      return "REEXPORTED_MAJOR_VERSION_CHANGE";
    case 6: 
      return "REEXPORTED_MINOR_VERSION_CHANGE";
    }
    return "UNKNOWN_KIND";
  }
  
  public static String getApiComponentResolutionProblemKindName(int kind)
  {
    switch (kind)
    {
    case 1: 
      return "API_COMPONENT_RESOLUTION";
    }
    return "UNKNOWN_KIND";
  }
  
  public static String getApiBaselineProblemKindName(int kind)
  {
    switch (kind)
    {
    case 1: 
      return "API_BASELINE_MISSING";
    }
    return "UNKNOWN_KIND";
  }
  
  public static String getApiUseScanProblemKindName(int kind)
  {
    switch (kind)
    {
    case 1: 
      return "API_USE_SCAN_TYPE_PROBLEM";
    case 2: 
      return "API_USE_SCAN_METHOD_PROBLEM";
    case 3: 
      return "API_USE_SCAN_FIELD_PROBLEM";
    }
    return "UNKNOWN_KIND";
  }
  
  public static String getProblemKind(int category, int kind)
  {
    switch (category)
    {
    case 268435456: 
      return Util.getDeltaKindName(kind);
    case 1073741824: 
      return getTagsProblemKindName(kind);
    case 536870912: 
      return getUsageProblemKindName(kind);
    case 805306368: 
      return getVersionProblemKindName(kind);
    case 1342177280: 
      return getApiBaselineProblemKindName(kind);
    case 1610612736: 
      return getApiComponentResolutionProblemKindName(kind);
    case -2147483648: 
      return getApiUseScanProblemKindName(kind);
    }
    return "UNKNOWN_KIND";
  }
  
  public static String getProblemFlagsName(int category, int flags)
  {
    switch (category)
    {
    case 268435456: 
      return Util.getDeltaFlagsName(flags);
    case 536870912: 
    case 805306368: 
    case 1073741824: 
    case 1342177280: 
    case 1610612736: 
      switch (flags)
      {
      case 1: 
        return "LEAK_EXTENDS";
      case 3: 
        return "LEAK_FIELD";
      case 2: 
        return "LEAK_IMPLEMENTS";
      case 5: 
        return "LEAK_METHOD_PARAMETER";
      case 6: 
        return "LEAK_CONSTRUCTOR_PARAMETER";
      case 4: 
        return "LEAK_RETURN_TYPE";
      case 7: 
        return "CONSTRUCTOR_METHOD";
      case 0: 
        return "NO_FLAGS";
      case 10: 
        return "INDIRECT_REFERENCE";
      case 8: 
        return "METHOD";
      case 9: 
        return "FIELD";
      }
      break;
    case -2147483648: 
      switch (flags)
      {
      case 0: 
        return "DELETED";
      case 1: 
        return "UNRESOLVED";
      }
      break;
    }
    return "UNKNOWN_FLAGS";
  }
  
  public static String getProblemElementKind(int category, int kind)
  {
    switch (category)
    {
    case 268435456: 
    case 1073741824: 
      return Util.getDeltaElementType(kind);
    case 536870912: 
    case 805306368: 
    case 1342177280: 
    case 1610612736: 
      return getDescriptorKind(kind);
    case -2147483648: 
      return Util.getApiElementType(kind);
    }
    return "UNKNOWN_KIND";
  }
  
  public static String getProblemCategory(int category)
  {
    switch (category)
    {
    case 268435456: 
      return "COMPATIBILITY";
    case 1073741824: 
      return "SINCETAGS";
    case 536870912: 
      return "USAGE";
    case 805306368: 
      return "VERSION";
    case 1342177280: 
      return "API_BASELINE";
    case 1610612736: 
      return "API_COMPONENT_RESOLUTION";
    case -2147483648: 
      return "API USE SCAN PROBLEM";
    }
    return "UNKNOWN_CATEGORY";
  }
}

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

import com.ibm.icu.text.MessageFormat;
import java.io.PrintStream;
import java.text.ChoiceFormat;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import org.eclipse.pde.api.tools.internal.builder.BuilderMessages;
import org.eclipse.pde.api.tools.internal.provisional.problems.IApiProblem;
import org.eclipse.pde.api.tools.internal.provisional.problems.IApiProblemFilter;
import org.eclipse.pde.api.tools.internal.util.Util;

public class ApiProblemFactory
{
  public static final int TYPE_CONVERSION_ID = 76;
  private static Hashtable fMessages = null;
  
  public static IApiProblemFilter newProblemFilter(String componentid, IApiProblem problem, String comment)
  {
    return new ApiProblemFilter(componentid, problem, comment);
  }
  
  public static IApiProblem newApiProblem(String resourcepath, String typeName, String[] messageargs, String[] argumentids, Object[] arguments, int linenumber, int charstart, int charend, int category, int element, int kind, int flags)
  {
    return newApiProblem(resourcepath, typeName, messageargs, argumentids, arguments, linenumber, charstart, charend, createProblemId(category, element, kind, flags));
  }
  
  public static IApiProblem newApiProblem(String resourcepath, String typeName, String[] messageargs, String[] argumentids, Object[] arguments, int linenumber, int charstart, int charend, int id)
  {
    return new ApiProblem(resourcepath, typeName, messageargs, argumentids, arguments, linenumber, charstart, charend, id);
  }
  
  public static IApiProblem newApiUsageProblem(String resourcepath, String typeName, String[] messageargs, String[] argumentids, Object[] arguments, int linenumber, int charstart, int charend, int element, int kind)
  {
    int id = createProblemId(536870912, element, kind, 0);
    return newApiProblem(resourcepath, typeName, messageargs, argumentids, arguments, linenumber, charstart, charend, id);
  }
  
  public static IApiProblem newApiUsageProblem(String resourcepath, String typeName, String[] messageargs, String[] argumentids, Object[] arguments, int linenumber, int charstart, int charend, int element, int kind, int flags)
  {
    int id = createProblemId(536870912, element, kind, flags);
    return newApiProblem(resourcepath, typeName, messageargs, argumentids, arguments, linenumber, charstart, charend, id);
  }
  
  public static IApiProblem newApiBaselineProblem(String resourcepath, String[] argumentids, Object[] arguments, int element, int kind)
  {
    int id = createProblemId(1342177280, element, kind, 0);
    return newApiProblem(resourcepath, null, null, argumentids, arguments, -1, -1, -1, id);
  }
  
  public static IApiProblem newApiComponentResolutionProblem(String resourcepath, String[] messageargs, String[] argumentids, Object[] arguments, int element, int kind)
  {
    int id = createProblemId(1610612736, element, kind, 0);
    return newApiProblem(resourcepath, null, messageargs, argumentids, arguments, -1, -1, -1, id);
  }
  
  public static IApiProblem newFatalProblem(String resourcepath, String[] messageargs, int kind)
  {
    int id = createProblemId(1879048192, 7, kind, 0);
    return newApiProblem(resourcepath, null, messageargs, null, null, -1, -1, -1, id);
  }
  
  public static IApiProblem newApiSinceTagProblem(String resourcepath, String typeName, String[] messageargs, String[] argumentids, Object[] arguments, int linenumber, int charstart, int charend, int element, int kind)
  {
    int id = createProblemId(1073741824, element, kind, 0);
    return newApiProblem(resourcepath, typeName, messageargs, argumentids, arguments, linenumber, charstart, charend, id);
  }
  
  public static IApiProblem newApiVersionNumberProblem(String resourcepath, String typeName, String[] messageargs, String[] argumentids, Object[] arguments, int linenumber, int charstart, int charend, int element, int kind)
  {
    int id = createProblemId(805306368, element, kind, 0);
    return newApiProblem(resourcepath, typeName, messageargs, argumentids, arguments, linenumber, charstart, charend, id);
  }
  
  public static IApiProblem newApiUseScanProblem(String resourcePath, String typeName, String[] messageargs, String[] argumentids, Object[] arguments, int linenumber, int charstart, int charend, int element, int kind, int flags)
  {
    int id = createProblemId(Integer.MIN_VALUE, element, kind, flags);
    return newApiProblem(resourcePath, typeName, messageargs, argumentids, arguments, linenumber, charstart, charend, id);
  }
  
  public static String getLocalizedMessage(IApiProblem problem)
  {
    return getLocalizedMessage(problem.getMessageid(), problem.getMessageArguments());
  }
  
  public static String getLocalizedMessage(int messageid, String[] messageargs)
  {
    if (fMessages == null) {
      fMessages = loadMessageTemplates(Locale.getDefault());
    }
    String pattern = (String)fMessages.get(new Integer(messageid));
    if (pattern == null) {
      return MessageFormat.format(BuilderMessages.ApiProblemFactory_problem_message_not_found, new String[] { Integer.toString(messageid) });
    }
    if (messageid == 76)
    {
      MessageFormat messageFormat = new MessageFormat(pattern);
      double[] typeElementTypes = {
        1.0D, 
        4.0D, 
        6.0D, 
        8.0D };
      
      String[] typeElementTypesStrings = {
        (String)fMessages.get(Util.getDeltaElementType(1)), 
        (String)fMessages.get(Util.getDeltaElementType(4)), 
        (String)fMessages.get(Util.getDeltaElementType(6)), 
        (String)fMessages.get(Util.getDeltaElementType(8)) };
      
      ChoiceFormat choiceFormat = new ChoiceFormat(typeElementTypes, typeElementTypesStrings);
      messageFormat.setFormatByArgumentIndex(1, choiceFormat);
      messageFormat.setFormatByArgumentIndex(2, choiceFormat);
      Object[] args = new Object[messageargs.length];
      args[0] = messageargs[0];
      args[1] = Integer.decode(messageargs[1]);
      args[2] = Integer.decode(messageargs[2]);
      return messageFormat.format(args);
    }
    return MessageFormat.format(pattern, messageargs);
  }
  
  public static Hashtable loadMessageTemplates(Locale loc)
  {
    ResourceBundle bundle = null;
    String bundleName = "org.eclipse.pde.api.tools.internal.problems.problemmessages";
    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)
      {
        templates.put(key, bundle.getString(key));
      }
      catch (MissingResourceException localMissingResourceException1) {}
    }
    return templates;
  }
  
  public static int createProblemId(int category, int element, int kind, int flags)
  {
    return category | element << 24 | 
      kind << 20 | 
      flags << 12 | 
      getProblemMessageId(category, element, kind, flags);
  }
  
  public static int getProblemKind(int problemid)
  {
    return (problemid & 0xF00000) >> 20;
  }
  
  public static int getProblemElementKind(int problemid)
  {
    return (problemid & 0xF000000) >> 24;
  }
  
  public static int getProblemFlags(int problemid)
  {
    return (problemid & 0xFF000) >> 12;
  }
  
  public static int getProblemCategory(int problemid)
  {
    return problemid & 0xF0000000;
  }
  
  public static int getProblemMessageId(int problemid)
  {
    return getProblemMessageId(getProblemCategory(problemid), getProblemElementKind(problemid), getProblemKind(problemid), getProblemFlags(problemid));
  }
  
  public static int getProblemMessageId(int category, int element, int kind, int flags)
  {
    switch (category)
    {
    case 1342177280: 
      switch (kind)
      {
      case 1: 
        return 1;
      }
      break;
    case 1073741824: 
      switch (kind)
      {
      case 1: 
        return 2;
      case 2: 
        return 3;
      case 3: 
        return 4;
      }
      break;
    case 805306368: 
      switch (kind)
      {
      case 1: 
        return 5;
      case 3: 
        return 6;
      case 2: 
        return 7;
      case 4: 
        return 56;
      case 5: 
        return 19;
      case 6: 
        return 20;
      }
      break;
    case 536870912: 
      switch (kind)
      {
      case 4: 
        switch (flags)
        {
        case 0: 
          return 8;
        case 10: 
          return 24;
        }
        break;
      case 1: 
        switch (flags)
        {
        case 0: 
          return 9;
        case 10: 
          return 25;
        case 11: 
          return 28;
        }
        break;
      case 2: 
        return 10;
      case 5: 
        return 11;
      case 3: 
        switch (flags)
        {
        case 9: 
          return 12;
        case 7: 
          return 110;
        case 8: 
          return 111;
        }
        break;
      case 6: 
        switch (flags)
        {
        case 1: 
          return 13;
        case 2: 
          return 14;
        case 3: 
          return 15;
        case 4: 
          return 16;
        case 5: 
          return 17;
        case 6: 
          return 109;
        }
        break;
      case 7: 
        return 112;
      case 8: 
        return 22;
      case 9: 
        switch (flags)
        {
        case 8: 
          return 33;
        case 7: 
          return 34;
        case 9: 
          return 35;
        }
        return 36;
      case 10: 
        return 30;
      }
      break;
    case 268435456: 
      switch (kind)
      {
      case 1: 
        switch (element)
        {
        case 4: 
          switch (flags)
          {
          case 25: 
            return 41;
          case 37: 
            return 72;
          }
          break;
        case 1: 
          switch (flags)
          {
          case 16: 
            return 39;
          }
          break;
        case 8: 
          switch (flags)
          {
          case 16: 
            return 40;
          case 25: 
            return 44;
          case 37: 
            return 72;
          case 69: 
            return 133;
          }
          break;
        case 9: 
          switch (flags)
          {
          case 37: 
            return 132;
          }
          break;
        }
        switch (flags)
        {
        case 6: 
          return 21;
        case 8: 
          return 23;
        case 23: 
          return 26;
        case 28: 
          return 29;
        case 49: 
          return 32;
        case 68: 
          return 106;
        }
        break;
      case 2: 
        switch (element)
        {
        case 7: 
          switch (flags)
          {
          case 46: 
            return 81;
          case 54: 
            return 84;
          case 11: 
            return 114;
          case 31: 
            return 118;
          case 38: 
            return 121;
          case 33: 
            return 69;
          }
          break;
        case 9: 
          switch (flags)
          {
          case 11: 
            return 115;
          case 30: 
            return 117;
          case 31: 
            return 119;
          case 33: 
            return 120;
          case 38: 
            return 122;
          }
          break;
        case 5: 
          switch (flags)
          {
          case 11: 
            return 116;
          }
          break;
        }
        switch (flags)
        {
        case 6: 
          return 52;
        case 10: 
          return 54;
        case 11: 
          return 55;
        case 20: 
          return 61;
        case 23: 
          return 64;
        case 30: 
          return 66;
        case 31: 
          return 67;
        case 33: 
          return 123;
        case 38: 
          return 73;
        case 41: 
          return 76;
        case 55: 
          return 85;
        case 68: 
          return 124;
        }
        break;
      case 3: 
        switch (flags)
        {
        case 2: 
          return 86;
        case 3: 
          return 87;
        case 6: 
          return 89;
        case 8: 
          return 91;
        case 12: 
          return 92;
        case 16: 
          return 94;
        case 23: 
          return 96;
        case 25: 
          return 98;
        case 27: 
          return 100;
        case 28: 
          return 101;
        case 46: 
          return 102;
        case 47: 
          return 103;
        case 48: 
          return 104;
        case 49: 
          return 105;
        case 54: 
          return 108;
        case 56: 
          return 113;
        case 61: 
          return 125;
        case 62: 
          return 126;
        case 63: 
          return 127;
        case 64: 
          return 128;
        case 65: 
          return 129;
        case 66: 
          return 130;
        case 68: 
          return 107;
        case 39: 
          return 131;
        case 71: 
          return 134;
        case 70: 
          return 135;
        }
        break;
      }
      break;
    case 1610612736: 
      switch (kind)
      {
      case 1: 
        return 99;
      }
      break;
    case 1879048192: 
      switch (kind)
      {
      case 1: 
        return 31;
      }
      break;
    case -2147483648: 
      switch (kind)
      {
      case 1: 
        return 136 + flags;
      case 2: 
        return 138 + flags;
      case 3: 
        return 140 + flags;
      }
      break;
    }
    return 0;
  }
  
  public static String getProblemSeverityId(IApiProblem problem)
  {
    switch (problem.getCategory())
    {
    case 1879048192: 
      switch (problem.getKind())
      {
      case 1: 
        return "fatal_problems";
      }
      break;
    case 1610612736: 
      switch (problem.getKind())
      {
      case 1: 
        return "report_resolution_errors_api_component";
      }
      break;
    case 1342177280: 
      switch (problem.getKind())
      {
      case 1: 
        return "missing_default_api_profile";
      }
      break;
    case 1073741824: 
      switch (problem.getKind())
      {
      case 1: 
        return "invalid_since_tag_version";
      case 2: 
        return "malformed_since_tag";
      case 3: 
        return "missing_since_tag";
      }
      break;
    case 805306368: 
      return "incompatible_api_component_version";
    case 536870912: 
      switch (problem.getKind())
      {
      case 4: 
        return "ILLEGAL_IMPLEMENT";
      case 1: 
        return "ILLEGAL_EXTEND";
      case 2: 
        return "ILLEGAL_INSTANTIATE";
      case 5: 
        return "ILLEGAL_OVERRIDE";
      case 3: 
        return "ILLEGAL_REFERENCE";
      case 6: 
        switch (problem.getFlags())
        {
        case 1: 
          return "LEAK_EXTEND";
        case 3: 
          return "LEAK_FIELD_DECL";
        case 2: 
          return "LEAK_IMPLEMENT";
        case 5: 
        case 6: 
          return "LEAK_METHOD_PARAM";
        case 4: 
          return "LEAK_METHOD_RETURN_TYPE";
        }
        break;
      case 7: 
        return "INVALID_JAVADOC_TAG";
      case 8: 
        return "INVALID_JAVADOC_TAG";
      case 9: 
        return "INVALID_REFERENCE_IN_SYSTEM_LIBRARIES";
      case 10: 
        return "UNUSED_PROBLEM_FILTERS";
      }
      break;
    case 268435456: 
      return Util.getDeltaPrefererenceKey(problem.getElementKind(), problem.getKind(), problem.getFlags());
    case -2147483648: 
      switch (problem.getKind())
      {
      case 1: 
        return "API_USE_SCAN_TYPE_SEVERITY";
      case 2: 
        return "API_USE_SCAN_METHOD_SEVERITY";
      case 3: 
        return "API_USE_SCAN_FIELD_SEVERITY";
      }
      break;
    }
    return null;
  }
}

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

import org.eclipse.core.runtime.Assert;
import org.eclipse.pde.api.tools.internal.provisional.problems.IApiProblem;
import org.eclipse.pde.api.tools.internal.provisional.problems.IApiProblemFilter;

public class ApiProblemFilter
  implements IApiProblemFilter, Cloneable
{
  public static final String HANDLE_ARGUMENTS_DELIMITER = ",";
  public static final String HANDLE_DELIMITER = "%]";
  private String fComponentId = null;
  private IApiProblem fProblem = null;
  private String fComment = null;
  
  public ApiProblemFilter(String componentid, IApiProblem problem, String comment)
  {
    fComponentId = componentid;
    Assert.isNotNull(problem);
    fProblem = problem;
    fComment = comment;
  }
  
  public String getComment()
  {
    return fComment;
  }
  
  public void setComment(String comment)
  {
    fComment = comment;
  }
  
  public String getComponentId()
  {
    return fComponentId;
  }
  
  public boolean equals(Object obj)
  {
    if ((obj instanceof IApiProblemFilter))
    {
      IApiProblemFilter filter = (IApiProblemFilter)obj;
      
      return (elementsEqual(filter.getComponentId(), fComponentId)) && (filter.getUnderlyingProblem().equals(fProblem));
    }
    if ((obj instanceof IApiProblem)) {
      return fProblem.equals(obj);
    }
    return super.equals(obj);
  }
  
  public int hashCode()
  {
    return fProblem.hashCode() + fComponentId.hashCode();
  }
  
  private boolean elementsEqual(Object s1, Object s2)
  {
    return ((s1 == null) && (s2 == null)) || ((s1 != null) && (s1.equals(s2)));
  }
  
  public String toString()
  {
    StringBuffer buffer = new StringBuffer();
    buffer.append("Filter for : ");
    buffer.append(fProblem.toString());
    return buffer.toString();
  }
  
  public Object clone()
  {
    return new ApiProblemFilter(fComponentId, fProblem, fComment);
  }
  
  public IApiProblem getUnderlyingProblem()
  {
    return fProblem;
  }
  
  public String getHandle()
  {
    StringBuffer buffer = new StringBuffer();
    buffer.append(fProblem.getId());
    buffer.append("%]");
    buffer.append(fProblem.getResourcePath());
    buffer.append("%]");
    buffer.append(fProblem.getTypeName());
    buffer.append("%]");
    String[] margs = fProblem.getMessageArguments();
    for (int i = 0; i < margs.length; i++)
    {
      buffer.append(margs[i]);
      if (i < margs.length - 1) {
        buffer.append(",");
      }
    }
    return buffer.toString();
  }
}

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

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

public abstract class ApiDescriptionVisitor
{
  public boolean visitElement(IElementDescriptor element, IApiAnnotations description)
  {
    return true;
  }
  
  public void endVisitElement(IElementDescriptor element, IApiAnnotations description) {}
}

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

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ISaveContext;
import org.eclipse.core.resources.ISaveParticipant;
import org.eclipse.core.resources.ProjectScope;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.preferences.DefaultScope;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.IPreferencesService;
import org.eclipse.core.runtime.preferences.IScopeContext;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.pde.api.tools.internal.ApiBaselineManager;
import org.eclipse.pde.api.tools.internal.ApiDescription;
import org.eclipse.pde.api.tools.internal.ApiFilterStore;
import org.eclipse.pde.api.tools.internal.JavadocTagManager;
import org.eclipse.pde.api.tools.internal.SessionManager;
import org.eclipse.pde.api.tools.internal.WorkspaceDeltaProcessor;
import org.eclipse.pde.api.tools.internal.builder.AbstractProblemDetector;
import org.eclipse.pde.api.tools.internal.builder.ApiAnalysisBuilder;
import org.eclipse.pde.api.tools.internal.builder.ReferenceAnalyzer;
import org.eclipse.pde.api.tools.internal.builder.ReferenceExtractor;
import org.eclipse.pde.api.tools.internal.builder.ReferenceResolver;
import org.eclipse.pde.api.tools.internal.comparator.ClassFileComparator;
import org.eclipse.pde.api.tools.internal.descriptors.ElementDescriptorImpl;
import org.eclipse.pde.api.tools.internal.model.ProjectComponent;
import org.eclipse.pde.api.tools.internal.provisional.comparator.ApiComparator;
import org.eclipse.pde.api.tools.internal.provisional.problems.IApiProblemTypes;
import org.eclipse.pde.api.tools.internal.provisional.scanner.TagScanner;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.service.prefs.BackingStoreException;

public class ApiPlugin
  extends Plugin
  implements ISaveParticipant
{
  public static final String EXTENSION_JAVADOC_TAGS = "apiJavadocTags";
  public static final String PLUGIN_ID = "org.eclipse.pde.api.tools";
  public static final String NATURE_ID = "org.eclipse.pde.api.tools.apiAnalysisNature";
  public static final int INTERNAL_ERROR = 120;
  public static final int ERROR = 121;
  public static final int REPORT_RESOLUTION_ERRORS = 122;
  public static final int REPORT_BASELINE_IS_DISPOSED = 123;
  public static final int SEVERITY_IGNORE = 0;
  public static final int SEVERITY_WARNING = 1;
  public static final int SEVERITY_ERROR = 2;
  public static final String VALUE_IGNORE = "Ignore";
  public static final String VALUE_WARNING = "Warning";
  public static final String VALUE_ERROR = "Error";
  public static final String VALUE_DISABLED = "Disabled";
  public static final String VALUE_ENABLED = "Enabled";
  public static final String BUILDER_ID = "org.eclipse.pde.api.tools.apiAnalysisBuilder";
  public static final String BASELINE_IS_DISPOSED = "baseline is disposed";
  private static ApiPlugin fgDefault = null;
  private static JavadocTagManager fgTagManager = null;
  private static ISessionManager fgSessionManager = null;
  private BundleContext fBundleContext = null;
  private static final String BUILDER_DEBUG = "org.eclipse.pde.api.tools/debug/builder";
  private static final String DELTA_DEBUG = "org.eclipse.pde.api.tools/debug/delta";
  private static final String CLASSFILE_VISITOR_DEBUG = "org.eclipse.pde.api.tools/debug/classfilevisitor";
  private static final String DESCRIPTOR_FRAMEWORK_DEBUG = "org.eclipse.pde.api.tools/debug/descriptor/framework";
  private static final String TAG_SCANNER_DEBUG = "org.eclipse.pde.api.tools/debug/tagscanner";
  private static final String PLUGIN_WORKSPACE_COMPONENT_DEBUG = "org.eclipse.pde.api.tools/debug/pluginworkspacecomponent";
  private static final String API_PROFILE_MANAGER_DEBUG = "org.eclipse.pde.api.tools/debug/profilemanager";
  private static final String API_FILTER_STORE_DEBUG = "org.eclipse.pde.api.tools/debug/apifilterstore";
  private static final String API_REFERENCE_ANALYZER_DEBUG = "org.eclipse.pde.api.tools/debug/refanalyzer";
  private static final String PROBLEM_DETECTOR_DEBUG = "org.eclipse.pde.api.tools/debug/problemdetector";
  private static final String REFERENCE_RESOLVER_DEBUG = "org.eclipse.pde.api.tools/debug/refresolver";
  private static final String API_DESCRIPTION = "org.eclipse.pde.api.tools/debug/apidescription";
  private static final String WORKSPACE_DELTA_PROCESSOR = "org.eclipse.pde.api.tools/debug/workspacedeltaprocessor";
  public static final String TRUE = "true";
  public static String[] AllCompatibilityKeys = {
    IApiProblemTypes.API_COMPONENT_REMOVED_TYPE, 
    IApiProblemTypes.API_COMPONENT_REMOVED_API_TYPE, 
    IApiProblemTypes.API_COMPONENT_REMOVED_REEXPORTED_TYPE, 
    IApiProblemTypes.API_COMPONENT_REMOVED_REEXPORTED_API_TYPE, 
    IApiProblemTypes.ANNOTATION_REMOVED_FIELD, 
    IApiProblemTypes.ANNOTATION_REMOVED_METHOD, 
    IApiProblemTypes.ANNOTATION_REMOVED_TYPE_MEMBER, 
    IApiProblemTypes.ANNOTATION_CHANGED_TYPE_CONVERSION, 
    IApiProblemTypes.ANNOTATION_ADDED_METHOD_NO_DEFAULT_VALUE, 
    IApiProblemTypes.INTERFACE_ADDED_FIELD, 
    IApiProblemTypes.INTERFACE_ADDED_METHOD, 
    IApiProblemTypes.INTERFACE_ADDED_RESTRICTIONS, 
    IApiProblemTypes.INTERFACE_ADDED_SUPER_INTERFACE_WITH_METHODS, 
    IApiProblemTypes.INTERFACE_ADDED_TYPE_PARAMETER, 
    IApiProblemTypes.INTERFACE_REMOVED_TYPE_PARAMETER, 
    IApiProblemTypes.INTERFACE_REMOVED_FIELD, 
    IApiProblemTypes.INTERFACE_REMOVED_METHOD, 
    IApiProblemTypes.INTERFACE_REMOVED_TYPE_MEMBER, 
    IApiProblemTypes.INTERFACE_CHANGED_TYPE_CONVERSION, 
    IApiProblemTypes.INTERFACE_CHANGED_CONTRACTED_SUPERINTERFACES_SET, 
    IApiProblemTypes.ENUM_CHANGED_CONTRACTED_SUPERINTERFACES_SET, 
    IApiProblemTypes.ENUM_CHANGED_TYPE_CONVERSION, 
    IApiProblemTypes.ENUM_REMOVED_FIELD, 
    IApiProblemTypes.ENUM_REMOVED_ENUM_CONSTANT, 
    IApiProblemTypes.ENUM_REMOVED_METHOD, 
    IApiProblemTypes.ENUM_REMOVED_TYPE_MEMBER, 
    IApiProblemTypes.CLASS_ADDED_METHOD, 
    IApiProblemTypes.CLASS_ADDED_RESTRICTIONS, 
    IApiProblemTypes.CLASS_ADDED_TYPE_PARAMETER, 
    IApiProblemTypes.CLASS_CHANGED_CONTRACTED_SUPERINTERFACES_SET, 
    IApiProblemTypes.CLASS_CHANGED_NON_ABSTRACT_TO_ABSTRACT, 
    IApiProblemTypes.CLASS_CHANGED_NON_FINAL_TO_FINAL, 
    IApiProblemTypes.CLASS_CHANGED_TYPE_CONVERSION, 
    IApiProblemTypes.CLASS_CHANGED_DECREASE_ACCESS, 
    IApiProblemTypes.CLASS_REMOVED_FIELD, 
    IApiProblemTypes.CLASS_REMOVED_METHOD, 
    IApiProblemTypes.CLASS_REMOVED_CONSTRUCTOR, 
    IApiProblemTypes.CLASS_REMOVED_SUPERCLASS, 
    IApiProblemTypes.CLASS_REMOVED_TYPE_MEMBER, 
    IApiProblemTypes.CLASS_REMOVED_TYPE_PARAMETER, 
    IApiProblemTypes.FIELD_ADDED_VALUE, 
    IApiProblemTypes.FIELD_CHANGED_TYPE, 
    IApiProblemTypes.FIELD_CHANGED_VALUE, 
    IApiProblemTypes.FIELD_CHANGED_DECREASE_ACCESS, 
    IApiProblemTypes.FIELD_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT, 
    IApiProblemTypes.FIELD_CHANGED_NON_FINAL_TO_FINAL, 
    IApiProblemTypes.FIELD_CHANGED_STATIC_TO_NON_STATIC, 
    IApiProblemTypes.FIELD_CHANGED_NON_STATIC_TO_STATIC, 
    IApiProblemTypes.FIELD_REMOVED_VALUE, 
    IApiProblemTypes.FIELD_REMOVED_TYPE_ARGUMENT, 
    IApiProblemTypes.METHOD_ADDED_RESTRICTIONS, 
    IApiProblemTypes.METHOD_ADDED_TYPE_PARAMETER, 
    IApiProblemTypes.METHOD_CHANGED_VARARGS_TO_ARRAY, 
    IApiProblemTypes.METHOD_CHANGED_DECREASE_ACCESS, 
    IApiProblemTypes.METHOD_CHANGED_NON_ABSTRACT_TO_ABSTRACT, 
    IApiProblemTypes.METHOD_CHANGED_NON_STATIC_TO_STATIC, 
    IApiProblemTypes.METHOD_CHANGED_STATIC_TO_NON_STATIC, 
    IApiProblemTypes.METHOD_CHANGED_NON_FINAL_TO_FINAL, 
    IApiProblemTypes.METHOD_REMOVED_ANNOTATION_DEFAULT_VALUE, 
    IApiProblemTypes.METHOD_REMOVED_TYPE_PARAMETER, 
    IApiProblemTypes.CONSTRUCTOR_ADDED_TYPE_PARAMETER, 
    IApiProblemTypes.CONSTRUCTOR_CHANGED_VARARGS_TO_ARRAY, 
    IApiProblemTypes.CONSTRUCTOR_CHANGED_DECREASE_ACCESS, 
    IApiProblemTypes.CONSTRUCTOR_REMOVED_TYPE_PARAMETER, 
    IApiProblemTypes.TYPE_PARAMETER_ADDED_CLASS_BOUND, 
    IApiProblemTypes.TYPE_PARAMETER_CHANGED_CLASS_BOUND, 
    IApiProblemTypes.TYPE_PARAMETER_REMOVED_CLASS_BOUND, 
    IApiProblemTypes.TYPE_PARAMETER_ADDED_INTERFACE_BOUND, 
    IApiProblemTypes.TYPE_PARAMETER_CHANGED_INTERFACE_BOUND, 
    IApiProblemTypes.TYPE_PARAMETER_REMOVED_INTERFACE_BOUND, 
    IApiProblemTypes.TYPE_PARAMETER_REMOVED_INTERFACE_BOUND, 
    "report_api_breakage_when_major_version_incremented" };
  private HashSet savelisteners = new HashSet();
  private int logBits = 0;
  private static int LogBits = 0;
  private WorkspaceDeltaProcessor deltaProcessor = null;
  private static final int RESOLUTION_LOG_BIT = 1;
  private static final int BASELINE_DISPOSED_LOG_BIT = 2;
  
  public ApiPlugin()
  {
    fgDefault = this;
  }
  
  public static ApiPlugin getDefault()
  {
    return fgDefault;
  }
  
  public static void log(IStatus status)
  {
    ApiPlugin getDefault = getDefault();
    if (getDefault == null) {
      switch (status.getCode())
      {
      case 122: 
        if ((LogBits & 0x1) != 0) {
          break;
        }
        Throwable exception = status.getException();
        if (exception != null) {
          exception.printStackTrace();
        }
        LogBits |= 0x1;
        
        break;
      case 123: 
        if ((LogBits & 0x2) != 0) {
          break;
        }
        Throwable exception = status.getException();
        if (exception != null) {
          exception.printStackTrace();
        }
        LogBits |= 0x2;
        
        break;
      default: 
        Throwable exception = status.getException();
        if (exception == null) {
          break;
        }
        exception.printStackTrace();break;
      }
    } else {
      switch (status.getCode())
      {
      case 122: 
        if ((logBits & 0x1) == 0)
        {
          getDefault.getLog().log(status);
          logBits |= 0x1;
        }
        break;
      case 123: 
        if ((logBits & 0x2) == 0)
        {
          getDefault.getLog().log(status);
          logBits |= 0x2;
        }
        break;
      default: 
        getDefault.getLog().log(status);
      }
    }
  }
  
  public static void log(Throwable t)
  {
    log(newErrorStatus("Error logged from API Tools Core: ", t));
  }
  
  public static void logErrorMessage(String message)
  {
    log(newErrorStatus("Internal message logged from API Tools Core: " + message, null));
  }
  
  public static IStatus newErrorStatus(String message, Throwable exception)
  {
    return new Status(4, "org.eclipse.pde.api.tools", 120, message, exception);
  }
  
  public static boolean isRunningInFramework()
  {
    return fgDefault != null;
  }
  
  public IApiBaselineManager getApiBaselineManager()
  {
    return ApiBaselineManager.getManager();
  }
  
  public static JavadocTagManager getJavadocTagManager()
  {
    if (fgTagManager == null) {
      fgTagManager = new JavadocTagManager();
    }
    return fgTagManager;
  }
  
  public void addSaveParticipant(ISaveParticipant participant)
  {
    if (participant != null) {
      savelisteners.add(participant);
    }
  }
  
  public void removeSaveParticipant(ISaveParticipant participant)
  {
    if (participant != null) {
      savelisteners.remove(participant);
    }
  }
  
  public void doneSaving(ISaveContext context)
  {
    ISaveParticipant sp = null;
    for (Iterator iter = savelisteners.iterator(); iter.hasNext();)
    {
      sp = (ISaveParticipant)iter.next();
      sp.doneSaving(context);
    }
  }
  
  public void prepareToSave(ISaveContext context)
    throws CoreException
  {
    ISaveParticipant sp = null;
    for (Iterator iter = savelisteners.iterator(); iter.hasNext();)
    {
      sp = (ISaveParticipant)iter.next();
      sp.prepareToSave(context);
    }
  }
  
  public void rollback(ISaveContext context)
  {
    ISaveParticipant sp = null;
    for (Iterator iter = savelisteners.iterator(); iter.hasNext();)
    {
      sp = (ISaveParticipant)iter.next();
      sp.rollback(context);
    }
  }
  
  public void saving(ISaveContext context)
    throws CoreException
  {
    ISaveParticipant sp = null;
    for (Iterator iter = savelisteners.iterator(); iter.hasNext();)
    {
      sp = (ISaveParticipant)iter.next();
      sp.saving(context);
    }
    IEclipsePreferences node = InstanceScope.INSTANCE.getNode("org.eclipse.pde.api.tools");
    if (node != null) {
      try
      {
        node.flush();
      }
      catch (BackingStoreException e)
      {
        log(e);
      }
    }
  }
  
  /* Error */
  public void start(BundleContext context)
    throws java.lang.Exception
  {
    // Byte code:
    //   0: aload_0
    //   1: aload_1
    //   2: invokespecial 664	org/eclipse/core/runtime/Plugin:start	(Lorg/osgi/framework/BundleContext;)V
    //   5: goto +60 -> 65
    //   8: astore_2
    //   9: invokestatic 660	org/eclipse/core/resources/ResourcesPlugin:getWorkspace	()Lorg/eclipse/core/resources/IWorkspace;
    //   12: ldc 4
    //   14: aload_0
    //   15: invokeinterface 709 3 0
    //   20: pop
    //   21: aload_0
    //   22: aload_1
    //   23: putfield 571	org/eclipse/pde/api/tools/internal/provisional/ApiPlugin:fBundleContext	Lorg/osgi/framework/BundleContext;
    //   26: aload_0
    //   27: new 346	org/eclipse/pde/api/tools/internal/WorkspaceDeltaProcessor
    
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-2017. Infinite Loop Ltd