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

1	8	component	SkippedComponent
    //   105	81	9	i	int
    //   283	15	10	localObject	Object
    //   235	1	11	localFileNotFoundException	FileNotFoundException
    //   247	1	12	localIOException1	IOException
    //   251	1	13	localIOException2	IOException
    //   263	1	14	localIOException3	IOException
    //   267	1	15	localCoreException	CoreException
    //   279	1	16	localIOException4	IOException
    //   296	1	17	localIOException5	IOException
    //   311	1	18	localIOException6	IOException
    // Exception table:
    //   from	to	target	type
    //   7	232	235	java/io/FileNotFoundException
    //   240	244	247	java/io/IOException
    //   7	232	251	java/io/IOException
    //   256	260	263	java/io/IOException
    //   7	232	267	org/eclipse/core/runtime/CoreException
    //   272	276	279	java/io/IOException
    //   7	236	283	finally
    //   251	252	283	finally
    //   267	268	283	finally
    //   289	293	296	java/io/IOException
    //   304	308	311	java/io/IOException
  }
  
  public void reportMetadata(IMetadata data)
  {
    if (data == null) {
      return;
    }
    try
    {
      if (debug) {
        System.out.println("Writing file for projects that were not searched...");
      }
      File rootfile = new File(fLocation);
      if (!rootfile.exists()) {
        rootfile.mkdirs();
      }
      File file = new File(rootfile, "meta.xml");
      if (!file.exists()) {
        file.createNewFile();
      }
      data.serializeToFile(file);
    }
    catch (FileNotFoundException fnfe)
    {
      ApiPlugin.log(fnfe);
    }
    catch (IOException ioe)
    {
      ApiPlugin.log(ioe);
    }
    catch (CoreException ce)
    {
      ApiPlugin.log(ce);
    }
  }
  
  /* Error */
  public void reportCounts()
  {
    // Byte code:
    //   0: aconst_null
    //   1: astore_1
    //   2: aload_0
    //   3: getfield 283	org/eclipse/pde/api/tools/internal/search/XmlSearchReporter:debug	Z
    //   6: ifeq +12 -> 18
    //   9: getstatic 279	java/lang/System:out	Ljava/io/PrintStream;
    //   12: ldc_w 137
    //   15: invokevirtual 297	java/io/PrintStream:println	(Ljava/lang/String;)V
    //   18: new 146	java/io/File
    //   21: dup
    //   22: aload_0
    //   23: getfield 284	org/eclipse/pde/api/tools/internal/search/XmlSearchReporter:fLocation	Ljava/lang/String;
    //   26: invokespecial 293	java/io/File:<init>	(Ljava/lang/String;)V
    //   29: astore_2
    //   30: aload_2
    //   31: invokevirtual 291	java/io/File:exists	()Z
    //   34: ifne +8 -> 42
    //   37: aload_2
    //   38: invokevirtual 292	java/io/File:mkdirs	()Z
    //   41: pop
    //   42: new 146	java/io/File
    //   45: dup
    //   46: aload_2
    //   47: ldc_w 138
    //   50: invokespecial 294	java/io/File:<init>	(Ljava/io/File;Ljava/lang/String;)V
    //   53: astore_3
    //   54: aload_3
    //   55: invokevirtual 291	java/io/File:exists	()Z
    //   58: ifne +8 -> 66
    //   61: aload_3
    //   62: invokevirtual 290	java/io/File:createNewFile	()Z
    //   65: pop
    //   66: invokestatic 320	org/eclipse/pde/api/tools/internal/util/Util:newDocument	()Lorg/w3c/dom/Document;
    //   69: astore 4
    //   71: aload 4
    //   73: ldc_w 142
    //   76: invokeinterface 331 2 0
    //   81: astore 5
    //   83: aload 4
    //   85: aload 5
    //   87: invokeinterface 332 2 0
    //   92: pop
    //   93: aload 5
    //   95: ldc_w 143
    //   98: aload_0
    //   99: getfield 282	org/eclipse/pde/api/tools/internal/search/XmlSearchReporter:referenceCount	I
    //   102: invokestatic 298	java/lang/Integer:toString	(I)Ljava/lang/String;
    //   105: invokeinterface 333 3 0
    //   110: aload 5
    //   112: ldc_w 139
    //   115: aload_0
    //   116: getfield 280	org/eclipse/pde/api/tools/internal/search/XmlSearchReporter:illegalCount	I
    //   119: invokestatic 298	java/lang/Integer:toString	(I)Ljava/lang/String;
    //   122: invokeinterface 333 3 0
    //   127: aload 5
    //   129: ldc_w 140
    //   132: aload_0
    //   133: getfield 281	org/eclipse/pde/api/tools/internal/search/XmlSearchReporter:internalCount	I
    //   136: invokestatic 298	java/lang/Integer:toString	(I)Ljava/lang/String;
    //   139: invokeinterface 333 3 0
    //   144: new 145	java/io/BufferedWriter
    //   147: dup
    //   148: new 150	java/io/OutputStreamWriter
    //   151: dup
    //   152: new 148	java/io/FileOutputStream
    //   155: dup
    //   156: aload_3
    //   157: invokespecial 295	java/io/FileOutputStream:<init>	(Ljava/io/File;)V
    //   160: ldc_w 136
    //   163: invokespecial 296	java/io/OutputStreamWriter:<init>	(Ljava/io/OutputStream;Ljava/lang/String;)V
    //   166: invokespecial 288	java/io/BufferedWriter:<init>	(Ljava/io/Writer;)V
    //   169: astore_1
    //   170: aload_1
    //   171: aload 4
    //   173: invokestatic 321	org/eclipse/pde/api/tools/internal/util/Util:serializeDocument	(Lorg/w3c/dom/Document;)Ljava/lang/String;
    //   176: invokevirtual 289	java/io/BufferedWriter:write	(Ljava/lang/String;)V
    //   179: aload_1
    //   180: invokevirtual 287	java/io/BufferedWriter:flush	()V
    //   183: goto +68 -> 251
    //   186: pop
    //   187: aload_1
    //   188: ifnull +75 -> 263
    //   191: aload_1
    //   192: invokevirtual 286	java/io/BufferedWriter:close	()V
    //   195: goto +68 -> 263
    //   198: pop
    //   199: goto +64 -> 263
    //   202: pop
    //   203: aload_1
    //   204: ifnull +59 -> 263
    //   207: aload_1
    //   208: invokevirtual 286	java/io/BufferedWriter:close	()V
    //   211: goto +52 -> 263
    //   214: pop
    //   215: goto +48 -> 263
    //   218: pop
    //   219: aload_1
    //   220: ifnull +43 -> 263
    //   223: aload_1
    //   224: invokevirtual 286	java/io/BufferedWriter:close	()V
    //   227: goto +36 -> 263
    //   230: pop
    //   231: goto +32 -> 263
    //   234: astore 6
    //   236: aload_1
    //   237: ifnull +11 -> 248
    //   240: aload_1
    //   241: invokevirtual 286	java/io/BufferedWriter:close	()V
    //   244: goto +4 -> 248
    //   247: pop
    //   248: aload 6
    //   250: athrow
    //   251: aload_1
    //   252: ifnull +11 -> 263
    //   255: aload_1
    //   256: invokevirtual 286	java/io/BufferedWriter:close	()V
    //   259: goto +4 -> 263
    //   262: pop
    //   263: return
    // Line number table:
    //   Java source line #215	-> byte code offset #0
    //   Java source line #217	-> byte code offset #2
    //   Java source line #218	-> byte code offset #9
    //   Java source line #220	-> byte code offset #18
    //   Java source line #221	-> byte code offset #30
    //   Java source line #222	-> byte code offset #37
    //   Java source line #224	-> byte code offset #42
    //   Java source line #225	-> byte code offset #54
    //   Java source line #226	-> byte code offset #61
    //   Java source line #229	-> byte code offset #66
    //   Java source line #230	-> byte code offset #71
    //   Java source line #231	-> byte code offset #83
    //   Java source line #232	-> byte code offset #93
    //   Java source line #233	-> byte code offset #110
    //   Java source line #234	-> byte code offset #127
    //   Java source line #236	-> byte code offset #144
    //   Java source line #237	-> byte code offset #170
    //   Java source line #238	-> byte code offset #179
    //   Java source line #240	-> byte code offset #186
    //   Java source line #244	-> byte code offset #187
    //   Java source line #246	-> byte code offset #191
    //   Java source line #247	-> byte code offset #198
    //   Java source line #241	-> byte code offset #202
    //   Java source line #244	-> byte code offset #203
    //   Java source line #246	-> byte code offset #207
    //   Java source line #247	-> byte code offset #214
    //   Java source line #242	-> byte code offset #218
    //   Java source line #244	-> byte code offset #219
    //   Java source line #246	-> byte code offset #223
    //   Java source line #247	-> byte code offset #230
    //   Java source line #243	-> byte code offset #234
    //   Java source line #244	-> byte code offset #236
    //   Java source line #246	-> byte code offset #240
    //   Java source line #247	-> byte code offset #247
    //   Java source line #249	-> byte code offset #248
    //   Java source line #244	-> byte code offset #251
    //   Java source line #246	-> byte code offset #255
    //   Java source line #247	-> byte code offset #262
    //   Java source line #250	-> byte code offset #263
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	264	0	this	XmlSearchReporter
    //   1	255	1	writer	java.io.BufferedWriter
    //   29	18	2	rootfile	File
    //   53	104	3	file	File
    //   69	103	4	doc	org.w3c.dom.Document
    //   81	47	5	root	org.w3c.dom.Element
    //   234	15	6	localObject	Object
    //   186	1	7	localFileNotFoundException	FileNotFoundException
    //   198	1	8	localIOException1	IOException
    //   202	1	9	localIOException2	IOException
    //   214	1	10	localIOException3	IOException
    //   218	1	11	localCoreException	CoreException
    //   230	1	12	localIOException4	IOException
    //   247	1	13	localIOException5	IOException
    //   262	1	14	localIOException6	IOException
    // Exception table:
    //   from	to	target	type
    //   2	183	186	java/io/FileNotFoundException
    //   191	195	198	java/io/IOException
    //   2	183	202	java/io/IOException
    //   207	211	214	java/io/IOException
    //   2	183	218	org/eclipse/core/runtime/CoreException
    //   223	227	230	java/io/IOException
    //   2	187	234	finally
    //   202	203	234	finally
    //   218	219	234	finally
    //   240	244	247	java/io/IOException
    //   255	259	262	java/io/IOException
  }
}

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

