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

buffers.ITextFileBuffer
    //   163	5	14	document	org.eclipse.jface.text.IDocument
    //   173	74	15	edit	org.eclipse.text.edits.TextEdit
    //   201	34	16	file	org.eclipse.core.resources.IFile
    //   215	30	17	edits	java.util.HashSet
    //   255	16	18	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   129	255	255	finally
  }
  
  private static void abort(String message, Throwable exception)
    throws CoreException
  {
    IStatus status = new Status(4, "org.eclipse.pde.api.tools", message, exception);
    throw new CoreException(status);
  }
  
  public static void annotateApiSettings(IJavaProject project, IApiDescription settings, String xml)
    throws CoreException
  {
    Element root = null;
    try
    {
      root = Util.parseDocument(xml);
    }
    catch (CoreException ce)
    {
      abort("Failed to parse API description xml file", ce);
    }
    if (!root.getNodeName().equals("component")) {
      abort(ScannerMessages.ComponentXMLScanner_0, null);
    }
    String version = root.getAttribute("version");
    ApiDescription desc = (ApiDescription)settings;
    desc.setEmbeddedVersion(version);
    
    boolean earlierversion = desc.compareEmbeddedVersionTo("1.2") == 1;
    NodeList packages = root.getElementsByTagName("package");
    NodeList types = null;
    IPackageDescriptor packdesc = null;
    Element type = null;
    for (int i = 0; i < packages.getLength(); i++)
    {
      Element pkg = (Element)packages.item(i);
      
      String pkgName = pkg.getAttribute("name");
      packdesc = Factory.packageDescriptor(pkgName);
      types = pkg.getElementsByTagName("type");
      for (int j = 0; j < types.getLength(); j++)
      {
        type = (Element)types.item(j);
        String name = type.getAttribute("name");
        if (name.length() == 0) {
          abort("Missing type name", null);
        }
        IReferenceTypeDescriptor typedesc = packdesc.getType(name);
        annotateDescriptor(project, settings, typedesc, type, earlierversion);
        annotateMethodSettings(project, settings, typedesc, type, earlierversion);
        annotateFieldSettings(project, settings, typedesc, type, earlierversion);
      }
    }
  }
  
  private static void annotateDescriptor(IJavaProject project, IApiDescription settings, IElementDescriptor descriptor, Element element, boolean earlierversion)
  {
    int typeVis = getVisibility(element);
    if (typeVis != -1) {
      settings.setVisibility(descriptor, typeVis);
    }
    settings.setRestrictions(descriptor, getRestrictions(project, element, descriptor, earlierversion));
  }
  
  private static int getRestrictions(IJavaProject project, Element element, IElementDescriptor descriptor, boolean earlierversion)
  {
    int res = 0;
    if (element.hasAttribute("restrictions")) {
      res = Integer.parseInt(element.getAttribute("restrictions"));
    } else {
      switch (descriptor.getElementType())
      {
      case 5: 
        res = annotateRestriction(element, "reference", 8, res);
        break;
      case 6: 
        IMethodDescriptor method = (IMethodDescriptor)descriptor;
        res = annotateRestriction(element, "reference", 8, res);
        if (!method.isConstructor()) {
          res = annotateRestriction(element, "override", 16, res);
        }
        break;
      case 2: 
        IReferenceTypeDescriptor rtype = (IReferenceTypeDescriptor)descriptor;
        res = annotateRestriction(element, "implement", 1, res);
        if ((earlierversion) && (RestrictionModifiers.isImplementRestriction(res))) {
          res |= 0x2;
        }
        res = annotateRestriction(element, "extend", 2, res);
        if (!RestrictionModifiers.isExtendRestriction(res)) {
          res = annotateRestriction(element, "subclass", 2, res);
        }
        res = annotateRestriction(element, "instantiate", 4, res);
        IType type = null;
        if (project != null) {
          try
          {
            type = project.findType(rtype.getQualifiedName());
            if (type != null) {
              if (Flags.isInterface(type.getFlags()))
              {
                res &= 0xFFFFFFFB;
              }
              else
              {
                res &= 0xFFFFFFFE;
                if (Flags.isFinal(type.getFlags())) {
                  res &= 0xFFFFFFFD;
                }
                if (Flags.isAbstract(type.getFlags())) {
                  res &= 0xFFFFFFFB;
                }
              }
            }
          }
          catch (JavaModelException localJavaModelException) {}
        }
        break;
      }
    }
    return res;
  }
  
  private static int annotateRestriction(Element element, String name, int flag, int res)
  {
    String value = element.getAttribute(name);
    int lres = res;
    if ((value.length() > 0) && 
      (!Boolean.valueOf(value).booleanValue())) {
      lres = res | flag;
    }
    return lres;
  }
  
  private static int getVisibility(Element element)
  {
    String attribute = element.getAttribute("visibility");
    try
    {
      return Integer.parseInt(attribute);
    }
    catch (NumberFormatException localNumberFormatException)
    {
      if ("API".equals(attribute)) {
        return 1;
      }
      if ("PRIVATE".equals(attribute)) {
        return 2;
      }
      if ("PRIVATE_PERMISSABLE".equals(attribute)) {
        return 8;
      }
      if ("SPI".equals(attribute)) {
        return 4;
      }
    }
    return -1;
  }
  
  private static void annotateFieldSettings(IJavaProject project, IApiDescription settings, IReferenceTypeDescriptor typedesc, Element type, boolean earlierversion)
    throws CoreException
  {
    NodeList fields = type.getElementsByTagName("field");
    Element field = null;
    IFieldDescriptor fielddesc = null;
    String name = null;
    for (int i = 0; i < fields.getLength(); i++)
    {
      field = (Element)fields.item(i);
      name = field.getAttribute("name");
      if (name == null) {
        abort(ScannerMessages.ComponentXMLScanner_1, null);
      }
      fielddesc = typedesc.getField(name);
      annotateDescriptor(project, settings, fielddesc, field, earlierversion);
    }
  }
  
  private static void annotateMethodSettings(IJavaProject project, IApiDescription settings, IReferenceTypeDescriptor typedesc, Element type, boolean earlierversion)
    throws CoreException
  {
    NodeList methods = type.getElementsByTagName("method");
    Element method = null;
    IMethodDescriptor methoddesc = null;
    for (int i = 0; i < methods.getLength(); i++)
    {
      method = (Element)methods.item(i);
      String name = method.getAttribute("name");
      if (name == null) {
        abort(ScannerMessages.ComponentXMLScanner_2, null);
      }
      String signature = method.getAttribute("signature");
      if (signature == null) {
        abort(ScannerMessages.ComponentXMLScanner_3, null);
      }
      signature = signature.replace('.', '/');
      methoddesc = typedesc.getMethod(name, signature);
      annotateDescriptor(project, settings, methoddesc, method, earlierversion);
    }
  }
}

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

