org.eclipse.pde.core_3.7.1.v20120103_r372

nager().getExternalModels());
    return manager;
  }
}

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

import java.util.Comparator;
import org.eclipse.core.runtime.IConfigurationElement;

class TargetDefinitionManager$1
  implements Comparator
{
  final TargetDefinitionManager this$0;
  
  TargetDefinitionManager$1(TargetDefinitionManager paramTargetDefinitionManager)
  {
    this$0 = paramTargetDefinitionManager;
  }
  
  public int compare(Object o1, Object o2)
  {
    String value1 = getString((IConfigurationElement)o1);
    String value2 = getString((IConfigurationElement)o2);
    return value1.compareTo(value2);
  }
  
  private String getString(IConfigurationElement elem)
  {
    String name = elem.getAttribute("name");
    String id = elem.getAttribute("id");
    name = name + " [" + id + "]";
    return name;
  }
}

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

import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Arrays;
import java.util.Collection;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionDelta;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.IRegistryChangeEvent;
import org.eclipse.core.runtime.IRegistryChangeListener;
import org.eclipse.core.runtime.Platform;
import org.osgi.framework.Bundle;

public class TargetDefinitionManager
  implements IRegistryChangeListener
{
  Map fTargets;
  private static String[] attributes;
  
  public TargetDefinitionManager()
  {
    attributes = new String[] { "id", "name" };
  }
  
  public void registryChanged(IRegistryChangeEvent event)
  {
    IExtensionDelta[] deltas = event.getExtensionDeltas();
    for (int i = 0; i < deltas.length; i++)
    {
      IExtension extension = deltas[i].getExtension();
      String extensionId = extension.getExtensionPointUniqueIdentifier();
      if (extensionId.equals("org.eclipse.pde.core.targets"))
      {
        IConfigurationElement[] elems = extension.getConfigurationElements();
        if (deltas[i].getKind() == 1) {
          add(elems);
        } else {
          remove(elems);
        }
      }
    }
  }
  
  public IConfigurationElement[] getTargets()
  {
    if (fTargets == null) {
      loadElements();
    }
    return (IConfigurationElement[])fTargets.values().toArray(new IConfigurationElement[fTargets.size()]);
  }
  
  public IConfigurationElement[] getSortedTargets()
  {
    if (fTargets == null) {
      loadElements();
    }
    IConfigurationElement[] result = (IConfigurationElement[])fTargets.values().toArray(new IConfigurationElement[fTargets.size()]);
    Arrays.sort(result, new Comparator()
    {
      public int compare(Object o1, Object o2)
      {
        String value1 = getString((IConfigurationElement)o1);
        String value2 = getString((IConfigurationElement)o2);
        return value1.compareTo(value2);
      }
      
      private String getString(IConfigurationElement elem)
      {
        String name = elem.getAttribute("name");
        String id = elem.getAttribute("id");
        name = name + " [" + id + "]";
        return name;
      }
    });
    return result;
  }
  
  public IConfigurationElement getTarget(String id)
  {
    if (fTargets == null) {
      loadElements();
    }
    return (IConfigurationElement)fTargets.get(id);
  }
  
  private void loadElements()
  {
    fTargets = new HashMap();
    IExtensionRegistry registry = Platform.getExtensionRegistry();
    registry.addRegistryChangeListener(this);
    IConfigurationElement[] elements = registry.getConfigurationElementsFor("org.eclipse.pde.core.targets");
    add(elements);
  }
  
  private boolean isValid(IConfigurationElement elem)
  {
    for (int i = 0; i < attributes.length; i++)
    {
      String value = elem.getAttribute(attributes[i]);
      if ((value == null) || (value.equals(""))) {
        return false;
      }
    }
    String value = elem.getAttribute("definition");
    String symbolicName = elem.getDeclaringExtension().getNamespaceIdentifier();
    URL url = getResourceURL(symbolicName, value);
    try
    {
      if ((url != null) && (url.openStream().available() > 0)) {
        return true;
      }
    }
    catch (IOException localIOException) {}
    return false;
  }
  
  public static URL getResourceURL(String bundleID, String resourcePath)
  {
    try
    {
      Bundle bundle = Platform.getBundle(bundleID);
      if ((bundle != null) && (resourcePath != null))
      {
        URL entry = bundle.getEntry(resourcePath);
        if (entry != null) {
          return FileLocator.toFileURL(entry);
        }
      }
    }
    catch (IOException localIOException) {}
    return null;
  }
  
  private void add(IConfigurationElement[] elems)
  {
    for (int i = 0; i < elems.length; i++)
    {
      IConfigurationElement elem = elems[i];
      if (isValid(elem))
      {
        String id = elem.getAttribute("id");
        fTargets.put(id, elem);
      }
    }
  }
  
  private void remove(IConfigurationElement[] elems)
  {
    for (int i = 0; i < elems.length; i++) {
      fTargets.remove(elems[i].getAttribute("id"));
    }
  }
  
  public void shutdown()
  {
    IExtensionRegistry registry = Platform.getExtensionRegistry();
    registry.removeRegistryChangeListener(this);
  }
}

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