import java.util.HashSet;

public final class FileManager
{
  private static FileManager fInstance = null;
  private static HashSet fFilePaths = null;
  
  public static synchronized FileManager getManager()
  {
    if (fInstance == null) {
      fInstance = new FileManager();
    }
    return fInstance;
  }
  
  public void recordTempFileRoot(String absolutepath)
  {
    if (absolutepath != null)
    {
      if (fFilePaths == null) {
        fFilePaths = new HashSet(10);
      }
      synchronized (fFilePaths)
      {
        fFilePaths.add(absolutepath);
      }
    }
  }
  
  /* Error */
  public boolean deleteFiles()
  {
    // Byte code:
    //   0: iconst_1
    //   1: istore_1
    //   2: getstatic 59	org/eclipse/pde/api/tools/internal/util/FileManager:fFilePaths	Ljava/util/HashSet;
    //   5: ifnull +85 -> 90
    //   8: getstatic 59	org/eclipse/pde/api/tools/internal/util/FileManager:fFilePaths	Ljava/util/HashSet;
    //   11: dup
    //   12: astore_2
    //   13: monitorenter
    //   14: aconst_null
    //   15: astore_3
    //   16: getstatic 59	org/eclipse/pde/api/tools/internal/util/FileManager:fFilePaths	Ljava/util/HashSet;
    //   19: invokevirtual 66	java/util/HashSet:iterator	()Ljava/util/Iterator;
    //   22: astore 4
    //   24: goto +28 -> 52
    //   27: new 30	java/io/File
    //   30: dup
    //   31: aload 4
    //   33: invokeinterface 70 1 0
    //   38: checkcast 32	java/lang/String
    //   41: invokespecial 61	java/io/File:<init>	(Ljava/lang/String;)V
    //   44: astore_3
    //   45: iload_1
    //   46: aload_3
    //   47: invokestatic 68	org/eclipse/pde/api/tools/internal/util/Util:delete	(Ljava/io/File;)Z
    //   50: iand
    //   51: istore_1
    //   52: aload 4
    //   54: invokeinterface 69 1 0
    //   59: ifne -32 -> 27
    //   62: goto +14 -> 76
    //   65: astore 5
    //   67: getstatic 59	org/eclipse/pde/api/tools/internal/util/FileManager:fFilePaths	Ljava/util/HashSet;
    //   70: invokevirtual 63	java/util/HashSet:clear	()V
    //   73: aload 5
    //   75: athrow
    //   76: getstatic 59	org/eclipse/pde/api/tools/internal/util/FileManager:fFilePaths	Ljava/util/HashSet;
    //   79: invokevirtual 63	java/util/HashSet:clear	()V
    //   82: aload_2
    //   83: monitorexit
    //   84: goto +6 -> 90
    //   87: aload_2
    //   88: monitorexit
    //   89: athrow
    //   90: iload_1
    //   91: ireturn
    // Line number table:
    //   Java source line #71	-> byte code offset #0
    //   Java source line #72	-> byte code offset #2
    //   Java source line #73	-> byte code offset #8
    //   Java source line #75	-> byte code offset #14
    //   Java source line #76	-> byte code offset #16
    //   Java source line #77	-> byte code offset #27
    //   Java source line #78	-> byte code offset #45
    //   Java source line #76	-> byte code offset #52
    //   Java source line #81	-> byte code offset #65
    //   Java source line #82	-> byte code offset #67
    //   Java source line #83	-> byte code offset #73
    //   Java source line #82	-> byte code offset #76
    //   Java source line #73	-> byte code offset #82
    //   Java source line #86	-> byte code offset #90
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	92	0	this	FileManager
    //   1	90	1	success	boolean
    //   12	76	2	Ljava/lang/Object;	Object
    //   15	32	3	file	java.io.File
    //   22	31	4	iter	java.util.Iterator
    //   65	9	5	localObject1	Object
    // Exception table:
    //   from	to	target	type
    //   14	65	65	finally
    //   14	84	87	finally
    //   87	89	87	finally
  }
}

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