import java.util.HashSet;
import java.util.Set;
import java.util.Stack;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.pde.api.tools.internal.provisional.ApiDescriptionVisitor;
import org.eclipse.pde.api.tools.internal.provisional.IApiAnnotations;
import org.eclipse.pde.api.tools.internal.provisional.descriptors.IElementDescriptor;
import org.eclipse.pde.api.tools.internal.provisional.descriptors.IFieldDescriptor;
import org.eclipse.pde.api.tools.internal.provisional.descriptors.IMethodDescriptor;
import org.eclipse.pde.api.tools.internal.provisional.descriptors.IPackageDescriptor;
import org.eclipse.pde.api.tools.internal.provisional.descriptors.IReferenceTypeDescriptor;
import org.eclipse.pde.api.tools.internal.provisional.model.IApiComponent;
import org.eclipse.pde.api.tools.internal.util.Signatures;
import org.eclipse.pde.api.tools.internal.util.Util;
import org.w3c.dom.Document;
import org.w3c.dom.Element;

public class ApiDescriptionXmlCreator
  extends ApiDescriptionVisitor
{
  private Element fComponent;
  private Document fDoc;
  private Element fPackage;
  private int fPackageVisibility;
  private Stack fTypeStack;
  private Set fVisitedPackages;
  
  public ApiDescriptionXmlCreator(IApiComponent component)
    throws CoreException
  {
    this(component.getName(), component.getSymbolicName());
  }
  
  public ApiDescriptionXmlCreator(String componentName, String componentId)
    throws CoreException
  {
    fDoc = Util.newDocument();
    fComponent = fDoc.createElement("component");
    fComponent.setAttribute("name", componentName);
    fComponent.setAttribute("version", "1.2");
    fDoc.appendChild(fComponent);
    Element plugin = fDoc.createElement("plugin");
    plugin.setAttribute("id", componentId);
    fComponent.appendChild(plugin);
    fVisitedPackages = new HashSet();
    fTypeStack = new Stack();
  }
  
  private void annotateElementAttributes(IApiAnnotations description, Element element)
  {
    element.setAttribute("restrictions", Integer.toString(description.getRestrictions()));
    int visibility = description.getVisibility();
    if (visibility != fPackageVisibility) {
      element.setAttribute("visibility", Integer.toString(visibility));
    }
  }
  
  public void endVisitElement(IElementDescriptor element, IApiAnnotations description)
  {
    switch (element.getElementType())
    {
    case 1: 
      if ((fPackage != null) && (fPackage.hasChildNodes())) {
        fComponent.appendChild(fPackage);
      }
      fPackage = null;
      break;
    case 2: 
      fTypeStack.pop();
    }
  }
  
  public String getXML()
    throws CoreException
  {
    return Util.serializeDocument(fDoc);
  }
  
  public boolean visitElement(IElementDescriptor element, IApiAnnotations description)
  {
    switch (element.getElementType())
    {
    case 1: 
      IPackageDescriptor pkg = (IPackageDescriptor)element;
      String pkgName = pkg.getName();
      if (fVisitedPackages.add(pkgName))
      {
        fPackage = fDoc.createElement("package");
        fPackage.setAttribute("name", pkgName);
        
        fPackageVisibility = description.getVisibility();
        fPackage.setAttribute("visibility", Integer.toString(fPackageVisibility));
        fVisitedPackages.add(pkgName);
      }
      break;
    case 2: 
      IReferenceTypeDescriptor typeDesc = (IReferenceTypeDescriptor)element;
      fTypeStack.push(fDoc.createElement("type"));
      Element type = (Element)fTypeStack.peek();
      annotateElementAttributes(description, type);
      fPackage.appendChild(type);
      type.setAttribute("name", Signatures.getSimpleTypeName(typeDesc.getQualifiedName()));
      break;
    case 6: 
      IMethodDescriptor desc = (IMethodDescriptor)element;
      Element method = fDoc.createElement("method");
      Element type = (Element)fTypeStack.peek();
      
      annotateElementAttributes(description, method);
      if (method.hasAttributes())
      {
        type.appendChild(method);
        
        method.setAttribute("signature", desc.getSignature());
        method.setAttribute("name", desc.getName());
      }
      break;
    case 5: 
      IFieldDescriptor desc = (IFieldDescriptor)element;
      Element field = fDoc.createElement("field");
      Element type = (Element)fTypeStack.peek();
      annotateElementAttributes(description, field);
      if (field.hasAttributes())
      {
        type.appendChild(field);
        
        field.setAttribute("name", desc.getName());
      }
      break;
    }
    return true;
  }
}

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