import java.io.File;

public class TargetPDERegistryStrategy
  extends PDERegistryStrategy
{
  public TargetPDERegistryStrategy(File[] storageDirs, boolean[] cacheReadOnly, Object key, PDEExtensionRegistry registry)
  {
    super(storageDirs, cacheReadOnly, key, registry);
  }
  
  protected void init() {}
}

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

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Dictionary;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.TreeSet;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.launching.JavaRuntime;
import org.eclipse.jdt.launching.environments.IExecutionEnvironment;
import org.eclipse.jdt.launching.environments.IExecutionEnvironmentsManager;
import org.eclipse.osgi.service.resolver.BundleDescription;
import org.eclipse.osgi.service.resolver.State;
import org.eclipse.osgi.util.ManifestElement;
import org.eclipse.pde.core.plugin.IPluginBase;
import org.eclipse.pde.core.plugin.IPluginLibrary;
import org.eclipse.pde.core.plugin.IPluginModelBase;
import org.eclipse.pde.core.plugin.PluginRegistry;
import org.eclipse.pde.core.plugin.TargetPlatform;
import org.eclipse.pde.internal.core.ifeature.IFeatureModel;
import org.eclipse.pde.internal.core.util.CoreUtility;
import org.eclipse.pde.internal.core.util.VersionUtil;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
import org.osgi.framework.Filter;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.Version;

public class TargetPlatformHelper
{
  public static final String REFERENCE_PREFIX = "reference:";
  public static final String PLATFORM_PREFIX = "platform:";
  public static final String FILE_URL_PREFIX = "file:";
  public static final String JAR_EXTENSION = ".jar";
  private static Map fCachedLocations;
  
  public static Properties getConfigIniProperties()
  {
    File iniFile = new File(TargetPlatform.getLocation(), "configuration/config.ini");
    if (!iniFile.exists()) {
      return null;
    }
    Properties pini = new Properties();
    FileInputStream fis = null;
    try
    {
      fis = new FileInputStream(iniFile);
      pini.load(fis);
      fis.close();
      return pini;
    }
    catch (IOException e)
    {
      PDECore.logException(e);
    }
    finally
    {
      try
      {
        if (fis != null) {
          fis.close();
        }
      }
      catch (IOException e)
      {
        PDECore.logException(e);
      }
    }
    return null;
  }
  
  public static String getBundleList()
  {
    Properties properties = getConfigIniProperties();
    String osgiBundles = properties == null ? null : properties.getProperty("osgi.bundles");
    if (osgiBundles == null) {
      osgiBundles = getDefaultBundleList();
    } else {
      osgiBundles = stripPathInformation(osgiBundles);
    }
    return osgiBundles;
  }
  
  public static String getDefaultBundleList()
  {
    StringBuffer buffer = new StringBuffer();
    if (getTargetVersion() > 3.1D)
    {
      buffer.append("org.eclipse.equinox.common@2:start,");
      buffer.append("org.eclipse.update.configurator@3:start,");
      buffer.append("org.eclipse.core.runtime@start");
    }
    else
    {
      buffer.append("org.eclipse.core.runtime@2:start,");
      buffer.append("org.eclipse.update.configurator@3:start");
    }
    return buffer.toString();
  }
  
  public static String stripPathInformation(String osgiBundles)
  {
    StringBuffer result = new StringBuffer();
    StringTokenizer tokenizer = new StringTokenizer(osgiBundles, ",");
    while (tokenizer.hasMoreElements())
    {
      String token = tokenizer.nextToken();
      token = token.replaceAll("\\\\:|/:", ":");
      
      int atIndex = token.indexOf('@');
      String bundle = atIndex > 0 ? token.substring(0, atIndex) : token;
      bundle = bundle.trim();
      if ((bundle.startsWith("reference:")) && (bundle.length() > "reference:".length())) {
        bundle = bundle.substring("reference:".length());
      }
      if ((bundle.startsWith("platform:")) && (bundle.length() > "platform:".length())) {
        bundle = bundle.substring("platform:".length());
      }
      if ((bundle.startsWith("file:")) && (bundle.length() > "file:".length())) {
        bundle = bundle.substring("file:".length());
      }
      IPath path = new Path(bundle);
      String id = null;
      if (path.isAbsolute()) {
        id = getSymbolicName(bundle);
      }
      if (id == null) {
        id = path.lastSegment();
      }
      if (id != null)
      {
        int underscoreIndex = id.indexOf('_');
        if (underscoreIndex >= 0) {
          id = id.substring(0, underscoreIndex);
        }
        if (id.endsWith(".jar")) {
          id = id.substring(0, id.length() - 4);
        }
      }
      if (result.length() > 0) {
        result.append(",");
      }
      result.append(id != null ? id : bundle);
      if (atIndex > -1) {
        result.append(token.substring(atIndex).trim());
      }
    }
    return result.toString();
  }
  