import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class FilteredElements
{
  private Set exactMatches;
  private Set partialMatches;
  
  public Set getExactMatches()
  {
    if (exactMatches == null) {
      return Collections.EMPTY_SET;
    }
    return exactMatches;
  }
  
  public Set getPartialMatches()
  {
    if (partialMatches == null) {
      return Collections.EMPTY_SET;
    }
    return partialMatches;
  }
  
  public boolean containsPartialMatch(String componentId)
  {
    if (partialMatches == null) {
      return false;
    }
    if (partialMatches.contains(componentId)) {
      return true;
    }
    for (Iterator iterator = partialMatches.iterator(); iterator.hasNext();)
    {
      String partialMatch = (String)iterator.next();
      if (componentId.startsWith(partialMatch)) {
        return true;
      }
    }
    return false;
  }
  
  public boolean containsExactMatch(String key)
  {
    if (exactMatches == null) {
      return false;
    }
    return exactMatches.contains(key);
  }
  
  public void addPartialMatch(String componentid)
  {
    if (partialMatches == null) {
      partialMatches = new HashSet();
    }
    partialMatches.add(componentid);
  }
  
  public void addExactMatch(String match)
  {
    if (exactMatches == null) {
      exactMatches = new HashSet();
    }
    exactMatches.add(match);
  }
  
  public String toString()
  {
    StringBuffer buffer = new StringBuffer();
    printSet(buffer, exactMatches, "exact matches");
    printSet(buffer, partialMatches, "partial matches");
    return String.valueOf(buffer);
  }
  
  private void printSet(StringBuffer buffer, Set set, String title)
  {
    String lineSeparator = System.getProperty("line.separator");
    buffer
      .append(title)
      .append(lineSeparator)
      .append("================================================================")
      .append(lineSeparator);
    if (set != null)
    {
      int max = set.size();
      String[] allEntries = new String[max];
      set.toArray(allEntries);
      Arrays.sort(allEntries);
      for (int i = 0; i < max; i++) {
        buffer.append(allEntries[i]).append(lineSeparator);
      }
      buffer.append(lineSeparator);
    }
    buffer.append("================================================================").append(lineSeparator);
  }
  
  public boolean isEmpty()
  {
    return ((exactMatches == null) || (exactMatches.isEmpty())) && ((partialMatches == null) || (partialMatches.isEmpty()));
  }
}

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

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.StringTokenizer;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.Signature;
import org.eclipse.jdt.core.dom.AST;
import org.eclipse.jdt.core.dom.ASTNode;
import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
import org.eclipse.jdt.core.dom.ArrayType;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jdt.core.dom.IExtendedModifier;
import org.eclipse.jdt.core.dom.MethodDeclaration;
import org.eclipse.jdt.core.dom.Modifier;
import org.eclipse.jdt.core.dom.Name;
import org.eclipse.jdt.core.dom.PackageDeclaration;
import org.eclipse.jdt.core.dom.ParameterizedType;
import org.eclipse.jdt.core.dom.PrimitiveType;
import org.eclipse.jdt.core.dom.PrimitiveType.Code;
import org.eclipse.jdt.core.dom.QualifiedType;
import org.eclipse.jdt.core.dom.SimpleName;
import org.eclipse.jdt.core.dom.SimpleType;
import org.eclipse.jdt.core.dom.SingleVariableDeclaration;
import org.eclipse.jdt.core.dom.Type;
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.IReferenceTypeDescriptor;
import org.eclipse.pde.api.tools.internal.provisional.model.IApiField;
import org.eclipse.pde.api.tools.internal.provisional.model.IApiMethod;
import org.eclipse.pde.api.tools.internal.provisional.model.IApiType;