import java.util.Map;
import org.eclipse.core.resources.WorkspaceJob;

class ApiFilterStore$1
  extends WorkspaceJob
{
  final ApiFilterStore this$0;
  private final Map val$filters;
  
  ApiFilterStore$1(ApiFilterStore paramApiFilterStore, String $anonymous0, Map paramMap)
  {
    super($anonymous0);this$0 = paramApiFilterStore;val$filters = paramMap;
  }
  
  /* Error */
  public org.eclipse.core.runtime.IStatus runInWorkspace(org.eclipse.core.runtime.IProgressMonitor monitor)
    throws org.eclipse.core.runtime.CoreException
  {
    // Byte code:
    //   0: getstatic 156	org/eclipse/pde/api/tools/internal/ApiFilterStore:DEBUG	Z
    //   3: ifeq +41 -> 44
    //   6: getstatic 153	java/lang/System:out	Ljava/io/PrintStream;
    //   9: new 76	java/lang/StringBuffer
    //   12: dup
    //   13: ldc 4
    //   15: invokespecial 165	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   18: aload_0
    //   19: getfield 161	org/eclipse/pde/api/tools/internal/ApiFilterStore$1:this$0	Lorg/eclipse/pde/api/tools/internal/ApiFilterStore;
    //   22: getfield 159	org/eclipse/pde/api/tools/internal/ApiFilterStore:fProject	Lorg/eclipse/jdt/core/IJavaProject;
    //   25: invokeinterface 187 1 0
    //   30: invokevirtual 166	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   33: ldc 1
    //   35: invokevirtual 166	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   38: invokevirtual 164	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   41: invokevirtual 163	java/io/PrintStream:println	(Ljava/lang/String;)V
    //   44: aload_1
    //   45: invokestatic 168	org/eclipse/core/runtime/SubMonitor:convert	(Lorg/eclipse/core/runtime/IProgressMonitor;)Lorg/eclipse/core/runtime/SubMonitor;
    //   48: astore_2
    //   49: aload_0
    //   50: getfield 161	org/eclipse/pde/api/tools/internal/ApiFilterStore$1:this$0	Lorg/eclipse/pde/api/tools/internal/ApiFilterStore;
    //   53: getfield 159	org/eclipse/pde/api/tools/internal/ApiFilterStore:fProject	Lorg/eclipse/jdt/core/IJavaProject;
    //   56: invokeinterface 188 1 0
    //   61: astore_3
    //   62: aload_3
    //   63: invokeinterface 185 1 0
    //   68: ifne +51 -> 119
    //   71: getstatic 156	org/eclipse/pde/api/tools/internal/ApiFilterStore:DEBUG	Z
    //   74: ifeq +41 -> 115
    //   77: getstatic 153	java/lang/System:out	Ljava/io/PrintStream;
    //   80: new 76	java/lang/StringBuffer
    //   83: dup
    //   84: ldc 5
    //   86: invokespecial 165	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   89: aload_0
    //   90: getfield 161	org/eclipse/pde/api/tools/internal/ApiFilterStore$1:this$0	Lorg/eclipse/pde/api/tools/internal/ApiFilterStore;
    //   93: getfield 159	org/eclipse/pde/api/tools/internal/ApiFilterStore:fProject	Lorg/eclipse/jdt/core/IJavaProject;
    //   96: invokeinterface 187 1 0
    //   101: invokevirtual 166	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   104: ldc 2
    //   106: invokevirtual 166	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   109: invokevirtual 164	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   112: invokevirtual 163	java/io/PrintStream:println	(Ljava/lang/String;)V
    //   115: getstatic 154	org/eclipse/core/runtime/Status:CANCEL_STATUS	Lorg/eclipse/core/runtime/IStatus;
    //   118: areturn
    //   119: aload_0
    //   120: getfield 161	org/eclipse/pde/api/tools/internal/ApiFilterStore$1:this$0	Lorg/eclipse/pde/api/tools/internal/ApiFilterStore;
    //   123: aload_0
    //   124: getfield 160	org/eclipse/pde/api/tools/internal/ApiFilterStore$1:val$filters	Ljava/util/Map;
    //   127: invokevirtual 170	org/eclipse/pde/api/tools/internal/ApiFilterStore:getStoreAsXml	(Ljava/util/Map;)Ljava/lang/String;
    //   130: astore 4
    //   132: aload_3
    //   133: aload_0
    //   134: getfield 161	org/eclipse/pde/api/tools/internal/ApiFilterStore$1:this$0	Lorg/eclipse/pde/api/tools/internal/ApiFilterStore;
    //   137: iconst_0
    //   138: invokevirtual 169	org/eclipse/pde/api/tools/internal/ApiFilterStore:getFilterFilePath	(Z)Lorg/eclipse/core/runtime/IPath;
    //   141: invokeinterface 186 2 0
    //   146: astore 5
    //   148: aload 4
    //   150: ifnonnull +120 -> 270
    //   153: getstatic 156	org/eclipse/pde/api/tools/internal/ApiFilterStore:DEBUG	Z
    //   156: ifeq +41 -> 197
    //   159: getstatic 153	java/lang/System:out	Ljava/io/PrintStream;
    //   162: new 76	java/lang/StringBuffer
    //   165: dup
    //   166: ldc 3
    //   168: invokespecial 165	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   171: aload_0
    //   172: getfield 161	org/eclipse/pde/api/tools/internal/ApiFilterStore$1:this$0	Lorg/eclipse/pde/api/tools/internal/ApiFilterStore;
    //   175: getfield 159	org/eclipse/pde/api/tools/internal/ApiFilterStore:fProject	Lorg/eclipse/jdt/core/IJavaProject;
    //   178: invokeinterface 187 1 0
    //   183: invokevirtual 166	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   186: ldc 1
    //   188: invokevirtual 166	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   191: invokevirtual 164	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   194: invokevirtual 163	java/io/PrintStream:println	(Ljava/lang/String;)V
    //   197: aload 5
    //   199: invokeinterface 174 1 0
    //   204: ifeq +62 -> 266
    //   207: aload 5
    //   209: invokeinterface 175 1 0
    //   214: checkcast 79	org/eclipse/core/resources/IFolder
    //   217: astore 6
    //   219: aload 5
    //   221: iconst_1
    //   222: aload_2
    //   223: invokeinterface 177 3 0
    //   228: aload 6
    //   230: invokeinterface 182 1 0
    //   235: arraylength
    //   236: ifne +22 -> 258
    //   239: aload 6
    //   241: invokeinterface 181 1 0
    //   246: ifeq +12 -> 258
    //   249: aload 6
    //   251: iconst_1
    //   252: aload_2
    //   253: invokeinterface 183 3 0
    //   258: aload_0
    //   259: getfield 161	org/eclipse/pde/api/tools/internal/ApiFilterStore$1:this$0	Lorg/eclipse/pde/api/tools/internal/ApiFilterStore;
    //   262: iconst_1
    //   263: putfield 158	org/eclipse/pde/api/tools/internal/ApiFilterStore:fTriggeredChange	Z
    //   266: getstatic 155	org/eclipse/core/runtime/Status:OK_STATUS	Lorg/eclipse/core/runtime/IStatus;
    //   269: areturn
    //   270: aload 4
    //   272: invokestatic 172	org/eclipse/pde/api/tools/internal/util/Util:getInputStreamFromString	(Ljava/lang/String;)Ljava/io/InputStream;
    //   275: astore 6
    //   277: aload 6
    //   279: ifnonnull +7 -> 286
    //   282: getstatic 154	org/eclipse/core/runtime/Status:CANCEL_STATUS	Lorg/eclipse/core/runtime/IStatus;
    //   285: areturn
    //   286: aload 5
    //   288: invokeinterface 176 1 0
    //   293: invokeinterface 185 1 0
    //   298: ifeq +84 -> 382
    //   301: aload 5
    //   303: invokeinterface 173 1 0
    //   308: ifne +49 -> 357
    //   311: aload 5
    //   313: invokeinterface 175 1 0
    //   318: checkcast 79	org/eclipse/core/resources/IFolder
    //   321: astore 7
    //   323: aload 7
    //   325: invokeinterface 180 1 0
    //   330: ifne +13 -> 343
    //   333: aload 7
    //   335: iconst_1
    //   336: iconst_1
    //   337: aload_2
    //   338: invokeinterface 184 4 0
    //   343: aload 5
    //   345: aload 6
    //   347: iconst_1
    //   348: aload_2
    //   349: invokeinterface 178 4 0
    //   354: goto +28 -> 382
    //   357: aload 5
    //   359: aload 6
    //   361: iconst_1
    //   362: iconst_0
    //   363: aload_2
    //   364: invokeinterface 179 5 0
    //   369: goto +13 -> 382
    //   372: astore 8
    //   374: aload 6
    //   376: invokevirtual 162	java/io/InputStream:close	()V
    //   379: aload 8
    //   381: athrow
    //   382: aload 6
    //   384: invokevirtual 162	java/io/InputStream:close	()V
    //   387: aload_0
    //   388: getfield 161	org/eclipse/pde/api/tools/internal/ApiFilterStore$1:this$0	Lorg/eclipse/pde/api/tools/internal/ApiFilterStore;
    //   391: iconst_1
    //   392: putfield 158	org/eclipse/pde/api/tools/internal/ApiFilterStore:fTriggeredChange	Z
    //   395: aload_0
    //   396: getfield 161	org/eclipse/pde/api/tools/internal/ApiFilterStore$1:this$0	Lorg/eclipse/pde/api/tools/internal/ApiFilterStore;
    //   399: iconst_0
    //   400: putfield 157	org/eclipse/pde/api/tools/internal/ApiFilterStore:fNeedsSaving	Z
    //   403: goto +16 -> 419
    //   406: astore_2
    //   407: aload_2
    //   408: invokestatic 171	org/eclipse/pde/api/tools/internal/provisional/ApiPlugin:log	(Ljava/lang/Throwable;)V
    //   411: goto +8 -> 419
    //   414: astore_2
    //   415: aload_2
    //   416: invokestatic 171	org/eclipse/pde/api/tools/internal/provisional/ApiPlugin:log	(Ljava/lang/Throwable;)V
    //   419: getstatic 155	org/eclipse/core/runtime/Status:OK_STATUS	Lorg/eclipse/core/runtime/IStatus;
    //   422: areturn
    // Line number table:
    //   Java source line #128	-> byte code offset #0
    //   Java source line #129	-> byte code offset #6
    //   Java source line #132	-> byte code offset #44
    //   Java source line #133	-> byte code offset #49
    //   Java source line #134	-> byte code offset #62
    //   Java source line #135	-> byte code offset #71
    //   Java source line #136	-> byte code offset #77
    //   Java source line #138	-> byte code offset #115
    //   Java source line #140	-> byte code offset #119
    //   Java source line #141	-> byte code offset #132
    //   Java source line #142	-> byte code offset #148
    //   Java source line #143	-> byte code offset #153
    //   Java source line #144	-> byte code offset #159
    //   Java source line #147	-> byte code offset #197
    //   Java source line #148	-> byte code offset #207
    //   Java source line #149	-> byte code offset #219
    //   Java source line #150	-> byte code offset #228
    //   Java source line #151	-> byte code offset #249
    //   Java source line #153	-> byte code offset #258
    //   Java source line #155	-> byte code offset #266
    //   Java source line #157	-> byte code offset #270
    //   Java source line #158	-> byte code offset #277
    //   Java source line #159	-> byte code offset #282
    //   Java source line #162	-> byte code offset #286
    //   Java source line #163	-> byte code offset #301
    //   Java source line #164	-> byte code offset #311
    //   Java source line #165	-> byte code offset #323
    //   Java source line #166	-> byte code offset #333
    //   Java source line #168	-> byte code offset #343
    //   Java source line #171	-> byte code offset #357
    //   Java source line #175	-> byte code offset #372
    //   Java source line #176	-> byte code offset #374
    //   Java source line #177	-> byte code offset #379
    //   Java source line #176	-> byte code offset #382
    //   Java source line #178	-> byte code offset #387
    //   Java source line #179	-> byte code offset #395
    //   Java source line #181	-> byte code offset #406
    //   Java source line #182	-> byte code offset #407
    //   Java source line #184	-> byte code offset #414
    //   Java source line #185	-> byte code offset #415
    //   Java source line #187	-> byte code offset #419
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	423	0	this	1
    //   0	423	1	monitor	org.eclipse.core.runtime.IProgressMonitor
    //   48	316	2	localmonitor	org.eclipse.core.runtime.SubMonitor
    //   406	2	2	ce	org.eclipse.core.runtime.CoreException
    //   414	2	2	ioe	java.io.IOException
    //   61	72	3	project	org.eclipse.core.resources.IProject
    //   130	141	4	xml	String
    //   146	212	5	file	org.eclipse.core.resources.IFile
    //   217	33	6	folder	org.eclipse.core.resources.IFolder
    //   275	108	6	xstream	java.io.InputStream
    //   321	13	7	folder	org.eclipse.core.resources.IFolder
    //   372	8	8	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   286	372	372	finally
    //   44	118	406	org/eclipse/core/runtime/CoreException
    //   119	269	406	org/eclipse/core/runtime/CoreException
    //   270	285	406	org/eclipse/core/runtime/CoreException
    //   286	403	406	org/eclipse/core/runtime/CoreException
    //   44	118	414	java/io/IOException
    //   119	269	414	java/io/IOException
    //   270	285	414	java/io/IOException
    //   286	403	414	java/io/IOException
  }
}

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