  private static synchronized String getSymbolicName(String path)
  {
    if (fCachedLocations == null) {
      fCachedLocations = new HashMap();
    }
    File file = new File(path);
    if ((file.exists()) && (!fCachedLocations.containsKey(path))) {
      try
      {
        Dictionary dictionary = MinimalState.loadManifest(file);
        String value = (String)dictionary.get("Bundle-SymbolicName");
        if (value != null)
        {
          ManifestElement[] elements = ManifestElement.parseHeader("Bundle-SymbolicName", value);
          String id = elements.length > 0 ? elements[0].getValue() : null;
          if (id != null) {
            fCachedLocations.put(path, elements[0].getValue());
          }
        }
      }
      catch (IOException localIOException) {}catch (BundleException localBundleException) {}
    }
    return (String)fCachedLocations.get(path);
  }
  
  public static void checkPluginPropertiesConsistency(Map map, File configDir)
  {
    File runtimeDir = new File(configDir, "org.eclipse.core.runtime");
    if ((runtimeDir.exists()) && (runtimeDir.isDirectory()))
    {
      long timestamp = runtimeDir.lastModified();
      Iterator iter = map.values().iterator();
      while (iter.hasNext()) {
        if (hasChanged((IPluginModelBase)iter.next(), timestamp))
        {
          CoreUtility.deleteContent(runtimeDir);
          break;
        }
      }
    }
  }
  
  private static boolean hasChanged(IPluginModelBase model, long timestamp)
  {
    if (model.getUnderlyingResource() != null)
    {
      File[] files = new File(model.getInstallLocation()).listFiles();
      if (files != null) {
        for (int i = 0; i < files.length; i++) {
          if (!files[i].isDirectory())
          {
            String name = files[i].getName();
            if ((name.startsWith("OSGI-INF/l10n/bundle")) && (name.endsWith(".properties")) && 
              (files[i].lastModified() > timestamp)) {
              return true;
            }
          }
        }
      }
    }
    return false;
  }
  
  public static Set getApplicationNameSet()
  {
    TreeSet result = new TreeSet();
    IExtension[] extensions = PDECore.getDefault().getExtensionsRegistry().findExtensions("org.eclipse.core.runtime.applications", true);
    for (int i = 0; i < extensions.length; i++)
    {
      String id = extensions[i].getUniqueIdentifier();
      IConfigurationElement[] elements = extensions[i].getConfigurationElements();
      if (elements.length == 1)
      {
        String visiblity = elements[0].getAttribute("visible");
        boolean visible = visiblity == null ? true : Boolean.valueOf(visiblity).booleanValue();
        if ((id != null) && (visible)) {
          result.add(id);
        }
      }
    }
    result.add("org.eclipse.ui.ide.workbench");
    return result;
  }
  
  public static String[] getApplicationNames()
  {
    Set result = getApplicationNameSet();
    return (String[])result.toArray(new String[result.size()]);
  }
  
  public static TreeSet getProductNameSet()
  {
    TreeSet result = new TreeSet();
    IExtension[] extensions = PDECore.getDefault().getExtensionsRegistry().findExtensions("org.eclipse.core.runtime.products", true);
    for (int i = 0; i < extensions.length; i++)
    {
      IConfigurationElement[] elements = extensions[i].getConfigurationElements();
      if (elements.length == 1) {
        if ("product".equals(elements[0].getName()))
        {
          String id = extensions[i].getUniqueIdentifier();
          if ((id != null) && (id.trim().length() > 0)) {
            result.add(id);
          }
        }
      }
    }
    return result;
  }
  
  public static String[] getProductNames()
  {
    TreeSet result = getProductNameSet();
    return (String[])result.toArray(new String[result.size()]);
  }
  
  public static Dictionary getTargetEnvironment()
  {
    Dictionary result = new Hashtable();
    result.put("osgi.os", TargetPlatform.getOS());
    result.put("osgi.ws", TargetPlatform.getWS());
    result.put("osgi.nl", TargetPlatform.getNL());
    result.put("osgi.arch", TargetPlatform.getOSArch());
    result.put("osgi.resolveOptional", "true");
    result.put("osgi.resolverMode", "development");
    return result;
  }
  
  public static Dictionary getTargetEnvironment(MinimalState state)
  {
    Dictionary result = getTargetEnvironment();
    result.put("osgi.system.bundle", state.getSystemBundle());
    return result;
  }
  