public final class Signatures
{
  public static String processMethodSignature(IApiMethod method)
  {
    String signature = method.getGenericSignature();
    if (signature == null) {
      signature = method.getSignature();
    }
    return dequalifySignature(signature);
  }
  
  public static String getPrimaryTypeName(String typename)
  {
    int idx = typename.indexOf('$');
    if (idx > -1) {
      return typename.substring(0, idx);
    }
    return typename;
  }
  
  public static String getMethodSignature(IApiMethod method)
    throws CoreException
  {
    String methodsig = method.getGenericSignature();
    if (methodsig == null) {
      methodsig = method.getSignature();
    }
    String methodname = getMethodName(method);
    return Signature.toString(dequalifySignature(methodsig), methodname, null, false, false);
  }
  
  public static String getQualifiedMethodSignature(IApiMethod method)
    throws CoreException
  {
    StringBuffer buffer = new StringBuffer();
    IApiType type = method.getEnclosingType();
    if (type != null) {
      buffer.append(getQualifiedTypeSignature(type)).append('.');
    }
    String methodsig = method.getGenericSignature();
    if (methodsig == null) {
      methodsig = method.getSignature();
    }
    String methodname = getMethodName(method);
    buffer.append(Signature.toString(dequalifySignature(methodsig), methodname, null, false, false));
    return buffer.toString();
  }
  