import java.util.Comparator;
import java.util.Map.Entry;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IPath;

class ApiFilterStore$2
  implements Comparator
{
  final ApiFilterStore this$0;
  
  ApiFilterStore$2(ApiFilterStore paramApiFilterStore)
  {
    this$0 = paramApiFilterStore;
  }
  
  public int compare(Object o1, Object o2)
  {
    Map.Entry entry1 = (Map.Entry)o1;
    Map.Entry entry2 = (Map.Entry)o2;
    String path1 = ((IResource)entry1.getKey()).getFullPath().toOSString();
    String path2 = ((IResource)entry2.getKey()).getFullPath().toOSString();
    return path1.compareTo(path2);
  }
}

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

import java.util.Comparator;
import java.util.Map.Entry;

class ApiFilterStore$3
  implements Comparator
{
  final ApiFilterStore this$0;
  
  ApiFilterStore$3(ApiFilterStore paramApiFilterStore)
  {
    this$0 = paramApiFilterStore;
  }
  
  public int compare(Object o1, Object o2)
  {
    Map.Entry entry1 = (Map.Entry)o1;
    Map.Entry entry2 = (Map.Entry)o2;
    String typeName1 = (String)entry1.getKey();
    String typeName2 = (String)entry2.getKey();
    return typeName1.compareTo(typeName2);
  }
}

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

