org.eclipse.osgi_3.7.2.v20120110-1415

 
  public synchronized boolean isLocked()
    throws IOException
  {
    if (lockRAF != null) {
      return true;
    }
    try
    {
      return !lock();
    }
    finally
    {
      release();
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.core.runtime.internal.adaptor.Locker_JavaIo
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.core.runtime.internal.adaptor;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintStream;
import java.io.RandomAccessFile;
import java.nio.channels.FileChannel;
import java.nio.channels.FileLock;
import java.nio.channels.OverlappingFileLockException;
import org.eclipse.osgi.util.NLS;

public class Locker_JavaNio
  implements Locker
{
  private final File lockFile;
  private FileLock fileLock;
  private RandomAccessFile raFile;
  
  public Locker_JavaNio(File lockFile)
  {
    this.lockFile = lockFile;
  }
  
  /* Error */
  public synchronized boolean lock()
    throws IOException
  {
    // Byte code:
    //   0: aload_0
    //   1: new 47	java/io/RandomAccessFile
    //   4: dup
    //   5: aload_0
    //   6: getfield 95	org/eclipse/core/runtime/internal/adaptor/Locker_JavaNio:lockFile	Ljava/io/File;
    //   9: ldc 2
    //   11: invokespecial 103	java/io/RandomAccessFile:<init>	(Ljava/io/File;Ljava/lang/String;)V
    //   14: putfield 96	org/eclipse/core/runtime/internal/adaptor/Locker_JavaNio:raFile	Ljava/io/RandomAccessFile;
    //   17: aload_0
    //   18: aload_0
    //   19: getfield 96	org/eclipse/core/runtime/internal/adaptor/Locker_JavaNio:raFile	Ljava/io/RandomAccessFile;
    //   22: invokevirtual 102	java/io/RandomAccessFile:getChannel	()Ljava/nio/channels/FileChannel;
    //   25: lconst_0
    //   26: lconst_1
    //   27: iconst_0
    //   28: invokevirtual 105	java/nio/channels/FileChannel:tryLock	(JJZ)Ljava/nio/channels/FileLock;
    //   31: putfield 97	org/eclipse/core/runtime/internal/adaptor/Locker_JavaNio:fileLock	Ljava/nio/channels/FileLock;
    //   34: goto +119 -> 153
    //   37: astore_1
    //   38: getstatic 92	org/eclipse/core/runtime/internal/adaptor/BasicLocation:DEBUG	Z
    //   41: ifeq +19 -> 60
    //   44: getstatic 91	java/lang/System:out	Ljava/io/PrintStream;
    //   47: getstatic 93	org/eclipse/core/runtime/internal/adaptor/EclipseAdaptorMsg:location_cannotLock	Ljava/lang/String;
    //   50: aload_0
    //   51: getfield 95	org/eclipse/core/runtime/internal/adaptor/Locker_JavaNio:lockFile	Ljava/io/File;
    //   54: invokestatic 107	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;
    //   57: invokevirtual 100	java/io/PrintStream:println	(Ljava/lang/String;)V
    //   60: getstatic 94	org/eclipse/core/runtime/internal/adaptor/EclipseAdaptorMsg:location_cannotLockNIO	Ljava/lang/String;
    //   63: iconst_3
    //   64: anewarray 48	java/lang/Object
    //   67: dup
    //   68: iconst_0
    //   69: aload_0
    //   70: getfield 95	org/eclipse/core/runtime/internal/adaptor/Locker_JavaNio:lockFile	Ljava/io/File;
    //   73: aastore
    //   74: dup
    //   75: iconst_1
    //   76: aload_1
    //   77: invokevirtual 98	java/io/IOException:getMessage	()Ljava/lang/String;
    //   80: aastore
    //   81: dup
    //   82: iconst_2
    //   83: ldc 1
    //   85: aastore
    //   86: invokestatic 108	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
    //   89: astore_2
    //   90: new 45	java/io/IOException
    //   93: dup
    //   94: aload_2
    //   95: invokespecial 99	java/io/IOException:<init>	(Ljava/lang/String;)V
    //   98: athrow
    //   99: pop
    //   100: aload_0
    //   101: aconst_null
    //   102: putfield 97	org/eclipse/core/runtime/internal/adaptor/Locker_JavaNio:fileLock	Ljava/nio/channels/FileLock;
    //   105: aload_0
    //   106: getfield 97	org/eclipse/core/runtime/internal/adaptor/Locker_JavaNio:fileLock	Ljava/nio/channels/FileLock;
    //   109: ifnull +5 -> 114
    //   112: iconst_1
    //   113: ireturn
    //   114: aload_0
    //   115: getfield 96	org/eclipse/core/runtime/internal/adaptor/Locker_JavaNio:raFile	Ljava/io/RandomAccessFile;
    //   118: invokevirtual 101	java/io/RandomAccessFile:close	()V
    //   121: aload_0
    //   122: aconst_null
    //   123: putfield 96	org/eclipse/core/runtime/internal/adaptor/Locker_JavaNio:raFile	Ljava/io/RandomAccessFile;
    //   126: goto +48 -> 174
    //   129: astore_3
    //   130: aload_0
    //   131: getfield 97	org/eclipse/core/runtime/internal/adaptor/Locker_JavaNio:fileLock	Ljava/nio/channels/FileLock;
    //   134: ifnull +5 -> 139
    //   137: iconst_1
    //   138: ireturn
    //   139: aload_0
    //   140: getfield 96	org/eclipse/core/runtime/internal/adaptor/Locker_JavaNio:raFile	Ljava/io/RandomAccessFile;
    //   143: invokevirtual 101	java/io/RandomAccessFile:close	()V
    //   146: aload_0
    //   147: aconst_null
    //   148: putfield 96	org/eclipse/core/runtime/internal/adaptor/Locker_JavaNio:raFile	Ljava/io/RandomAccessFile;
    //   151: aload_3
    //   152: athrow
    //   153: aload_0
    //   154: getfield 97	org/eclipse/core/runtime/internal/adaptor/Locker_JavaNio:fileLock	Ljava/nio/channels/FileLock;
    //   157: ifnull +5 -> 162
    //   160: iconst_1
    //   161: ireturn
    //   162: aload_0
    //   163: getfield 96	org/eclipse/core/runtime/internal/adaptor/Locker_JavaNio:raFile	Ljava/io/RandomAccessFile;
    //   166: invokevirtual 101	java/io/RandomAccessFile:close	()V
    //   169: aload_0
    //   170: aconst_null
    //   171: putfield 96	org/eclipse/core/runtime/internal/adaptor/Locker_JavaNio:raFile	Ljava/io/RandomAccessFile;
    //   174: iconst_0
    //   175: ireturn
    // Line number table:
    //   Java source line #33	-> byte code offset #0
    //   Java source line #39	-> byte code offset #17
    //   Java source line #40	-> byte code offset #37
    //   Java source line #42	-> byte code offset #38
    //   Java source line #43	-> byte code offset #44
    //   Java source line #45	-> byte code offset #60
    //   Java source line #46	-> byte code offset #90
    //   Java source line #47	-> byte code offset #99
    //   Java source line #49	-> byte code offset #100
    //   Java source line #51	-> byte code offset #105
    //   Java source line #52	-> byte code offset #112
    //   Java source line #53	-> byte code offset #114
    //   Java source line #54	-> byte code offset #121
    //   Java source line #50	-> byte code offset #129
    //   Java source line #51	-> byte code offset #130
    //   Java source line #52	-> byte code offset #137
    //   Java source line #53	-> byte code offset #139
    //   Java source line #54	-> byte code offset #146
    //   Java source line #55	-> byte code offset #151
    //   Java source line #51	-> byte code offset #153
    //   Java source line #52	-> byte code offset #160
    //   Java source line #53	-> byte code offset #162
    //   Java source line #54	-> byte code offset #169
    //   Java source line #56	-> byte code offset #174
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	176	0	this	Locker_JavaNio
    //   37	40	1	ioe	IOException
    //   89	6	2	specificMessage	String
    //   129	23	3	localObject	Object
    //   99	1	4	localOverlappingFileLockException	OverlappingFileLockException
    // Exception table:
    //   from	to	target	type
    //   17	34	37	java/io/IOException
    //   17	34	99	java/nio/channels/OverlappingFileLockException
    //   17	105	129	finally
  }
  
  public synchronized void release()
  {
    if (fileLock != null)
    {
      try
      {
        fileLock.release();
      }
      catch (IOException localIOException1) {}
      fileLock = null;
    }
    if (raFile != null)
    {
      try
      {
        raFile.close();
      }
      catch (IOException localIOException2) {}
      raFile = null;
    }
  }
  
  public synchronized boolean isLocked()
    throws IOException
  {
    if (fileLock != null) {
      return true;
    }
    try
    {
      RandomAccessFile temp = new RandomAccessFile(lockFile, "rw");
      FileLock tempLock = null;
      try
      {
        try
        {
          tempLock = temp.getChannel().tryLock(0L, 1L, false);
        }
        catch (IOException ioe)
        {
          if (BasicLocation.DEBUG) {
            System.out.println(NLS.bind(EclipseAdaptorMsg.location_cannotLock, lockFile));
          }
          String specificMessage = NLS.bind(EclipseAdaptorMsg.location_cannotLockNIO, new Object[] { lockFile, ioe.getMessage(), "\"-Dosgi.locking=none\"" });
          throw new IOException(specificMessage);
        }
        if (tempLock != null)
        {
          tempLock.release();
          return false;
        }
        return true;
      }
      catch (OverlappingFileLockException localOverlappingFileLockException)
      {
        return true;
      }
      finally
      {
        temp.close();
      }
      return false;
    }
    catch (FileNotFoundException localFileNotFoundException) {}
  }
}

/* Location:
 * Qualified Name:     org.eclipse.core.runtime.internal.adaptor.Locker_JavaNio
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.core.runtime.internal.adaptor;

import java.io.PrintStream;
import java.util.Date;
import org.eclipse.osgi.service.resolver.BundleSpecification;
import org.eclipse.osgi.service.resolver.ImportPackageSpecification;
import org.eclipse.osgi.service.resolver.VersionConstraint;
import org.eclipse.osgi.service.resolver.VersionRange;
import org.eclipse.osgi.util.NLS;

public class MessageHelper
{
  public static String getResolutionFailureMessage(VersionConstraint unsatisfied)
  {
    if (unsatisfied.isResolved()) {
      throw new IllegalArgumentException();
    }
    if ((unsatisfied instanceof ImportPackageSpecification))
    {
      if ("optional".equals(((ImportPackageSpecification)unsatisfied).getDirective("resolution"))) {
        return NLS.bind(EclipseAdaptorMsg.ECLIPSE_MISSING_OPTIONAL_IMPORTED_PACKAGE, toString(unsatisfied));
      }
      if ("dynamic".equals(((ImportPackageSpecification)unsatisfied).getDirective("resolution"))) {
        return NLS.bind(EclipseAdaptorMsg.ECLIPSE_MISSING_DYNAMIC_IMPORTED_PACKAGE, toString(unsatisfied));
      }
      return NLS.bind(EclipseAdaptorMsg.ECLIPSE_MISSING_IMPORTED_PACKAGE, toString(unsatisfied));
    }
    if ((unsatisfied instanceof BundleSpecification))
    {
      if (((BundleSpecification)unsatisfied).isOptional()) {
        return NLS.bind(EclipseAdaptorMsg.ECLIPSE_MISSING_OPTIONAL_REQUIRED_BUNDLE, toString(unsatisfied));
      }
      return NLS.bind(EclipseAdaptorMsg.ECLIPSE_MISSING_REQUIRED_BUNDLE, toString(unsatisfied));
    }
    return NLS.bind(EclipseAdaptorMsg.ECLIPSE_MISSING_HOST, toString(unsatisfied));
  }
  
  public static void debug(String message)
  {
    StringBuffer buffer = new StringBuffer();
    buffer.append(new Date(System.currentTimeMillis()));
    buffer.append(" - [");
    buffer.append(Thread.currentThread().getName());
    buffer.append("] ");
    buffer.append(message);
    System.out.println(buffer.toString());
  }
  
  private static String toString(VersionConstraint constraint)
  {
    VersionRange versionRange = constraint.getVersionRange();
    if (versionRange == null) {
      return constraint.getName();
    }
    return constraint.getName() + '_' + versionRange;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.core.runtime.internal.adaptor.MessageHelper
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.core.runtime.internal.adaptor;

import java.io.BufferedInputStream;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Dictionary;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.TreeSet;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import org.eclipse.osgi.framework.adaptor.FrameworkAdaptor;
import org.eclipse.osgi.framework.internal.core.FrameworkProperties;
import org.eclipse.osgi.framework.log.FrameworkLog;
import org.eclipse.osgi.framework.log.FrameworkLogEntry;
import org.eclipse.osgi.internal.baseadaptor.DevClassPathHelper;
import org.eclipse.osgi.service.pluginconversion.PluginConversionException;
import org.eclipse.osgi.service.pluginconversion.PluginConverter;
import org.eclipse.osgi.service.resolver.VersionRange;
import org.eclipse.osgi.util.ManifestElement;
import org.eclipse.osgi.util.NLS;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Version;

public class PluginConverterImpl
  implements PluginConverter
{
  public static boolean DEBUG = false;
  public static final byte MANIFEST_TYPE_UNKNOWN = 0;
  public static final byte MANIFEST_TYPE_BUNDLE = 1;
  public static final byte MANIFEST_TYPE_PLUGIN = 2;
  public static final byte MANIFEST_TYPE_FRAGMENT = 4;
  public static final byte MANIFEST_TYPE_JAR = 8;
  private static final String SEMICOLON = "; ";
  private static final String UTF_8 = "UTF-8";
  private static final String LIST_SEPARATOR = ",\n ";
  private static final String LINE_SEPARATOR = "\n ";
  private static final String DOT = ".";
  private static int MAXLINE = 511;
  private BundleContext context;
  private FrameworkAdaptor adaptor;
  private BufferedWriter out;
  private IPluginInfo pluginInfo;
  private File pluginManifestLocation;
  private ZipFile pluginZip;
  private Dictionary<String, String> generatedManifest;
  private byte manifestType;
  private Version target;
  private Dictionary<String, String> devProperties;
  static final Version TARGET31 = new Version(3, 1, 0);
  static final Version TARGET32 = new Version(3, 2, 0);
  private static final String MANIFEST_VERSION = "Manifest-Version";
  private static final String PLUGIN_PROPERTIES_FILENAME = "plugin";
  private static PluginConverterImpl instance;
  private static final String[] ARCH_LIST = { "PA_RISC", "ppc", "sparc", "x86", "x86_64", "ia64" };
  public static final String FRAGMENT_MANIFEST = "fragment.xml";
  public static final String GENERATED_FROM = "Generated-from";
  public static final String MANIFEST_TYPE_ATTRIBUTE = "type";
  private static final String[] OS_LIST = { "aix", "hpux", "linux", "macosx", "qnx", "solaris", "win32" };
  protected static final String PI_RUNTIME = "org.eclipse.core.runtime";
  protected static final String PI_BOOT = "org.eclipse.core.boot";
  protected static final String PI_RUNTIME_COMPATIBILITY = "org.eclipse.core.runtime.compatibility";
  public static final String PLUGIN_MANIFEST = "plugin.xml";
  private static final String COMPATIBILITY_ACTIVATOR = "org.eclipse.core.internal.compatibility.PluginActivator";
  private static final String[] WS_LIST = { "carbon", "gtk", "motif", "photon", "win32" };
  private static final String IGNORE_DOT = "@ignoredot@";
  
  public static PluginConverterImpl getDefault()
  {
    return instance;
  }
  
  public PluginConverterImpl(FrameworkAdaptor adaptor, BundleContext context)
  {
    this.context = context;
    this.adaptor = adaptor;
    instance = this;
  }
  
  private void init()
  {
    out = null;
    pluginInfo = null;
    pluginManifestLocation = null;
    pluginZip = null;
    generatedManifest = new Hashtable(10);
    manifestType = 0;
    target = null;
    devProperties = null;
  }
  
  /* Error */
  private void fillPluginInfo(File pluginBaseLocation)
    throws PluginConversionException
  {
    // Byte code:
    //   0: aload_0
    //   1: aload_1
    //   2: putfield 861	org/eclipse/core/runtime/internal/adaptor/PluginConverterImpl:pluginManifestLocation	Ljava/io/File;
    //   5: aload_0
    //   6: getfield 861	org/eclipse/core/runtime/internal/adaptor/PluginConverterImpl:pluginManifestLocation	Ljava/io/File;
    //   9: ifnonnull +11 -> 20
    //   12: new 527	java/lang/IllegalArgumentException
    //   15: dup
    //   16: invokespecial 903	java/lang/IllegalArgumentException:<init>	()V
    //   19: athrow
    //   20: aconst_null
    //   21: astore_2
    //   22: aload_0
    //   23: aload_1
    //   24: invokespecial 967	org/eclipse/core/runtime/internal/adaptor/PluginConverterImpl:findPluginManifest	(Ljava/io/File;)Ljava/io/InputStream;
    //   27: astore_2
    //   28: goto +23 -> 51
    //   31: astore_3
    //   32: new 559	org/eclipse/osgi/service/pluginconversion/PluginConversionException
    //   35: dup
    //   36: getstatic 855	org/eclipse/core/runtime/internal/adaptor/EclipseAdaptorMsg:ECLIPSE_CONVERTER_FILENOTFOUND	Ljava/lang/String;
    //   39: aload_1
    //   40: invokevirtual 891	java/io/File:getAbsolutePath	()Ljava/lang/String;
    //   43: invokestatic 1002	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;
    //   46: aload_3
    //   47: invokespecial 996	org/eclipse/osgi/service/pluginconversion/PluginConversionException:<init>	(Ljava/lang/String;Ljava/lang/Throwable;)V
    //   50: athrow
    //   51: aload_2
    //   52: ifnonnull +21 -> 73
    //   55: new 559	org/eclipse/osgi/service/pluginconversion/PluginConversionException
    //   58: dup
    //   59: getstatic 855	org/eclipse/core/runtime/internal/adaptor/EclipseAdaptorMsg:ECLIPSE_CONVERTER_FILENOTFOUND	Ljava/lang/String;
    //   62: aload_1
    //   63: invokevirtual 891	java/io/File:getAbsolutePath	()Ljava/lang/String;
    //   66: invokestatic 1002	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;
    //   69: invokespecial 995	org/eclipse/osgi/service/pluginconversion/PluginConversionException:<init>	(Ljava/lang/String;)V
    //   72: athrow
    //   73: aload_0
    //   74: aload_0
    //   75: aload_2
    //   76: invokespecial 975	org/eclipse/core/runtime/internal/adaptor/PluginConverterImpl:parsePluginInfo	(Ljava/io/InputStream;)Lorg/eclipse/core/runtime/internal/adaptor/IPluginInfo;
    //   79: putfield 868	org/eclipse/core/runtime/internal/adaptor/PluginConverterImpl:pluginInfo	Lorg/eclipse/core/runtime/internal/adaptor/IPluginInfo;
    //   82: goto +31 -> 113
    //   85: astore 4
    //   87: aload_0
    //   88: getfield 867	org/eclipse/core/runtime/internal/adaptor/PluginConverterImpl:pluginZip	Ljava/util/zip/ZipFile;
    //   91: ifnull +19 -> 110
    //   94: aload_0
    //   95: getfield 867	org/eclipse/core/runtime/internal/adaptor/PluginConverterImpl:pluginZip	Ljava/util/zip/ZipFile;
    //   98: invokevirtual 943	java/util/zip/ZipFile:close	()V
    //   101: aload_0
    //   102: aconst_null
    //   103: putfield 867	org/eclipse/core/runtime/internal/adaptor/PluginConverterImpl:pluginZip	Ljava/util/zip/ZipFile;
    //   106: goto +4 -> 110
    //   109: pop
    //   110: aload 4
    //   112: athrow
    //   113: aload_0
    //   114: getfield 867	org/eclipse/core/runtime/internal/adaptor/PluginConverterImpl:pluginZip	Ljava/util/zip/ZipFile;
    //   117: ifnull +19 -> 136
    //   120: aload_0
    //   121: getfield 867	org/eclipse/core/runtime/internal/adaptor/PluginConverterImpl:pluginZip	Ljava/util/zip/ZipFile;
    //   124: invokevirtual 943	java/util/zip/ZipFile:close	()V
    //   127: aload_0
    //   128: aconst_null
    //   129: putfield 867	org/eclipse/core/runtime/internal/adaptor/PluginConverterImpl:pluginZip	Ljava/util/zip/ZipFile;
    //   132: goto +4 -> 136
    //   135: pop
    //   136: aload_0
    //   137: getfield 868	org/eclipse/core/runtime/internal/adaptor/PluginConverterImpl:pluginInfo	Lorg/eclipse/core/runtime/internal/adaptor/IPluginInfo;
    //   140: invokeinterface 1042 1 0
    //   145: astore_3
    //   146: aload_3
    //   147: ifnull +12 -> 159
    //   150: new 559	org/eclipse/osgi/service/pluginconversion/PluginConversionException
    //   153: dup
    //   154: aload_3
    //   155: invokespecial 995	org/eclipse/osgi/service/pluginconversion/PluginConversionException:<init>	(Ljava/lang/String;)V
    //   158: athrow
    //   159: return
    // Line number table:
    //   Java source line #103	-> byte code offset #0
    //   Java source line #104	-> byte code offset #5
    //   Java source line #105	-> byte code offset #12
    //   Java source line #106	-> byte code offset #20
    //   Java source line #109	-> byte code offset #22
    //   Java source line #110	-> byte code offset #31
    //   Java source line #111	-> byte code offset #32
    //   Java source line #113	-> byte code offset #51
    //   Java source line #114	-> byte code offset #55
    //   Java source line #115	-> byte code offset #73
    //   Java source line #116	-> byte code offset #85
    //   Java source line #117	-> byte code offset #87
    //   Java source line #119	-> byte code offset #94
    //   Java source line #120	-> byte code offset #101
    //   Java source line #121	-> byte code offset #109
    //   Java source line #124	-> byte code offset #110
    //   Java source line #117	-> byte code offset #113
    //   Java source line #119	-> byte code offset #120
    //   Java source line #120	-> byte code offset #127
    //   Java source line #121	-> byte code offset #135
    //   Java source line #125	-> byte code offset #136
    //   Java source line #126	-> byte code offset #146
    //   Java source line #127	-> byte code offset #150
    //   Java source line #128	-> byte code offset #159
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	160	0	this	PluginConverterImpl
    //   0	160	1	pluginBaseLocation	File
    //   21	55	2	pluginFile	InputStream
    //   31	16	3	e	IOException
    //   145	10	3	validation	String
    //   85	26	4	localObject	Object
    //   109	1	6	localIOException1	IOException
    //   135	1	7	localIOException2	IOException
    // Exception table:
    //   from	to	target	type
    //   22	28	31	java/io/IOException
    //   22	85	85	finally
    //   94	106	109	java/io/IOException
    //   120	132	135	java/io/IOException
  }
  
  private Set<String> filterExport(Set<String> exportToFilter, Collection<String> filter)
  {
    if ((filter == null) || (filter.contains("*"))) {
      return exportToFilter;
    }
    Set<String> filteredExport = new HashSet(exportToFilter.size());
    for (Iterator localIterator1 = exportToFilter.iterator(); localIterator1.hasNext();)
    {
      String anExport = (String)localIterator1.next();
      for (Iterator localIterator2 = filter.iterator(); localIterator2.hasNext();)
      {
        String aFilter = (String)localIterator2.next();
        int dotStar = aFilter.indexOf(".*");
        if (dotStar != -1) {
          aFilter = aFilter.substring(0, dotStar);
        }
        if (anExport.equals(aFilter))
        {
          filteredExport.add(anExport);
          break;
        }
      }
    }
    return filteredExport;
  }
  
  private List<String> findOSJars(File pluginRoot, String path, boolean filter)
  {
    path = path.substring(4);
    List<String> found = new ArrayList(0);
    for (int i = 0; i < OS_LIST.length; i++)
    {
      String searchedPath = "os/" + OS_LIST[i] + "/" + path;
      if (new File(pluginRoot, searchedPath).exists()) {
        found.add(searchedPath + (filter ? ";(os=" + WS_LIST[i] + ")" : ""));
      }
      for (int j = 0; j < ARCH_LIST.length; j++)
      {
        searchedPath = "os/" + OS_LIST[i] + "/" + ARCH_LIST[j] + "/" + path;
        if (new File(pluginRoot, searchedPath).exists()) {
          found.add(searchedPath + (filter ? ";(& (os=" + WS_LIST[i] + ") (arch=" + ARCH_LIST[j] + ")" : ""));
        }
      }
    }
    return found;
  }
  
  private InputStream findPluginManifest(File baseLocation)
    throws IOException
  {
    if (pluginZip != null) {
      try
      {
        pluginZip.close();
      }
      catch (IOException localIOException) {}
    }
    pluginZip = null;
    if (!baseLocation.isDirectory())
    {
      manifestType = ((byte)(manifestType | 0x8));
      pluginZip = new ZipFile(baseLocation);
    }
    if (pluginZip != null)
    {
      ZipEntry manifestEntry = pluginZip.getEntry("plugin.xml");
      if (manifestEntry != null)
      {
        manifestType = ((byte)(manifestType | 0x2));
        return pluginZip.getInputStream(manifestEntry);
      }
    }
    else
    {
      File manifestFile = new File(baseLocation, "plugin.xml");
      if (manifestFile.exists())
      {
        manifestType = ((byte)(manifestType | 0x2));
        return new FileInputStream(manifestFile);
      }
    }
    if (pluginZip != null)
    {
      ZipEntry manifestEntry = pluginZip.getEntry("fragment.xml");
      if (manifestEntry != null)
      {
        manifestType = ((byte)(manifestType | 0x2));
        return pluginZip.getInputStream(manifestEntry);
      }
    }
    else
    {
      File manifestFile = new File(baseLocation, "fragment.xml");
      if (manifestFile.exists())
      {
        manifestType = ((byte)(manifestType | 0x4));
        return new FileInputStream(manifestFile);
      }
    }
    return null;
  }
  
  private List<String> findWSJars(File pluginRoot, String path, boolean filter)
  {
    path = path.substring(4);
    List<String> found = new ArrayList(0);
    for (int i = 0; i < WS_LIST.length; i++)
    {
      String searchedPath = "ws/" + WS_LIST[i] + path;
      if (new File(pluginRoot, searchedPath).exists()) {
        found.add(searchedPath + (filter ? ";(ws=" + WS_LIST[i] + ")" : ""));
      }
    }
    return found;
  }
  
  protected void fillManifest(boolean compatibilityManifest, boolean analyseJars)
  {
    generateManifestVersion();
    generateHeaders();
    generateClasspath();
    generateActivator();
    generatePluginClass();
    if (analyseJars) {
      generateProvidePackage();
    }
    generateRequireBundle();
    generateLocalizationEntry();
    generateEclipseHeaders();
    if (compatibilityManifest) {
      generateTimestamp();
    }
  }
  
  /* Error */
  public void writeManifest(File generationLocation, Dictionary<String, String> manifestToWrite, boolean compatibilityManifest)
    throws PluginConversionException
  {
    // Byte code:
    //   0: invokestatic 929	java/lang/System:currentTimeMillis	()J
    //   3: lstore 4
    //   5: new 518	java/io/File
    //   8: dup
    //   9: aload_1
    //   10: invokevirtual 892	java/io/File:getParent	()Ljava/lang/String;
    //   13: invokespecial 894	java/io/File:<init>	(Ljava/lang/String;)V
    //   16: astore 6
    //   18: aload 6
    //   20: invokevirtual 890	java/io/File:mkdirs	()Z
    //   23: pop
    //   24: aload_1
    //   25: invokevirtual 885	java/io/File:createNewFile	()Z
    //   28: pop
    //   29: aload_1
    //   30: invokevirtual 889	java/io/File:isFile	()Z
    //   33: ifne +31 -> 64
    //   36: getstatic 853	org/eclipse/core/runtime/internal/adaptor/EclipseAdaptorMsg:ECLIPSE_CONVERTER_ERROR_CREATING_BUNDLE_MANIFEST	Ljava/lang/String;
    //   39: aload_0
    //   40: getfield 868	org/eclipse/core/runtime/internal/adaptor/PluginConverterImpl:pluginInfo	Lorg/eclipse/core/runtime/internal/adaptor/IPluginInfo;
    //   43: invokeinterface 1040 1 0
    //   48: aload_1
    //   49: invokestatic 1003	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/String;
    //   52: astore 7
    //   54: new 559	org/eclipse/osgi/service/pluginconversion/PluginConversionException
    //   57: dup
    //   58: aload 7
    //   60: invokespecial 995	org/eclipse/osgi/service/pluginconversion/PluginConversionException:<init>	(Ljava/lang/String;)V
    //   63: athrow
    //   64: new 539	java/util/Hashtable
    //   67: dup
    //   68: aload_2
    //   69: checkcast 539	java/util/Hashtable
    //   72: invokespecial 940	java/util/Hashtable:<init>	(Ljava/util/Map;)V
    //   75: astore_2
    //   76: aload_0
    //   77: new 517	java/io/BufferedWriter
    //   80: dup
    //   81: new 524	java/io/OutputStreamWriter
    //   84: dup
    //   85: new 520	java/io/FileOutputStream
    //   88: dup
    //   89: aload_1
    //   90: invokespecial 898	java/io/FileOutputStream:<init>	(Ljava/io/File;)V
    //   93: ldc 10
    //   95: invokespecial 901	java/io/OutputStreamWriter:<init>	(Ljava/io/OutputStream;Ljava/lang/String;)V
    //   98: invokespecial 882	java/io/BufferedWriter:<init>	(Ljava/io/Writer;)V
    //   101: putfield 860	org/eclipse/core/runtime/internal/adaptor/PluginConverterImpl:out	Ljava/io/BufferedWriter;
    //   104: aload_0
    //   105: ldc 8
    //   107: aload_2
    //   108: ldc 8
    //   110: invokevirtual 935	java/util/Dictionary:remove	(Ljava/lang/Object;)Ljava/lang/Object;
    //   113: checkcast 531	java/lang/String
    //   116: invokespecial 970	org/eclipse/core/runtime/internal/adaptor/PluginConverterImpl:writeEntry	(Ljava/lang/String;Ljava/lang/String;)V
    //   119: aload_0
    //   120: ldc 7
    //   122: aload_2
    //   123: ldc 7
    //   125: invokevirtual 935	java/util/Dictionary:remove	(Ljava/lang/Object;)Ljava/lang/Object;
    //   128: checkcast 531	java/lang/String
    //   131: invokespecial 970	org/eclipse/core/runtime/internal/adaptor/PluginConverterImpl:writeEntry	(Ljava/lang/String;Ljava/lang/String;)V
    //   134: aload_0
    //   135: ldc_w 474
    //   138: aload_2
    //   139: ldc_w 474
    //   142: invokevirtual 935	java/util/Dictionary:remove	(Ljava/lang/Object;)Ljava/lang/Object;
    //   145: checkcast 531	java/lang/String
    //   148: invokespecial 970	org/eclipse/core/runtime/internal/adaptor/PluginConverterImpl:writeEntry	(Ljava/lang/String;Ljava/lang/String;)V
    //   151: aload_0
    //   152: ldc_w 475
    //   155: aload_2
    //   156: ldc_w 475
    //   159: invokevirtual 935	java/util/Dictionary:remove	(Ljava/lang/Object;)Ljava/lang/Object;
    //   162: checkcast 531	java/lang/String
    //   165: invokespecial 970	org/eclipse/core/runtime/internal/adaptor/PluginConverterImpl:writeEntry	(Ljava/lang/String;Ljava/lang/String;)V
    //   168: aload_0
    //   169: ldc_w 476
    //   172: aload_2
    //   173: ldc_w 476
    //   176: invokevirtual 935	java/util/Dictionary:remove	(Ljava/lang/Object;)Ljava/lang/Object;
    //   179: checkcast 531	java/lang/String
    //   182: invokespecial 970	org/eclipse/core/runtime/internal/adaptor/PluginConverterImpl:writeEntry	(Ljava/lang/String;Ljava/lang/String;)V
    //   185: aload_0
    //   186: ldc_w 478
    //   189: aload_2
    //   190: ldc_w 478
    //   193: invokevirtual 935	java/util/Dictionary:remove	(Ljava/lang/Object;)Ljava/lang/Object;
    //   196: checkcast 531	java/lang/String
    //   199: invokespecial 970	org/eclipse/core/runtime/internal/adaptor/PluginConverterImpl:writeEntry	(Ljava/lang/String;Ljava/lang/String;)V
    //   202: aload_0
    //   203: ldc_w 472
    //   206: aload_2
    //   207: ldc_w 472
    //   210: invokevirtual 935	java/util/Dictionary:remove	(Ljava/lang/Object;)Ljava/lang/Object;
    //   213: checkcast 531	java/lang/String
    //   216: invokespecial 970	org/eclipse/core/runtime/internal/adaptor/PluginConverterImpl:writeEntry	(Ljava/lang/String;Ljava/lang/String;)V
    //   219: aload_0
    //   220: ldc_w 471
    //   223: aload_2
    //   224: ldc_w 471
    //   227: invokevirtual 935	java/util/Dictionary:remove	(Ljava/lang/Object;)Ljava/lang/Object;
    //   230: checkcast 531	java/lang/String
    //   233: invokespecial 970	org/eclipse/core/runtime/internal/adaptor/PluginConverterImpl:writeEntry	(Ljava/lang/String;Ljava/lang/String;)V
    //   236: aload_0
    //   237: ldc_w 477
    //   240: aload_2
    //   241: ldc_w 477
    //   244: invokevirtual 935	java/util/Dictionary:remove	(Ljava/lang/Object;)Ljava/lang/Object;
    //   247: checkcast 531	java/lang/String
    //   250: invokespecial 970	org/eclipse/core/runtime/internal/adaptor/PluginConverterImpl:writeEntry	(Ljava/lang/String;Ljava/lang/String;)V
    //   253: aload_0
    //   254: ldc_w 483
    //   257: aload_2
    //   258: ldc_w 483
    //   261: invokevirtual 935	java/util/Dictionary:remove	(Ljava/lang/Object;)Ljava/lang/Object;
    //   264: checkcast 531	java/lang/String
    //   267: invokespecial 970	org/eclipse/core/runtime/internal/adaptor/PluginConverterImpl:writeEntry	(Ljava/lang/String;Ljava/lang/String;)V
    //   270: aload_0
    //   271: ldc_w 473
    //   274: aload_2
    //   275: ldc_w 473
    //   278: invokevirtual 935	java/util/Dictionary:remove	(Ljava/lang/Object;)Ljava/lang/Object;
    //   281: checkcast 531	java/lang/String
    //   284: invokespecial 970	org/eclipse/core/runtime/internal/adaptor/PluginConverterImpl:writeEntry	(Ljava/lang/String;Ljava/lang/String;)V
    //   287: aload_0
    //   288: ldc_w 482
    //   291: aload_2
    //   292: ldc_w 482
    //   295: invokevirtual 935	java/util/Dictionary:remove	(Ljava/lang/Object;)Ljava/lang/Object;
    //   298: checkcast 531	java/lang/String
    //   301: invokespecial 970	org/eclipse/core/runtime/internal/adaptor/PluginConverterImpl:writeEntry	(Ljava/lang/String;Ljava/lang/String;)V
    //   304: aload_0
    //   305: ldc_w 489
    //   308: aload_2
    //   309: ldc_w 489
    //   312: invokevirtual 935	java/util/Dictionary:remove	(Ljava/lang/Object;)Ljava/lang/Object;
    //   315: checkcast 531	java/lang/String
    //   318: invokespecial 970	org/eclipse/core/runtime/internal/adaptor/PluginConverterImpl:writeEntry	(Ljava/lang/String;Ljava/lang/String;)V
    //   321: aload_0
    //   322: ldc_w 490
    //   325: aload_2
    //   326: ldc_w 490
    //   329: invokevirtual 935	java/util/Dictionary:remove	(Ljava/lang/Object;)Ljava/lang/Object;
    //   332: checkcast 531	java/lang/String
    //   335: invokespecial 970	org/eclipse/core/runtime/internal/adaptor/PluginConverterImpl:writeEntry	(Ljava/lang/String;Ljava/lang/String;)V
    //   338: aload_2
    //   339: invokevirtual 933	java/util/Dictionary:keys	()Ljava/util/Enumeration;
    //   342: astore 7
    //   344: goto +30 -> 374
    //   347: aload 7
    //   349: invokeinterface 1014 1 0
    //   354: checkcast 531	java/lang/String
    //   357: astore 8
    //   359: aload_0
    //   360: aload 8
    //   362: aload_2
    //   363: aload 8
    //   365: invokevirtual 934	java/util/Dictionary:get	(Ljava/lang/Object;)Ljava/lang/Object;
    //   368: checkcast 531	java/lang/String
    //   371: invokespecial 970	org/eclipse/core/runtime/internal/adaptor/PluginConverterImpl:writeEntry	(Ljava/lang/String;Ljava/lang/String;)V
    //   374: aload 7
    //   376: invokeinterface 1013 1 0
    //   381: ifne -34 -> 347
    //   384: aload_0
    //   385: getfield 860	org/eclipse/core/runtime/internal/adaptor/PluginConverterImpl:out	Ljava/io/BufferedWriter;
    //   388: invokevirtual 880	java/io/BufferedWriter:flush	()V
    //   391: goto +58 -> 449
    //   394: astore 6
    //   396: getstatic 853	org/eclipse/core/runtime/internal/adaptor/EclipseAdaptorMsg:ECLIPSE_CONVERTER_ERROR_CREATING_BUNDLE_MANIFEST	Ljava/lang/String;
    //   399: aload_0
    //   400: getfield 868	org/eclipse/core/runtime/internal/adaptor/PluginConverterImpl:pluginInfo	Lorg/eclipse/core/runtime/internal/adaptor/IPluginInfo;
    //   403: invokeinterface 1040 1 0
    //   408: aload_1
    //   409: invokestatic 1003	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/String;
    //   412: astore 7
    //   414: new 559	org/eclipse/osgi/service/pluginconversion/PluginConversionException
    //   417: dup
    //   418: aload 7
    //   420: aload 6
    //   422: invokespecial 996	org/eclipse/osgi/service/pluginconversion/PluginConversionException:<init>	(Ljava/lang/String;Ljava/lang/Throwable;)V
    //   425: athrow
    //   426: astore 9
    //   428: aload_0
    //   429: getfield 860	org/eclipse/core/runtime/internal/adaptor/PluginConverterImpl:out	Ljava/io/BufferedWriter;
    //   432: ifnull +14 -> 446
    //   435: aload_0
    //   436: getfield 860	org/eclipse/core/runtime/internal/adaptor/PluginConverterImpl:out	Ljava/io/BufferedWriter;
    //   439: invokevirtual 879	java/io/BufferedWriter:close	()V
    //   442: goto +4 -> 446
    //   445: pop
    //   446: aload 9
    //   448: athrow
    //   449: aload_0
    //   450: getfield 860	org/eclipse/core/runtime/internal/adaptor/PluginConverterImpl:out	Ljava/io/BufferedWriter;
    //   453: ifnull +14 -> 467
    //   456: aload_0
    //   457: getfield 860	org/eclipse/core/runtime/internal/adaptor/PluginConverterImpl:out	Ljava/io/BufferedWriter;
    //   460: invokevirtual 879	java/io/BufferedWriter:close	()V
    //   463: goto +4 -> 467
    //   466: pop
    //   467: getstatic 859	org/eclipse/core/runtime/internal/adaptor/PluginConverterImpl:DEBUG	Z
    //   470: ifeq +47 -> 517
    //   473: getstatic 852	java/lang/System:out	Ljava/io/PrintStream;
    //   476: new 532	java/lang/StringBuffer
    //   479: dup
    //   480: ldc_w 492
    //   483: invokespecial 923	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   486: aload_1
    //   487: invokevirtual 927	java/lang/StringBuffer:append	(Ljava/lang/Object;)Ljava/lang/StringBuffer;
    //   490: ldc_w 463
    //   493: invokevirtual 928	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   496: invokestatic 929	java/lang/System:currentTimeMillis	()J
    //   499: lload 4
    //   501: lsub
    //   502: invokevirtual 926	java/lang/StringBuffer:append	(J)Ljava/lang/StringBuffer;
    //   505: ldc_w 497
    //   508: invokevirtual 928	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   511: invokevirtual 922	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   514: invokevirtual 902	java/io/PrintStream:println	(Ljava/lang/String;)V
    //   517: return
    // Line number table:
    //   Java source line #242	-> byte code offset #0
    //   Java source line #244	-> byte code offset #5
    //   Java source line #245	-> byte code offset #18
    //   Java source line #246	-> byte code offset #24
    //   Java source line #247	-> byte code offset #29
    //   Java source line #248	-> byte code offset #36
    //   Java source line #249	-> byte code offset #54
    //   Java source line #252	-> byte code offset #64
    //   Java source line #254	-> byte code offset #76
    //   Java source line #255	-> byte code offset #104
    //   Java source line #256	-> byte code offset #119
    //   Java source line #258	-> byte code offset #134
    //   Java source line #259	-> byte code offset #151
    //   Java source line #260	-> byte code offset #168
    //   Java source line #261	-> byte code offset #185
    //   Java source line #262	-> byte code offset #202
    //   Java source line #263	-> byte code offset #219
    //   Java source line #264	-> byte code offset #236
    //   Java source line #265	-> byte code offset #253
    //   Java source line #266	-> byte code offset #270
    //   Java source line #268	-> byte code offset #287
    //   Java source line #270	-> byte code offset #304
    //   Java source line #271	-> byte code offset #321
    //   Java source line #272	-> byte code offset #338
    //   Java source line #273	-> byte code offset #344
    //   Java source line #274	-> byte code offset #347
    //   Java source line #275	-> byte code offset #359
    //   Java source line #273	-> byte code offset #374
    //   Java source line #277	-> byte code offset #384
    //   Java source line #278	-> byte code offset #394
    //   Java source line #279	-> byte code offset #396
    //   Java source line #280	-> byte code offset #414
    //   Java source line #281	-> byte code offset #426
    //   Java source line #282	-> byte code offset #428
    //   Java source line #284	-> byte code offset #435
    //   Java source line #285	-> byte code offset #445
    //   Java source line #288	-> byte code offset #446
  
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 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84

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