  public static String getQualifiedMethodSignature(IMethodDescriptor method)
    throws CoreException
  {
    StringBuffer buffer = new StringBuffer();
    IReferenceTypeDescriptor type = method.getEnclosingType();
    if (type != null) {
      buffer.append(getQualifiedTypeSignature(type)).append('.');
    }
    String methodsig = method.getSignature();
    String methodname = getMethodName(method);
    buffer.append(Signature.toString(dequalifySignature(methodsig), methodname, null, false, false));
    return buffer.toString();
  }
  
  public static String getQualifiedMethodSignature(IMethodDescriptor method, boolean qualifiedparams, boolean includereturn)
    throws CoreException
  {
    StringBuffer buffer = new StringBuffer();
    IReferenceTypeDescriptor type = method.getEnclosingType();
    if (type != null) {
      buffer.append(getQualifiedTypeSignature(type)).append('.');
    }
    String methodsig = method.getSignature();
    String methodname = getMethodName(method);
    buffer.append(Signature.toString(methodsig, methodname, null, qualifiedparams, false).replace('/', '.'));
    if (includereturn)
    {
      buffer.append(" : ");
      buffer.append(Signature.toString(Signature.getReturnType(methodsig)).replace('/', '.'));
    }
    return buffer.toString();
  }
  
  public static String getMethodSignature(IMethodDescriptor method, boolean includereturn)
    throws CoreException
  {
    StringBuffer buffer = new StringBuffer();
    String methodsig = method.getSignature();
    String methodname = getMethodName(method);
    String dqsig = dequalifySignature(methodsig);
    buffer.append(Signature.toString(dqsig, methodname, null, false, false));
    if (includereturn)
    {
      buffer.append(" : ");
      buffer.append(Signature.toString(Signature.getReturnType(dqsig)).replace('/', '.'));
    }
    return buffer.toString();
  }
  
  public static String getMethodName(IApiMethod method)
    throws CoreException
  {
    String mname = method.getName();
    if ("<init>".equals(method.getName()))
    {
      IApiType type = method.getEnclosingType();
      if (type != null) {
        return type.getSimpleName();
      }
    }
    return mname;
  }
  
  public static String getMethodName(IMethodDescriptor method)
    throws CoreException
  {
    String mname = method.getName();
    if ("<init>".equals(method.getName()))
    {
      IReferenceTypeDescriptor type = method.getEnclosingType();
      if (type != null) {
        return type.getName();
      }
    }
    return mname;
  }
  
  public static String getFieldSignature(IApiField field)
  {
    return field.getName();
  }
  
  public static String getQualifiedFieldSignature(IApiField field)
    throws CoreException
  {
    StringBuffer buffer = new StringBuffer();
    IApiType type = field.getEnclosingType();
    if (type != null) {
      buffer.append(getQualifiedTypeSignature(type)).append('.');
    }
    buffer.append(field.getName());
    return buffer.toString();
  }
  
  public static String getQualifiedFieldSignature(IFieldDescriptor field)
    throws CoreException
  {
    StringBuffer buffer = new StringBuffer();
    IReferenceTypeDescriptor type = field.getEnclosingType();
    if (type != null) {
      buffer.append(getQualifiedTypeSignature(type)).append('.');
    }
    buffer.append(field.getName());
    return buffer.toString();
  }
  
  public static String getQualifiedTypeSignature(IApiType type)
  {
    return getTypeSignature(type.getSignature(), type.getGenericSignature(), true);
  }
  
  public static String getQualifiedTypeSignature(IReferenceTypeDescriptor type)
  {
    return getTypeSignature(type.getSignature(), type.getGenericSignature(), true);
  }
  
  public static String getTypeSignature(IApiType type)
  {
    return getTypeSignature(type.getSignature(), type.getGenericSignature(), false);
  }
  
  public static String getTypeSignature(String signature, String genericsignature, boolean qualified)
  {
    StringBuffer buffer = new StringBuffer();
    String sig = signature.replace('/', '.');
    if (!qualified) {
      sig = dequalifySignature(sig);
    }
    buffer.append(Signature.toString(sig.replace('$', '.')));
    if (genericsignature != null) {
      appendTypeParameters(buffer, Signature.getTypeParameters(genericsignature.replace('/', '.')));
    }
    return buffer.toString();
  }
  
  public static String getAnonymousTypeName(String name)
  {
    if (name != null)
    {
      int idx = name.lastIndexOf('$');
      if (idx > -1)
      {
        String num = name.substring(idx + 1, name.length());
        int i;
        try
        {
          Integer.parseInt(num);
          return null;
        }
        catch (NumberFormatException localNumberFormatException)
        {
          i = 0;
        }
        for (; i < name.length(); i++) {
          if (!Character.isDigit(num.charAt(i))) {
            return num.substring(i, num.length());
          }
        }
      }
    }
    return null;
  }
  