import java.util.Comparator;
import org.eclipse.pde.api.tools.internal.provisional.problems.IApiProblem;
import org.eclipse.pde.api.tools.internal.provisional.problems.IApiProblemFilter;

class ApiFilterStore$4
  implements Comparator
{
  final ApiFilterStore this$0;
  
  ApiFilterStore$4(ApiFilterStore paramApiFilterStore)
  {
    this$0 = paramApiFilterStore;
  }
  
  public int compare(Object o1, Object o2)
  {
    IApiProblem p1 = ((IApiProblemFilter)o1).getUnderlyingProblem();
    IApiProblem p2 = ((IApiProblemFilter)o2).getUnderlyingProblem();
    int problem1Id = p1.getId();
    int problem2Id = p2.getId();
    int ids = problem1Id - problem2Id;
    if (ids == 0)
    {
      String[] args1 = p1.getMessageArguments();
      String[] args2 = p2.getMessageArguments();
      int length = args1.length < args2.length ? args1.length : args2.length;
      for (int i = 0; i < length; i++)
      {
        int args = args1[i].compareTo(args2[i]);
        if (args != 0) {
          return args;
        }
      }
      return args1.length - args2.length;
    }
    return ids;
  }
}

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

import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceChangeListener;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.resources.WorkspaceJob;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.pde.api.tools.internal.problems.ApiProblemFilter;
import org.eclipse.pde.api.tools.internal.provisional.IApiFilterStore;
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;
import org.w3c.dom.Document;
import org.w3c.dom.Element;