  public static Dictionary[] getPlatformProperties(String[] profiles, MinimalState state)
  {
    if ((profiles == null) || (profiles.length == 0)) {
      return new Dictionary[] { getTargetEnvironment(state) };
    }
    ArrayList result = new ArrayList(profiles.length);
    for (int i = 0; i < profiles.length; i++)
    {
      IExecutionEnvironment environment = JavaRuntime.getExecutionEnvironmentsManager().getEnvironment(profiles[i]);
      if (environment != null)
      {
        Properties profileProps = environment.getProfileProperties();
        if (profileProps != null)
        {
          Dictionary props = getTargetEnvironment(state);
          String systemPackages = profileProps.getProperty("org.osgi.framework.system.packages");
          if (systemPackages != null) {
            props.put("org.osgi.framework.system.packages", systemPackages);
          }
          String ee = profileProps.getProperty("org.osgi.framework.executionenvironment");
          if (ee != null) {
            props.put("org.osgi.framework.executionenvironment", ee);
          }
          result.add(props);
        }
      }
    }
    if (result.size() > 0) {
      return (Dictionary[])result.toArray(new Dictionary[result.size()]);
    }
    return new Dictionary[] { getTargetEnvironment(state) };
  }
  
  public static String[] getKnownExecutionEnvironments()
  {
    String jreProfile = System.getProperty("pde.jreProfile");
    if ((jreProfile != null) && (jreProfile.length() > 0))
    {
      if ("none".equals(jreProfile)) {
        return new String[0];
      }
      return new String[] { jreProfile };
    }
    IExecutionEnvironment[] environments = JavaRuntime.getExecutionEnvironmentsManager().getExecutionEnvironments();
    String[] ids = new String[environments.length];
    for (int i = 0; i < environments.length; i++) {
      ids[i] = environments[i].getId();
    }
    return ids;
  }
  
  public static String getTargetVersionString()
  {
    IPluginModelBase model = PluginRegistry.findModel("org.eclipse.osgi");
    if (model == null) {
      return "3.7";
    }
    String version = model.getPluginBase().getVersion();
    if (VersionUtil.validateVersion(version).getSeverity() == 0)
    {
      Version vid = new Version(version);
      int major = vid.getMajor();
      int minor = vid.getMinor();
      if ((major == 3) && (minor == 0)) {
        return "3.0";
      }
      if ((major == 3) && (minor == 1)) {
        return "3.1";
      }
      if ((major == 3) && (minor == 2)) {
        return "3.2";
      }
      if ((major == 3) && (minor == 3)) {
        return "3.3";
      }
      if ((major == 3) && (minor == 4)) {
        return "3.4";
      }
      if ((major == 3) && (minor == 5)) {
        return "3.5";
      }
      if ((major == 3) && (minor == 6)) {
        return "3.6";
      }
    }
    return "3.7";
  }
  
  public static double getHostVersion()
  {
    BundleContext context = PDECore.getDefault().getBundleContext();
    Bundle bundle = context.getBundle(0L);
    String version = (String)bundle.getHeaders().get("Bundle-Version");
    if (version == null) {
      return Double.parseDouble("3.7");
    }
    if (VersionUtil.validateVersion(version).getSeverity() == 0)
    {
      Version vid = new Version(version);
      int major = vid.getMajor();
      int minor = vid.getMinor();
      if ((major == 3) && (minor == 0)) {
        return Double.parseDouble("3.0");
      }
      if ((major == 3) && (minor == 1)) {
        return Double.parseDouble("3.1");
      }
      if ((major == 3) && (minor == 2)) {
        return Double.parseDouble("3.2");
      }
      if ((major == 3) && (minor == 3)) {
        return Double.parseDouble("3.3");
      }
      if ((major == 3) && (minor == 4)) {
        return Double.parseDouble("3.4");
      }
      if ((major == 3) && (minor == 5)) {
        return Double.parseDouble("3.5");
      }
      if ((major == 3) && (minor == 6)) {
        return Double.parseDouble("3.6");
      }
    }
    return Double.parseDouble("3.7");
  }
  
  public static double getTargetVersion()
  {
    return Double.parseDouble(getTargetVersionString());
  }
  
  public static String getSchemaVersionForTargetVersion(String targetVersion)
  {
    double target;
    double target;
    if (targetVersion == null) {
      target = getTargetVersion();
    } else {
      target = Double.parseDouble(targetVersion);
    }
    String schemaVersion = "3.4";
    if (target < 3.2D) {
      schemaVersion = "3.0";
    } else if (target < 3.4D) {
      schemaVersion = "3.2";
    }
    return schemaVersion;
  }
  
  public static String getTargetVersionForSchemaVersion(String schemaVersion)
  {
    if (schemaVersion == null) {
      return getTargetVersionString();
    }
    if (schemaVersion.equals("3.0")) {
      return "3.1";
    }
    if (schemaVersion.equals("3.2")) {
      return "3.3";
    }
    return getTargetVersionString();
  }
  