  public static void appendTypeParameters(StringBuffer buffer, String[] parameters)
  {
    if (parameters == null) {
      return;
    }
    if (parameters.length == 0) {
      return;
    }
    buffer.append(getLT());
    for (int i = 0; i < parameters.length; i++)
    {
      if (i > 0) {
        buffer.append(getComma());
      }
      buffer.append(Signature.getTypeVariable(parameters[i]));
    }
    buffer.append(getGT());
  }
  
  public static String getComma()
  {
    return ", ";
  }
  
  public static String getLT()
  {
    return "<";
  }
  
  public static String getGT()
  {
    return ">";
  }
  
  public static String dequalifySignature(String signature)
  {
    StringBuffer buffer = new StringBuffer();
    char[] chars = signature.toCharArray();
    int i = 0;
    for (int max = chars.length; i < max; i++)
    {
      char currentChar = chars[i];
      switch (currentChar)
      {
      case 'L': 
        if (chars[(i + 1)] != ';')
        {
          buffer.append('Q');
          
          int lastDotPosition = i;
          i++;
          while ((i < chars.length) && (currentChar != ';') && (currentChar != '<'))
          {
            switch (currentChar)
            {
            case '.': 
            case '/': 
              lastDotPosition = i;
            }
            i++;
            currentChar = chars[i];
          }
          buffer.append(chars, lastDotPosition + 1, i - lastDotPosition - 1);
          buffer.append(currentChar);
        }
        else
        {
          buffer.append(currentChar);
        }
        break;
      case 'Q': 
        while ((i < chars.length) && (currentChar != ';'))
        {
          buffer.append(currentChar);
          currentChar = chars[(++i)];
        }
      default: 
        buffer.append(currentChar);
      }
    }
    return String.valueOf(buffer);
  }
  
  public static String getMethodSignatureFromNode(MethodDeclaration node)
  {
    Assert.isNotNull(node);
    List params = node.parameters();
    List rparams = getParametersTypeNames(params);
    if (rparams.size() == params.size()) {
      if (!node.isConstructor())
      {
        Type returnType = getType(node);
        if (returnType != null)
        {
          String rtype = getTypeSignature(returnType);
          if (rtype != null) {
            return Signature.createMethodSignature((String[])rparams.toArray(new String[rparams.size()]), rtype);
          }
        }
      }
      else
      {
        collectSyntheticParam(node, rparams);
        return Signature.createMethodSignature((String[])rparams.toArray(new String[rparams.size()]), "V");
      }
    }
    return null;
  }
  
  private static List getParametersTypeNames(List rawparams)
  {
    List rparams = new ArrayList(rawparams.size());
    SingleVariableDeclaration param = null;
    String pname = null;
    for (Iterator iter = rawparams.iterator(); iter.hasNext();)
    {
      param = (SingleVariableDeclaration)iter.next();
      pname = getTypeSignature(getType(param));
      if (pname != null) {
        rparams.add(pname);
      }
    }
    return rparams;
  }
  
  private static Type getType(ASTNode node)
  {
    switch (node.getNodeType())
    {
    case 44: 
      SingleVariableDeclaration param = (SingleVariableDeclaration)node;
      Type type = param.getType();
      int extraDim = param.getExtraDimensions();
      if (extraDim == 0) {
        return type;
      }
      AST ast = type.getAST();
      type = (Type)ASTNode.copySubtree(ast, type);
      for (int i = 0; i < extraDim; i++) {
        type = ast.newArrayType(type);
      }
      return type;
    }
    MethodDeclaration methodDeclaration = (MethodDeclaration)node;
    Type type = methodDeclaration.getReturnType2();
    int extraDim = methodDeclaration.getExtraDimensions();
    if (extraDim == 0) {
      return type;
    }
    AST ast = type.getAST();
    type = (Type)ASTNode.copySubtree(ast, type);
    for (int i = 0; i < extraDim; i++) {
      type = ast.newArrayType(type);
    }
    return type;
  }
  
  public static String getTypeName(String qualifiedname)
  {
    int idx = qualifiedname.lastIndexOf('.');
    idx++;
    if (idx > 0) {
      return qualifiedname.substring(idx, qualifiedname.length());
    }
    return qualifiedname;
  }
  
  public static String getTypeSignature(Type type)
  {
    switch (type.getNodeType())
    {
    case 43: 
      return Signature.createTypeSignature(((SimpleType)type).getName().getFullyQualifiedName(), false);
    case 75: 
      return Signature.createTypeSignature(((QualifiedType)type).getName().getFullyQualifiedName(), false);
    case 5: 
      ArrayType a = (ArrayType)type;
      return Signature.createArraySignature(getTypeSignature(a.getElementType()), a.getDimensions());
    case 74: 
      return getTypeSignature(((ParameterizedType)type).getType());
    case 39: 
      return Signature.createTypeSignature(((PrimitiveType)type).getPrimitiveTypeCode().toString(), false);
    }
    return null;
  }
  