public class ApiFilterStore
  implements IApiFilterStore, IResourceChangeListener
{
  private static final String SETTINGS_FOLDER = ".settings";
  public static final String GLOBAL = "!global!";
  public static final int CURRENT_STORE_VERSION = 2;
  static boolean DEBUG = Util.DEBUG;
  
  public static void setDebug(boolean debugValue)
  {
    DEBUG = (debugValue) || (Util.DEBUG);
  }
  
  private static IApiProblemFilter[] NO_FILTERS = new IApiProblemFilter[0];
  private HashMap fFilterMap = null;
  private HashMap fUnusedFilters = null;
  IJavaProject fProject = null;
  boolean fNeedsSaving = false;
  boolean fTriggeredChange = false;
  
  public ApiFilterStore(IJavaProject project)
  {
    Assert.isNotNull(project);
    fProject = project;
    ResourcesPlugin.getWorkspace().addResourceChangeListener(this);
  }
  
  public void persistApiFilters()
  {
    if (!fNeedsSaving) {
      return;
    }
    Map filters = new HashMap(fFilterMap);
    WorkspaceJob job = new WorkspaceJob("")
    {
      private final Map val$filters;
      
      /* Error */
      public org.eclipse.core.runtime.IStatus runInWorkspace(org.eclipse.core.runtime.IProgressMonitor monitor)
        throws CoreException
      {
        // Byte code:
        //   0: getstatic 156	org/eclipse/pde/api/tools/internal/ApiFilterStore:DEBUG	Z
        //   3: ifeq +41 -> 44
        //   6: getstatic 153	java/lang/System:out	Ljava/io/PrintStream;
        //   9: new 76	java/lang/StringBuffer
        //   12: dup
        //   13: ldc 4
        //   15: invokespecial 165	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
        //   18: aload_0
        //   19: getfield 161	org/eclipse/pde/api/tools/internal/ApiFilterStore$1:this$0	Lorg/eclipse/pde/api/tools/internal/ApiFilterStore;
        //   22: getfield 159	org/eclipse/pde/api/tools/internal/ApiFilterStore:fProject	Lorg/eclipse/jdt/core/IJavaProject;
        //   25: invokeinterface 187 1 0
        //   30: invokevirtual 166	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
        //   33: ldc 1
        //   35: invokevirtual 166	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
        //   38: invokevirtual 164	java/lang/StringBuffer:toString	()Ljava/lang/String;
        //   41: invokevirtual 163	java/io/PrintStream:println	(Ljava/lang/String;)V
        //   44: aload_1
        //   45: invokestatic 168	org/eclipse/core/runtime/SubMonitor:convert	(Lorg/eclipse/core/runtime/IProgressMonitor;)Lorg/eclipse/core/runtime/SubMonitor;
        //   48: astore_2
        //   49: aload_0
        //   50: getfield 161	org/eclipse/pde/api/tools/internal/ApiFilterStore$1:this$0	Lorg/eclipse/pde/api/tools/internal/ApiFilterStore;
        //   53: getfield 159	org/eclipse/pde/api/tools/internal/ApiFilterStore:fProject	Lorg/eclipse/jdt/core/IJavaProject;
        //   56: invokeinterface 188 1 0
        //   61: astore_3
        //   62: aload_3
        //   63: invokeinterface 185 1 0
        //   68: ifne +51 -> 119
        //   71: getstatic 156	org/eclipse/pde/api/tools/internal/ApiFilterStore:DEBUG	Z
        //   74: ifeq +41 -> 115
        //   77: getstatic 153	java/lang/System:out	Ljava/io/PrintStream;
        //   80: new 76	java/lang/StringBuffer
        //   83: dup
        //   84: ldc 5
        //   86: invokespecial 165	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
        //   89: aload_0
        //   90: getfield 161	org/eclipse/pde/api/tools/internal/ApiFilterStore$1:this$0	Lorg/eclipse/pde/api/tools/internal/ApiFilterStore;
        //   93: getfield 159	org/eclipse/pde/api/tools/internal/ApiFilterStore:fProject	Lorg/eclipse/jdt/core/IJavaProject;
        //   96: invokeinterface 187 1 0
        //   101: invokevirtual 166	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
        //   104: ldc 2
        //   106: invokevirtual 166	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
        //   109: invokevirtual 164	java/lang/StringBuffer:toString	()Ljava/lang/String;
        //   112: invokevirtual 163	java/io/PrintStream:println	(Ljava/lang/String;)V
        //   115: getstatic 154	org/eclipse/core/runtime/Status:CANCEL_STATUS	Lorg/eclipse/core/runtime/IStatus;
        //   118: areturn
        //   119: aload_0
        //   120: getfield 161	org/eclipse/pde/api/tools/internal/ApiFilterStore$1:this$0	Lorg/eclipse/pde/api/tools/internal/ApiFilterStore;
        //   123: aload_0
        //   124: getfield 160	org/eclipse/pde/api/tools/internal/ApiFilterStore$1:val$filters	Ljava/util/Map;
        //   127: invokevirtual 170	org/eclipse/pde/api/tools/internal/ApiFilterStore:getStoreAsXml	(Ljava/util/Map;)Ljava/lang/String;
        //   130: astore 4
        //   132: aload_3
        //   133: aload_0
        //   134: getfield 161	org/eclipse/pde/api/tools/internal/ApiFilterStore$1:this$0	Lorg/eclipse/pde/api/tools/internal/ApiFilterStore;
        //   137: iconst_0
        //   138: invokevirtual 169	org/eclipse/pde/api/tools/internal/ApiFilterStore:getFilterFilePath	(Z)Lorg/eclipse/core/runtime/IPath;
        //   141: invokeinterface 186 2 0
        //   146: astore 5
        //   148: aload 4
        //   150: ifnonnull +120 -> 270
        //   153: getstatic 156	org/eclipse/pde/api/tools/internal/ApiFilterStore:DEBUG	Z
        //   156: ifeq +41 -> 197
        //   159: getstatic 153	java/lang/System:out	Ljava/io/PrintStream;
        //   162: new 76	java/lang/StringBuffer
        //   165: dup
        //   166: ldc 3
        //   168: invokespecial 165	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
        //   171: aload_0
        //   172: getfield 161	org/eclipse/pde/api/tools/internal/ApiFilterStore$1:this$0	Lorg/eclipse/pde/api/tools/internal/ApiFilterStore;
        //   175: getfield 159	org/eclipse/pde/api/tools/internal/ApiFilterStore:fProject	Lorg/eclipse/jdt/core/IJavaProject;
        //   178: invokeinterface 187 1 0
        //   183: invokevirtual 166	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
        //   186: ldc 1
        //   188: invokevirtual 166	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
        //   191: invokevirtual 164	java/lang/StringBuffer:toString	()Ljava/lang/String;
        //   194: invokevirtual 163	java/io/PrintStream:println	(Ljava/lang/String;)V
        //   197: aload 5
        //   199: invokeinterface 174 1 0
        //   204: ifeq +62 -> 266
        //   207: aload 5
        //   209: invokeinterface 175 1 0
        //   214: checkcast 79	org/eclipse/core/resources/IFolder
        //   217: astore 6
        //   219: aload 5
        //   221: iconst_1
        //   222: aload_2
        //   223: invokeinterface 177 3 0
        //   228: aload 6
        //   230: invokeinterface 182 1 0
        //   235: arraylength
        //   236: ifne +22 -> 258
        //   239: aload 6
        //   241: invokeinterface 181 1 0
        //   246: ifeq +12 -> 258
        //   249: aload 6
        //   251: iconst_1
        //   252: aload_2
        //   253: invokeinterface 183 3 0
        //   258: aload_0
        //   259: getfield 161	org/eclipse/pde/api/tools/internal/ApiFilterStore$1:this$0	Lorg/eclipse/pde/api/tools/internal/ApiFilterStore;
        //   262: iconst_1
        //   263: putfield 158	org/eclipse/pde/api/tools/internal/ApiFilterStore:fTriggeredChange	Z
        //   266: getstatic 155	org/eclipse/core/runtime/Status:OK_STATUS	Lorg/eclipse/core/runtime/IStatus;
        //   269: areturn
        //   270: aload 4
        //   272: invokestatic 172	org/eclipse/pde/api/tools/internal/util/Util:getInputStreamFromString	(Ljava/lang/String;)Ljava/io/InputStream;
        //   275: astore 6
        //   277: aload 6
        //   279: ifnonnull +7 -> 286
        //   282: getstatic 154	org/eclipse/core/runtime/Status:CANCEL_STATUS	Lorg/eclipse/core/runtime/IStatus;
        //   285: areturn
        //   286: aload 5
        //   288: invokeinterface 176 1 0
        //   293: invokeinterface 185 1 0
        //   298: ifeq +84 -> 382
        //   301: aload 5
        //   303: invokeinterface 173 1 0
        //   308: ifne +49 -> 357
        //   311: aload 5
        //   313: invokeinterface 175 1 0
        //   318: checkcast 79	org/eclipse/core/resources/IFolder
        //   321: astore 7
        //   323: aload 7
        //   325: invokeinterface 180 1 0
        //   330: ifne +13 -> 343
        //   333: aload 7
        //   335: iconst_1
        //   336: iconst_1
        //   337: aload_2
        //   338: invokeinterface 184 4 0
        //   343: aload 5
        //   345: aload 6
        //   347: iconst_1
        //   348: aload_2
        //   349: invokeinterface 178 4 0
        //   354: goto +28 -> 382
        //   357: aload 5
        //   359: aload 6
        //   361: iconst_1
        //   362: iconst_0
        //   363: aload_2
        //   364: invokeinterface 179 5 0
        //   369: goto +13 -> 382
        //   372: astore 8
        //   374: aload 6
        //   376: invokevirtual 162	java/io/InputStream:close	()V
        //   379: aload 8
        //   381: athrow
        //   382: aload 6
        //   384: invokevirtual 162	java/io/InputStream:close	()V
        //   387: aload_0
        //   388: getfield 161	org/eclipse/pde/api/tools/internal/ApiFilterStore$1:this$0	Lorg/eclipse/pde/api/tools/internal/ApiFilterStore;
        //   391: iconst_1
        //   392: putfield 158	org/eclipse/pde/api/tools/internal/ApiFilterStore:fTriggeredChange	Z
        //   395: aload_0
        //   396: getfield 161	org/eclipse/pde/api/tools/internal/ApiFilterStore$1:this$0	Lorg/eclipse/pde/api/tools/internal/ApiFilterStore;
        //   399: iconst_0
        //   400: putfield 157	org/eclipse/pde/api/tools/internal/ApiFilterStore:fNeedsSaving	Z
        //   403: goto +16 -> 419
        //   406: astore_2
        //   407: aload_2
        //   408: invokestatic 171	org/eclipse/pde/api/tools/internal/provisional/ApiPlugin:log	(Ljava/lang/Throwable;)V
        //   411: goto +8 -> 419
        //   414: astore_2
        //   415: aload_2
        //   416: invokestatic 171	org/eclipse/pde/api/tools/internal/provisional/ApiPlugin:log	(Ljava/lang/Throwable;)V
        //   419: getstatic 155	org/eclipse/core/runtime/Status:OK_STATUS	Lorg/eclipse/core/runtime/IStatus;
        //   422: areturn
        // Line number table:
        //   Java source line #128	-> byte code offset #0
        //   Java source line #129	-> byte code offset #6
        //   Java source line #132	-> byte code offset #44
        //   Java source line #133	-> byte code offset #49
        //   Java source line #134	-> byte code offset #62
        //   Java source line #135	-> byte code offset #71
        //   Java source line #136	-> byte code offset #77
        //   Java source line #138	-> byte code offset #115
        //   Java source line #140	-> byte code offset #119
        //   Java source line #141	-> byte code offset #132
        //   Java source line #142	-> byte code offset #148
        //   Java source line #143	-> byte code off
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