  public static String getSchemaVersion()
  {
    return getSchemaVersionForTargetVersion(null);
  }
  
  public static PDEState getPDEState()
  {
    return PDECore.getDefault().getModelManager().getState();
  }
  
  public static State getState()
  {
    return getPDEState().getState();
  }
  
  public static Map getPatchMap(PDEState state)
  {
    HashMap properties = new HashMap();
    IPluginModelBase[] models = PluginRegistry.getActiveModels();
    for (int i = 0; i < models.length; i++)
    {
      BundleDescription desc = models[i].getBundleDescription();
      if (desc != null)
      {
        Long id = new Long(desc.getBundleId());
        if (ClasspathUtilCore.hasExtensibleAPI(models[i])) {
          properties.put(id, "Eclipse-ExtensibleAPI: true");
        } else if (ClasspathUtilCore.isPatchFragment(models[i])) {
          properties.put(id, "Eclipse-PatchFragment: true");
        }
      }
    }
    return properties;
  }
  
  public static HashMap getBundleClasspaths(PDEState state)
  {
    HashMap properties = new HashMap();
    BundleDescription[] bundles = state.getState().getBundles();
    for (int i = 0; i < bundles.length; i++) {
      properties.put(new Long(bundles[i].getBundleId()), getValue(bundles[i], state));
    }
    return properties;
  }
  
  private static String[] getValue(BundleDescription bundle, PDEState state)
  {
    IPluginModelBase model = PluginRegistry.findModel(bundle);
    String[] result = (String[])null;
    if (model != null)
    {
      IPluginLibrary[] libs = model.getPluginBase().getLibraries();
      result = new String[libs.length];
      for (int i = 0; i < libs.length; i++) {
        result[i] = libs[i].getName();
      }
    }
    else
    {
      String[] libs = state.getLibraryNames(bundle.getBundleId());
      result = new String[libs.length];
      for (int i = 0; i < libs.length; i++) {
        result[i] = libs[i];
      }
    }
    if (result.length == 0) {
      return new String[] { "." };
    }
    return result;
  }
  
  public static String[] getFeaturePaths()
  {
    IFeatureModel[] models = PDECore.getDefault().getFeatureModelManager().getModels();
    ArrayList list = new ArrayList();
    for (int i = 0; i < models.length; i++)
    {
      String location = models[i].getInstallLocation();
      if (location != null) {
        list.add(location + '/' + "feature.xml");
      }
    }
    return (String[])list.toArray(new String[list.size()]);
  }
  
  public static boolean matchesCurrentEnvironment(IPluginModelBase model)
  {
    BundleContext context = PDECore.getDefault().getBundleContext();
    Dictionary environment = getTargetEnvironment();
    BundleDescription bundle = model.getBundleDescription();
    String filterSpec = bundle != null ? bundle.getPlatformFilter() : null;
    try
    {
      return (filterSpec == null) || (context.createFilter(filterSpec).match(environment));
    }
    catch (InvalidSyntaxException localInvalidSyntaxException) {}
    return false;
  }
  
  public static boolean usesNewApplicationModel()
  {
    return PluginRegistry.findModel("org.eclipse.equinox.app") != null;
  }
  