  public static boolean matchesSignatures(String signature, String signature2)
  {
    if (!matches(Signature.getReturnType(signature), Signature.getReturnType(signature2))) {
      return false;
    }
    String[] parameterTypes = Signature.getParameterTypes(signature);
    String[] parameterTypes2 = Signature.getParameterTypes(signature2);
    int length = parameterTypes.length;
    int length2 = parameterTypes2.length;
    if (length != length2) {
      return false;
    }
    for (int i = 0; i < length2; i++) {
      if (!matches(parameterTypes[i], parameterTypes2[i])) {
        return false;
      }
    }
    return true;
  }
  
  private static boolean matches(String type, String type2)
  {
    if (Signature.getArrayCount(type) == Signature.getArrayCount(type2))
    {
      String el1 = Signature.getElementType(type);
      String el2 = Signature.getElementType(type2);
      String[] typeargs1 = Signature.getTypeArguments(el1);
      String[] typeargs2 = Signature.getTypeArguments(el2);
      if (typeargs1.length == typeargs2.length)
      {
        if (typeargs1.length > 0)
        {
          for (int i = 0; i < typeargs1.length; i++) {
            if (!matches(typeargs1[i], typeargs2[i])) {
              return false;
            }
          }
          return true;
        }
        String signatureSimpleName = Signature.getSignatureSimpleName(el1);
        String signatureSimpleName2 = Signature.getSignatureSimpleName(el2);
        if (signatureSimpleName.equals(signatureSimpleName2)) {
          return true;
        }
        int index = signatureSimpleName2.lastIndexOf('.');
        if (index != -1) {
          return signatureSimpleName.equals(signatureSimpleName2.subSequence(index + 1, signatureSimpleName2.length()));
        }
      }
    }
    return false;
  }
  
  public static boolean isQualifiedSignature(String signature)
  {
    StringTokenizer tokenizer = new StringTokenizer(signature, "();IJCSBDFTZ![");
    if (tokenizer.hasMoreTokens()) {
      return tokenizer.nextToken().charAt(0) == 'L';
    }
    return false;
  }
  
  public static String getPackageName(String typeName)
  {
    int index = typeName.lastIndexOf('.');
    return index == -1 ? "" : typeName.substring(0, index);
  }
  
  static void collectSyntheticParam(MethodDeclaration method, List rparams)
  {
    Assert.isNotNull(method);
    if (isInTopLevelType(method)) {
      return;
    }
    ASTNode parent = method.getParent();
    AbstractTypeDeclaration type = (AbstractTypeDeclaration)parent;
    if (isStatic(type)) {
      return;
    }
    StringBuffer name = new StringBuffer();
    while (parent != null)
    {
      parent = parent.getParent();
      if ((parent instanceof AbstractTypeDeclaration))
      {
        type = (AbstractTypeDeclaration)parent;
        name.insert(0, type.getName().getFullyQualifiedName());
        if (type.isMemberTypeDeclaration()) {
          name.insert(0, '$');
        }
      }
      else if ((parent instanceof CompilationUnit))
      {
        CompilationUnit cunit = (CompilationUnit)parent;
        PackageDeclaration pdec = cunit.getPackage();
        if (pdec != null)
        {
          name.insert(0, '.');
          name.insert(0, cunit.getPackage().getName().getFullyQualifiedName());
        }
      }
    }
    name.insert(0, "L");
    name.append(';');
    if (name.length() > 2) {
      rparams.add(0, name.toString());
    }
  }
  
  static boolean isStatic(AbstractTypeDeclaration typeDeclaration)
  {
    List modifiers = typeDeclaration.modifiers();
    if (modifiers.isEmpty()) {
      return false;
    }
    for (Iterator iterator = modifiers.iterator(); iterator.hasNext();)
    {
      IExtendedModifier modifier = (IExtendedModifier)iterator.next();
      if (modifier.isModifier())
      {
        Modifier modifier2 = (Modifier)modifier;
        if (modifier2.isStatic()) {
          return true;
        }
      }
    }
    return false;
  }
  
  static boolean isInTopLevelType(MethodDeclaration method)
  {
    AbstractTypeDeclaration type = (AbstractTypeDeclaration)method.getParent();
    return (type != null) && (type.isPackageMemberTypeDeclaration());
  }
  
  public static String getSimpleTypeName(String referencedTypeName)
  {
    int index = referencedTypeName.lastIndexOf('.');
    if (index == -1) {
      return referencedTypeName;
    }
    return referencedTypeName.substring(index + 1);
  }
}

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

import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.osgi.framework.Version;