  /* Error */
  public static String getIniVMArgs()
  {
    // Byte code:
    //   0: new 385	java/io/File
    //   3: dup
    //   4: invokestatic 716	org/eclipse/core/runtime/Platform:getInstallLocation	()Lorg/eclipse/osgi/service/datalocation/Location;
    //   7: invokeinterface 783 1 0
    //   12: invokevirtual 693	java/net/URL:getFile	()Ljava/lang/String;
    //   15: invokespecial 665	java/io/File:<init>	(Ljava/lang/String;)V
    //   18: astore_0
    //   19: invokestatic 715	org/eclipse/core/runtime/Platform:getOS	()Ljava/lang/String;
    //   22: ldc_w 362
    //   25: invokevirtual 678	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   28: ifeq +15 -> 43
    //   31: new 385	java/io/File
    //   34: dup
    //   35: aload_0
    //   36: ldc_w 357
    //   39: invokespecial 666	java/io/File:<init>	(Ljava/io/File;Ljava/lang/String;)V
    //   42: astore_0
    //   43: new 385	java/io/File
    //   46: dup
    //   47: aload_0
    //   48: ldc_w 360
    //   51: invokespecial 666	java/io/File:<init>	(Ljava/io/File;Ljava/lang/String;)V
    //   54: astore_1
    //   55: aconst_null
    //   56: astore_2
    //   57: new 394	java/lang/StringBuffer
    //   60: dup
    //   61: invokespecial 687	java/lang/StringBuffer:<init>	()V
    //   64: astore_3
    //   65: aload_1
    //   66: invokevirtual 661	java/io/File:exists	()Z
    //   69: ifeq +153 -> 222
    //   72: new 384	java/io/BufferedReader
    //   75: dup
    //   76: new 387	java/io/FileReader
    //   79: dup
    //   80: aload_1
    //   81: invokespecial 670	java/io/FileReader:<init>	(Ljava/io/File;)V
    //   84: invokespecial 658	java/io/BufferedReader:<init>	(Ljava/io/Reader;)V
    //   87: astore_2
    //   88: iconst_0
    //   89: istore 5
    //   91: goto +49 -> 140
    //   94: iload 5
    //   96: ifeq +25 -> 121
    //   99: aload_3
    //   100: invokevirtual 686	java/lang/StringBuffer:length	()I
    //   103: ifle +11 -> 114
    //   106: aload_3
    //   107: ldc_w 342
    //   110: invokevirtual 691	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   113: pop
    //   114: aload_3
    //   115: aload 4
    //   117: invokevirtual 691	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   120: pop
    //   121: iload 5
    //   123: ifne +17 -> 140
    //   126: aload 4
    //   128: ldc_w 343
    //   131: invokevirtual 678	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   134: ifeq +6 -> 140
    //   137: iconst_1
    //   138: istore 5
    //   140: aload_2
    //   141: invokevirtual 659	java/io/BufferedReader:readLine	()Ljava/lang/String;
    //   144: dup
    //   145: astore 4
    //   147: ifnonnull -53 -> 94
    //   150: goto +54 -> 204
    //   153: astore 4
    //   155: aload 4
    //   157: invokestatic 733	org/eclipse/pde/internal/core/PDECore:log	(Ljava/lang/Throwable;)V
    //   160: aload_2
    //   161: ifnull +61 -> 222
    //   164: aload_2
    //   165: invokevirtual 657	java/io/BufferedReader:close	()V
    //   168: goto +54 -> 222
    //   171: astore 7
    //   173: aload 7
    //   175: invokestatic 733	org/eclipse/pde/internal/core/PDECore:log	(Ljava/lang/Throwable;)V
    //   178: goto +44 -> 222
    //   181: astore 6
    //   183: aload_2
    //   184: ifnull +17 -> 201
    //   187: aload_2
    //   188: invokevirtual 657	java/io/BufferedReader:close	()V
    //   191: goto +10 -> 201
    //   194: astore 7
    //   196: aload 7
    //   198: invokestatic 733	org/eclipse/pde/internal/core/PDECore:log	(Ljava/lang/Throwable;)V
    //   201: aload 6
    //   203: athrow
    //   204: aload_2
    //   205: ifnull +17 -> 222
    //   208: aload_2
    //   209: invokevirtual 657	java/io/BufferedReader:close	()V
    //   212: goto +10 -> 222
    //   215: astore 7
    //   217: aload 7
    //   219: invokestatic 733	org/eclipse/pde/internal/core/PDECore:log	(Ljava/lang/Throwable;)V
    //   222: aload_3
    //   223: invokevirtual 688	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   226: areturn
    // Line number table:
    //   Java source line #518	-> byte code offset #0
    //   Java source line #519	-> byte code offset #19
    //   Java source line #520	-> byte code offset #31
    //   Java source line #521	-> byte code offset #43
    //   Java source line #522	-> byte code offset #55
    //   Java source line #523	-> byte code offset #57
    //   Java source line #524	-> byte code offset #65
    //   Java source line #526	-> byte code offset #72
    //   Java source line #528	-> byte code offset #88
    //   Java source line #529	-> byte code offset #91
    //   Java source line #530	-> byte code offset #94
    //   Java source line #531	-> byte code offset #99
    //   Java source line #532	-> byte code offset #106
    //   Java source line #533	-> byte code offset #114
    //   Java source line #536	-> byte code offset #121
    //   Java source line #537	-> byte code offset #137
    //   Java source line #529	-> byte code offset #140
    //   Java source line #539	-> byte code offset #153
    //   Java source line #540	-> byte code offset #155
    //   Java source line #542	-> byte code offset #160
    //   Java source line #544	-> byte code offset #164
    //   Java source line #545	-> byte code offset #171
    //   Java source line #546	-> byte code offset #173
    //   Java source line #541	-> byte code offset #181
    //   Java source line #542	-> byte code offset #183
    //   Java source line #544	-> byte code offset #187
    //   Java source line #545	-> byte code offset #194
    //   Java source line #546	-> byte code offset #196
    //   Java source line #548	-> byte code offset #201
    //   Java source line #542	-> byte code offset #204
    //   Java source line #544	-> byte code offset #208
    //   Java source line #545	-> byte code offset #215
    //   Java source line #546	-> byte code offset #217
    //   Java source line #550	-> byte code offset #222
    // Local variable table:
    //   start	length	slot	name	signature
    //   18	30	0	installDirectory	File
    //   54	27	1	eclipseIniFile	File
    //   56	153	2	in	java.io.BufferedReader
    //   64	159	3	result	StringBuffer
    //   94	33	4	str	String
    //   145	3	4	str	String
    //   153	3	4	e	IOException
    //   89	50	5	vmargs	boolean
    //   181	21	6	localObject	Object
    //   171	3	7	e	IOException
    //   194	3	7	e	IOException
    //   215	3	7	e	IOException
    // Exception table:
    //   from	to	target	type
    //   72	150	153	java/io/IOException
    //   164	168	171	java/io/IOException
    //   72	160	181	finally
    //   187	191	194	java/io/IOException
    //   208	212	215	java/io/IOException
  }
}

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