public class SinceTagVersion
{
  private String prefixString;
  private Version version;
  private String versionString;
  private String postfixString;
  private static final Pattern VERSION_PATTERN = Pattern.compile("([0-9]+\\.?[0-9]?\\.?[0-9]?\\.?[A-Za-z0-9]*)");
  
  public SinceTagVersion(String value)
  {
    if (value == null) {
      throw new IllegalArgumentException("The given value cannot be null");
    }
    char[] chars = value.toCharArray();
    
    int mode = 0;
    
    int i = 0;
    for (int max = chars.length; i < max; i++)
    {
      char currentChar = chars[i];
      switch (mode)
      {
      case 0: 
        switch (currentChar)
        {
        case '0': 
        case '1': 
        case '2': 
        case '3': 
        case '4': 
        case '5': 
        case '6': 
        case '7': 
        case '8': 
        case '9': 
          mode = 1;
          i--;
        }
        break;
      case 1: 
        int start = i;
        while (i < max)
        {
          if (Character.isWhitespace(currentChar)) {
            break;
          }
          if ((!Character.isLetterOrDigit(currentChar)) && 
            (currentChar != '.')) {
            break;
          }
          currentChar = chars[i];
          i++;
        }
        String potentialVersion = null;
        if (i == max) {
          potentialVersion = value.substring(start, i);
        } else {
          potentialVersion = value.substring(start, i - 1);
        }
        Matcher m = VERSION_PATTERN.matcher(potentialVersion);
        if (m.find())
        {
          versionString = potentialVersion;
          if (start != 0)
          {
            prefixString = value.substring(0, start);
            if (Character.isLetterOrDigit(value.charAt(start - 1)))
            {
              versionString = null;
              prefixString = null;
              continue;
            }
          }
          if (i != max) {
            postfixString = value.substring(i - 1);
          }
          try
          {
            version = new Version(versionString);
          }
          catch (IllegalArgumentException localIllegalArgumentException) {}
        }
        else
        {
          mode = 0;
        }
        break;
      }
    }
    if (versionString == null) {
      postfixString = value;
    }
  }
  
  public String getVersionString()
  {
    return versionString;
  }
  
  public Version getVersion()
  {
    return version;
  }
  
  public String prefixString()
  {
    return prefixString;
  }
  
  public String postfixString()
  {
    return postfixString;
  }
}

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

import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.xml.sax.helpers.DefaultHandler;

public class SourceDefaultHandler
  extends DefaultHandler
{
  private static final String ORG_ECLIPSE_PDE_CORE_SOURCE_EXTENSION_POINT_NAME = "org.eclipse.pde.core.source";
  private static final String EXTENSION_NAME = "extension";
  private static final String ECLIPSE_POINT_ATTRIBUTE_NAME = "point";
  boolean isSource = false;
  
  public void error(SAXParseException e)
    throws SAXException
  {
    e.printStackTrace();
  }
  
  public void startElement(String uri, String localName, String name, Attributes attributes)
    throws SAXException
  {
    if (isSource) {
      return;
    }
    isSource = (("extension".equals(name)) && 
      (attributes.getLength() == 1) && 
      (("point".equals(attributes.getQName(0))) || 
      ("point".equals(attributes.getLocalName(0)))) && 
      ("org.eclipse.pde.core.source".equals(attributes.getValue(0))));
  }
  
  public boolean isSource()
  {
    return isSource;
  }
}

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

public class TarEntry
  implements Cloneable
{
  private String name;
  private long mode;
  private long time;
  private long size;
  private int type;
  int filepos;
  public static final int FILE = 48;
  public static final int DIRECTORY = 53;
  
  TarEntry(String name, int pos)
  {
    this.name = name;
    mode = 420L;
    type = 48;
    filepos = pos;
    time = (System.currentTimeMillis() / 1000L);
  }
  
  public TarEntry(String name)
  {
    this(name, -1);
  }
  
  public Object clone()
  {
    TarEntry entry = new TarEntry(name, filepos);
    entry.setFileType(type);
    entry.setMode(mode);
    entry.setSize(size);
    entry.setTime(time);
    return entry;
  }
  
  public int getFileType()
  {
    return type;
  }
  
  public long getMode()
  {
    return mode;
  }
  
  public String getName()
  {
    return name;
  }
  
  public long getSize()
  {
    return size;
  }
  
  public long getTime()
  {
    return time;
  }
  
  public void setFileType(int type)
  {
    this.type = type;
  }
  
  public void setMode(long mode)
  {
    this.mode = mode;
  }
  
  public void setSize(long size)
  {
    this.size = size;
  }
  
  public void setTime(long time)
  {
    this.time = time;
  }
  
  public String toString()
  {
    return getName();
  }
}

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

public class TarException
  extends Exception
{
  private static final long serialVersionUID = 2886671254518853528L;
  
  public TarException() {}
  
  public TarException(Stri
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