import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.pde.core.plugin.IPluginModelBase;

public class TargetPlatformResetJob
  extends Job
{
  private PDEState fState;
  
  public TargetPlatformResetJob(PDEState newState)
  {
    super(PDECoreMessages.TargetPlatformResetJob_resetTarget);
    fState = newState;
    setRule(ResourcesPlugin.getWorkspace().getRoot());
  }
  
  protected IStatus run(IProgressMonitor monitor)
  {
    EclipseHomeInitializer.resetEclipseHomeVariable();
    PDECore.getDefault().getSourceLocationManager().reset();
    PDECore.getDefault().getJavadocLocationManager().reset();
    IPluginModelBase[] models = fState.getTargetModels();
    removeDisabledBundles(models);
    PluginModelManager manager = PDECore.getDefault().getModelManager();
    manager.getExternalModelManager().setModels(models);
    
    PDECore.getDefault().getExtensionsRegistry().targetReloaded();
    manager.resetState(fState);
    PDECore.getDefault().getFeatureModelManager().targetReloaded();
    monitor.done();
    return Status.OK_STATUS;
  }
  
  private void removeDisabledBundles(IPluginModelBase[] models)
  {
    int number = models.length;
    for (int i = 0; i < models.length; i++) {
      if (!models[i].isEnabled())
      {
        fState.removeBundleDescription(models[i].getBundleDescription());
        number--;
      }
    }
    if (number < models.length) {
      fState.resolveState(true);
    }
  }
}

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

import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.IPreferenceNodeVisitor;
import org.osgi.service.prefs.BackingStoreException;

class TargetPreferenceModifyListener$Visitor
  implements IPreferenceNodeVisitor
{
  final TargetPreferenceModifyListener this$0;
  
  TargetPreferenceModifyListener$Visitor(TargetPreferenceModifyListener paramTargetPreferenceModifyListener)
  {
    this$0 = paramTargetPreferenceModifyListener;
  }
  
  public boolean visit(IEclipsePreferences node)
    throws BackingStoreException
  {
    if (node.name().equals("org.eclipse.pde.core"))
    {
      node.remove("additional_locations");
      node.remove("org.eclipse.pde.ui.arch");
      node.remove("checkedPlugins");
      node.remove("checkedVersionPlugins");
      node.remove("implicit_dependencies");
      node.remove("org.eclipse.pde.ui.nl");
      node.remove("platform_path");
      node.remove("pooled_bundles");
      node.remove("pooled_urls");
      node.remove("program_args");
      node.remove("org.eclipse.pde.ui.os");
      for (int i = 0; i < 4; i++)
      {
        StringBuffer key = new StringBuffer();
        key.append("saved_platform");
        key.append(i);
        node.remove(key.toString());
      }
      node.remove("target_mode");
      node.remove("target_platform_realization");
      node.remove("target.profile");
      node.remove("vm_args");
      node.remove("workspace_target_handle");
      node.remove("org.eclipse.pde.ui.ws");
      return false;
    }
    return true;
  }
}

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

import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.IPreferenceNodeVisitor;
import org.eclipse.core.runtime.preferences.PreferenceModifyListener;
import org.osgi.service.prefs.BackingStoreException;

public class TargetPreferenceModifyListener
  extends PreferenceModifyListener
{
  class Visitor
    implements IPreferenceNodeVisitor
  {
    Visitor() {}
    
    public boolean visit(IEclipsePreferences node)
      throws BackingStoreException
    {
      if (node.name().equals("org.eclipse.pde.core"))
      {
        node.remove("additional_locations");
        node.remove("org.eclipse.pde.ui.arch");
        node.remove("checkedPlugins");
        node.remove("checkedVersionPlugins");
        node.remove("implicit_dependencies");
        node.remove("org.eclipse.pde.ui.nl");
        node.remove("platform_path");
        node.remove("pooled_bundles");
        node.remove("pooled_urls");
        node.remove("program_args");
        node.remove("org.eclipse.pde.ui.os");
        for (int i = 0; i < 4; i++)
        {
          StringBuffer key = new StringBuffer();
          key.append("saved_platform");
          key.append(i);
          node.remove(key.toString());
        }
        node.remove("target_mode");
        node.remove("target_platform_realization");
        node.remove("target.profile");
        node.remove("vm_args");
        node.remove("workspace_target_handle");
        node.remove("org.eclipse.pde.ui.ws");
        return false;
      }
      return true;
    }
  }
  
  public IEclipsePreferences preApply(IEclipsePreferences node)
  {
    try
    {
      node.accept(new Visitor());
    }
    catch (BackingStoreException e)
    {
      PDECore.log(e);
    }
    return node;
  }
}

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

import java.io.File;
import java.util.Dictionary;
import java.util.Iterator;
import java.util.Map.Entry;
import java.util.Properties;
import java.util.Set;
import org.eclipse.core.runtime.Platform;
import org.eclipse.osgi.service.resolver.BundleDescription;
import org.eclipse.pde.core.plugin.IPluginModelBase;

public class TargetWeaver
{
  private static boolean fgIsDev = false;
  private static String fgDevPropertiesURL = null;
  private static Properties fgDevProperties = null;
  
  static
  {
    fgIsDev = Platform.inDevelopmentMode();
    if (fgIsDev) {
      fgDevPropertiesURL = System.getProperty("osgi.dev");
    }
  }
  
  /* Error */
  protected static Properties getDevProperties()
  {
    // Byte code:
    //   0: getstatic 168	org/eclipse/pde/internal/core/TargetWeaver:fgIsDev	Z
    //   3: ifeq +173 -> 176
    //   6: getstatic 170	org/eclipse/pde/internal/core/TargetWeaver:fgDevProperties	Ljava/util/Properties;
    //   9: ifnonnull +163 -> 172
    //   12: new 97	java/util/Properties
    //   15: dup
    //   16: invokespecial 186	java/util/Properties:<init>	()V
    //   19: putstatic 170	org/eclipse/pde/internal/core/TargetWeaver:fgDevProperties	Ljava/util/Properties;
    //   22: getstatic 169	org/eclipse/pde/internal/core/TargetWeaver:fgDevPropertiesURL	Ljava/lang/String;
    //   25: ifnull +147 -> 172
    //   28: new 92	java/net/URL
    //   31: dup
    //   32: getstatic 169	org/eclipse/pde/internal/core/TargetWeaver:fgDevPropertiesURL	Ljava/lang/String;
    //   35: invokespecial 183	java/net/URL:<init>	(Ljava/lang/String;)V
    //   38: astore_0
    //   39: aload_0
    //   40: invokevirtual 182	java/net/URL:getFile	()Ljava/lang/String;
    //   43: astore_1
    //   44: aload_1
    //   45: ifnull +127 -> 172
    //   48: aload_1
    //   49: invokevirtual 178	java/lang/String:length	()I
    //   52: ifle +120 -> 172
    //   55: new 84	java/io/File
    //   58: dup
    //   59: aload_1
    //   60: invokespecial 175	java/io/File:<init>	(Ljava/lang/String;)V
    //   63: astore_2
    //   64: aload_2
    //   65: invokevirtual 173	java/io/File:exists	()Z
    //   68: ifeq +104 -> 172
    //   71: aconst_null
    //   72: astore_3
    //   73: new 83	java/io/BufferedInputStream
    //   76: dup
    //   77: new 85	java/io/FileInputStream
    //   80: dup
    //   81: aload_2
    //   82: invokespecial 176	java/io/FileInputStream:<init>	(Ljava/io/File;)V
    //   85: invokespecial 172	java/io/BufferedInputStream:<init>	(Ljava/io/InputStream;)V
    //   88: astore_3
    //   89: getstatic 170	org/eclipse/pde/internal/core/TargetWeaver:fgDevProperties	Ljava/util/Properties;
    //   92: aload_3
    //   93: invokevirtual 187	java/util/Properties:load	(Ljava/io/InputStream;)V
    //   96: goto +52 -> 148
    //   99: astore 4
    //   101: aload 4
    //   103: invokestatic 192	org/eclipse/pde/internal/core/PDECore:log	(Ljava/lang/Throwable;)V
    //   106: aload_3
    //   107: ifnull +65 -> 172
    //   110: aload_3
    //   111: invokevirtual 171	java/io/BufferedInputStream:close	()V
    //   114: goto +58 -> 172
    //   117: astore 4
    //   119: aload 4
    //   121: invokestatic 192	org/eclipse/pde/internal/core/PDECore:log	(Ljava/lang/Throwable;)V
    //   124: aload_3
    //   125: ifnull +47 -> 172
    //   128: aload_3
    //   129: invokevirtual 171	java/io/BufferedInputStream:cl
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

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