org.eclipse.osgi_3.8.2.v20130124-134944

compatibilityFound))
            {
              requires.add(i + 1, new PluginParser.Prerequisite(PluginParser.this, "org.eclipse.core.runtime.compatibility", null, false, analyzed.isExported(), null));
            }
          }
          if (!requires.contains(new PluginParser.Prerequisite(PluginParser.this, "org.eclipse.core.runtime.compatibility", null, false, false, null))) {
            requires.add(new PluginParser.Prerequisite(PluginParser.this, "org.eclipse.core.runtime.compatibility", null, false, false, null));
          }
          PluginParser.Prerequisite runtimePrereq = new PluginParser.Prerequisite(PluginParser.this, "org.eclipse.core.runtime", null, false, false, null);
          requires.remove(runtimePrereq);
          requires.add(new PluginParser.Prerequisite(PluginParser.this, "org.eclipse.core.runtime", "2.1", false, false, "greaterOrEqual"));
        }
      }
      if (requires == null) {
        return requires = new ArrayList(0);
      }
      return requires;
    }
    
    public String getMasterId()
    {
      return masterPluginId;
    }
    
    public String getMasterVersion()
    {
      return masterVersion;
    }
    
    public String getMasterMatch()
    {
      return masterMatch;
    }
    
    public String getPluginClass()
    {
      return pluginClass;
    }
    
    public String getUniqueId()
    {
      return pluginId;
    }
    
    public String getVersion()
    {
      return version;
    }
    
    public Set<String> getPackageFilters()
    {
      return filters;
    }
    
    public String[] getLibrariesName()
    {
      if (libraryPaths == null) {
        return new String[0];
      }
      return (String[])libraryPaths.toArray(new String[libraryPaths.size()]);
    }
    
    public String getPluginName()
    {
      return pluginName;
    }
    
    public String getProviderName()
    {
      return vendor;
    }
    
    public boolean isSingleton()
    {
      return singleton;
    }
    
    public boolean hasExtensionExtensionPoints()
    {
      return hasExtensionExtensionPoints;
    }
    
    public String getRoot()
    {
      return isFragment() ? "fragment" : "plugin";
    }
    
    public String validateForm()
    {
      if (pluginId == null) {
        return NLS.bind(EclipseAdaptorMsg.ECLIPSE_CONVERTER_MISSING_ATTRIBUTE, new String[] { getRoot(), "id", getRoot() });
      }
      if (pluginName == null) {
        return NLS.bind(EclipseAdaptorMsg.ECLIPSE_CONVERTER_MISSING_ATTRIBUTE, new String[] { getRoot(), "name", getRoot() });
      }
      if (version == null) {
        return NLS.bind(EclipseAdaptorMsg.ECLIPSE_CONVERTER_MISSING_ATTRIBUTE, new String[] { getRoot(), "version", getRoot() });
      }
      if ((isFragment()) && (masterPluginId == null)) {
        return NLS.bind(EclipseAdaptorMsg.ECLIPSE_CONVERTER_MISSING_ATTRIBUTE, new String[] { getRoot(), "plugin-id", getRoot() });
      }
      if ((isFragment()) && (masterVersion == null)) {
        return NLS.bind(EclipseAdaptorMsg.ECLIPSE_CONVERTER_MISSING_ATTRIBUTE, new String[] { getRoot(), "plugin-version", getRoot() });
      }
      return null;
    }
  }
  
  Stack<Integer> stateStack = new Stack();
  Stack<Object> objectStack = new Stack();
  Locator locator = null;
  private static final int IGNORED_ELEMENT_STATE = 0;
  private static final int INITIAL_STATE = 1;
  private static final int PLUGIN_STATE = 2;
  private static final int PLUGIN_RUNTIME_STATE = 3;
  private static final int PLUGIN_REQUIRES_STATE = 4;
  private static final int PLUGIN_EXTENSION_POINT_STATE = 5;
  private static final int PLUGIN_EXTENSION_STATE = 6;
  private static final int RUNTIME_LIBRARY_STATE = 7;
  private static final int LIBRARY_EXPORT_STATE = 8;
  private static final int PLUGIN_REQUIRES_IMPORT_STATE = 9;
  private static final int FRAGMENT_STATE = 11;
  
  public PluginParser(FrameworkAdaptor adaptor, BundleContext context, Version target)
  {
    this.context = context;
    this.adaptor = adaptor;
    this.target = target;
  }
  
  public void setDocumentLocator(Locator locator)
  {
    this.locator = locator;
  }
  
  public void endDocument() {}
  
  public void endElement(String uri, String elementName, String qName)
  {
    switch (((Integer)stateStack.peek()).intValue())
    {
    case 0: 
      stateStack.pop();
      break;
    case 1: 
      break;
    case 2: 
    case 11: 
      break;
    case 3: 
      if (elementName.equals("runtime")) {
        stateStack.pop();
      }
      break;
    case 4: 
      if (elementName.equals("requires"))
      {
        stateStack.pop();
        objectStack.pop();
      }
      break;
    case 5: 
      if (elementName.equals("extension-point")) {
        stateStack.pop();
      }
      break;
    case 6: 
      if (elementName.equals("extension")) {
        stateStack.pop();
      }
      break;
    case 7: 
      if (elementName.equals("library"))
      {
        String curLibrary = (String)objectStack.pop();
        if (!curLibrary.trim().equals(""))
        {
          List<String> exports = (List)objectStack.pop();
          if (manifestInfo.libraries == null)
          {
            manifestInfo.libraries = new HashMap(3);
            manifestInfo.libraryPaths = new ArrayList(3);
          }
          manifestInfo.libraries.put(curLibrary, exports);
          manifestInfo.libraryPaths.add(curLibrary.replace('\\', '/'));
        }
        stateStack.pop();
      }
      break;
    case 8: 
      if (elementName.equals("export")) {
        stateStack.pop();
      }
      break;
    case 9: 
      if (elementName.equals("import")) {
        stateStack.pop();
      }
      break;
    }
  }
  
  public void error(SAXParseException ex)
  {
    logStatus(ex);
  }
  
  public void fatalError(SAXParseException ex)
    throws SAXException
  {
    logStatus(ex);
    throw ex;
  }
  
  public void handleExtensionPointState(String elementName, Attributes attributes)
  {
    stateStack.push(new Integer(0));
    manifestInfo.hasExtensionExtensionPoints = true;
  }
  
  public void handleExtensionState(String elementName, Attributes attributes)
  {
    stateStack.push(new Integer(0));
    manifestInfo.hasExtensionExtensionPoints = true;
  }
  
  public void handleInitialState(String elementName, Attributes attributes)
  {
    if (elementName.equals("plugin"))
    {
      stateStack.push(new Integer(2));
      parsePluginAttributes(attributes);
    }
    else if (elementName.equals("fragment"))
    {
      manifestInfo.fragment = true;
      stateStack.push(new Integer(11));
      parseFragmentAttributes(attributes);
    }
    else
    {
      stateStack.push(new Integer(0));
      internalError(elementName);
    }
  }
  
  public void handleLibraryExportState(String elementName, Attributes attributes)
  {
    stateStack.push(new Integer(0));
  }
  
  public void handleLibraryState(String elementName, Attributes attributes)
  {
    if (elementName.equals("export"))
    {
      stateStack.push(new Integer(8));
      
      String currentLib = (String)objectStack.peek();
      if (attributes == null) {
        return;
      }
      String maskValue = attributes.getValue("", "name");
      
      objectStack.pop();
      
      List<String> exportMask = (List)objectStack.peek();
      
      objectStack.push(currentLib);
      if (maskValue != null)
      {
        StringTokenizer tok = new StringTokenizer(maskValue, ",");
        while (tok.hasMoreTokens())
        {
          String value = tok.nextToken();
          if (!exportMask.contains(maskValue)) {
            exportMask.add(value.trim());
          }
        }
      }
      return;
    }
    if (elementName.equals("packages"))
    {
      stateStack.push(new Integer(0));
      return;
    }
    stateStack.push(new Integer(0));
    internalError(elementName);
  }
  
  public void handlePluginState(String elementName, Attributes attributes)
  {
    if (elementName.equals("runtime"))
    {
      Object whatIsIt = objectStack.peek();
      if (((whatIsIt instanceof PluginInfo)) && (objectStack.peek()).libraries != null))
      {
        stateStack.push(new Integer(0));
        return;
      }
      stateStack.push(new Integer(3));
      
      return;
    }
    if (elementName.equals("requires"))
    {
      stateStack.push(new Integer(4));
      
      objectStack.push(new ArrayList());
      parseRequiresAttributes(attributes);
      return;
    }
    if (elementName.equals("extension-point"))
    {
      manifestInfo.singleton = true;
      stateStack.push(new Integer(5));
      return;
    }
    if (elementName.equals("extension"))
    {
      manifestInfo.singleton = true;
      stateStack.push(new Integer(6));
      return;
    }
    stateStack.push(new Integer(0));
    internalError(elementName);
  }
  
  public void handleRequiresImportState(String elementName, Attributes attributes)
  {
    stateStack.push(new Integer(0));
  }
  
  public void handleRequiresState(String elementName, Attributes attributes)
  {
    if (elementName.equals("import"))
    {
      parsePluginRequiresImport(attributes);
      return;
    }
    stateStack.push(new Integer(0));
    internalError(elementName);
  }
  
  public void handleRuntimeState(String elementName, Attributes attributes)
  {
    if (elementName.equals("library"))
    {
      stateStack.push(new Integer(7));
      
      parseLibraryAttributes(attributes);
      return;
    }
    stateStack.push(new Integer(0));
    internalError(elementName);
  }
  
  private void logStatus(SAXParseException ex)
  {
    String name = ex.getSystemId();
    if (name == null) {
      name = "";
    } else {
      name = name.substring(1 + name.lastIndexOf("/"));
    }
    String msg;
    String msg;
    if (name.equals("")) {
      msg = NLS.bind(EclipseAdaptorMsg.parse_error, ex.getMessage());
    } else {
      msg = NLS.bind(EclipseAdaptorMsg.parse_errorNameLineColumn, new String[] { name, Integer.toString(ex.getLineNumber()), Integer.toString(ex.getColumnNumber()), ex.getMessage() });
    }
    FrameworkLogEntry entry = new FrameworkLogEntry("org.eclipse.osgi", 4, 0, msg, 0, ex, null);
    adaptor.getFrameworkLog().log(entry);
  }
  
  public synchronized PluginInfo parsePlugin(InputStream in)
    throws Exception
  {
    SAXParserFactory factory = acquireXMLParsing(context);
    if (factory == null)
    {
      FrameworkLogEntry entry = new FrameworkLogEntry("org.eclipse.osgi", 4, 0, EclipseAdaptorMsg.ECLIPSE_CONVERTER_NO_SAX_FACTORY, 0, null, null);
      adaptor.getFrameworkLog().log(entry);
      return null;
    }
    factory.setNamespaceAware(true);
    factory.setNamespaceAware(true);
    try
    {
      factory.setFeature("http://xml.org/sax/features/string-interning", true);
    }
    catch (SAXException localSAXException) {}
    factory.setValidating(false);
    factory.newSAXParser().parse(in, this);
    return manifestInfo;
  }
  
  public static SAXParserFactory acquireXMLParsing(BundleContext context)
  {
    if (xmlTracker == null)
    {
      xmlTracker = new ServiceTracker(context, "javax.xml.parsers.SAXParserFactory", null);
      xmlTracker.open();
    }
    SAXParserFactory result = (SAXParserFactory)xmlTracker.getService();
    if (result != null) {
      return result;
    }
    return SAXParserFactory.newInstance();
  }
  
  public static void releaseXMLParsing()
  {
    if (xmlTracker != null) {
      xmlTracker.close();
    }
  }
  
  public void parseFragmentAttributes(Attributes attributes)
  {
    objectStack.push(manifestInfo);
    int len = attributes.getLength();
    for (int i = 0; i < len; i++)
    {
      String attrName = attributes.getLocalName(i);
      String attrValue = attributes.getValue(i).trim();
      if (attrName.equals("id")) {
        manifestInfo.pluginId = attrValue;
      } else if (attrName.equals("name")) {
        manifestInfo.pluginName = attrValue;
      } else if (attrName.equals("version")) {
        manifestInfo.version = attrValue;
      } else if (attrName.equals("provider-name")) {
        manifestInfo.vendor = attrValue;
      } else if (attrName.equals("plugin-id")) {
        manifestInfo.masterPluginId = attrValue;
      } else if (attrName.equals("plugin-version")) {
        manifestInfo.masterVersion = attrValue;
      } else if (attrName.equals("match")) {
        manifestInfo.masterMatch = attrValue;
      }
    }
  }
  
  public void parseLibraryAttributes(Attributes attributes)
  {
    objectStack.push(new ArrayList());
    String current = attributes.getValue("", "name");
    objectStack.push(current);
  }
  
  public void parsePluginAttributes(Attributes attributes)
  {
    objectStack.push(manifestInfo);
    int len = attributes.getLength();
    for (int i = 0; i < len; i++)
    {
      String attrName = attributes.getLocalName(i);
      String attrValue = attributes.getValue(i).trim();
      if (attrName.equals("id")) {
        manifestInfo.pluginId = attrValue;
      } else if (attrName.equals("name")) {
        manifestInfo.pluginName = attrValue;
      } else if (attrName.equals("version")) {
        manifestInfo.version = attrValue;
      } else if ((attrName.equals("vendor-name")) || (attrName.equals("provider-name"))) {
        manifestInfo.vendor = attrValue;
      } else if (attrName.equals("class")) {
        manifestInfo.pluginClass = attrValue;
      }
    }
  }
  
  public class Prerequisite
  {
    String name;
    String version;
    boolean optional;
    boolean export;
    String match;
    
    public boolean isExported()
    {
      return export;
    }
    
    public String getMatch()
    {
      return match;
    }
    
    public String getName()
    {
      return name;
    }
    
    public boolean isOptional()
    {
      return optional;
    }
    
    public String getVersion()
    {
      return version;
    }
    
    public Prerequisite(String preqName, String prereqVersion, boolean isOtional, boolean isExported, String prereqMatch)
    {
      name = preqName;
      version = prereqVersion;
      optional = isOtional;
      export = isExported;
      match = prereqMatch;
    }
    
    public String toString()
    {
      return name;
    }
    
    public boolean equals(Object prereq)
    {
      if (!(prereq instanceof Prerequisite)) {
        return false;
      }
      return name.equals(name);
    }
    
    public int hashCode()
    {
      return name.hashCode();
    }
  }
  
  public void parsePluginRequiresImport(Attributes attributes)
  {
    if (manifestInfo.requires == null) {
      manifestInfo.requires = new ArrayList();
    }
    String plugin = attributes.getValue("", "plugin");
    if (plugin == null) {
      return;
    }
    if (plugin.equals("org.eclipse.core.boot")) {
      return;
    }
    if (plugin.equals("org.eclipse.core.runtime.compatibility")) {
      manifestInfo.compatibilityFound = true;
    }
    String version = attributes.getValue("", "version");
    String optional = attributes.getValue("", "optional");
    String export = attributes.getValue("", "export");
    String match = attributes.getValue("", "match");
    manifestInfo.requires.add(new Prerequisite(plugin, version, "true".equalsIgnoreCase(optional), "true".equalsIgnoreCase(export), match));
  }
  
  public void parseRequiresAttributes(Attributes attributes) {}
  
  static String replace(String s, String from, String to)
  {
    String str = s;
    int fromLen = from.length();
    int toLen = to.length();
    int ix = str.indexOf(from);
    while (ix != -1)
    {
      str = str.substring(0, ix) + to + str.substring(ix + fromLen);
      ix = str.indexOf(from, ix + toLen);
    }
    return str;
  }
  
  public void startDocument()
  {
    stateStack.push(new Integer(1));
  }
  
  public void startElement(String uri, String elementName, String qName, Attributes attributes)
  {
    switch (((Integer)stateStack.peek()).intValue())
    {
    case 1: 
      handleInitialState(elementName, attributes);
      break;
    case 2: 
    case 11: 
      handlePluginState(elementName, attributes);
      break;
    case 3: 
      handleRuntimeState(elementName, attributes);
      break;
    case 4: 
      handleRequiresState(elementName, attributes);
      break;
    case 5: 
      handleExtensionPointState(elementName, attributes);
      break;
    case 6: 
      handleExtensionState(elementName, attributes);
      break;
    case 7: 
      handleLibraryState(elementName, attributes);
      break;
    case 8: 
      handleLibraryExportState(elementName, attributes);
      break;
    case 9: 
      handleRequiresImportState(elementName, attributes);
      break;
    case 10: 
    default: 
      stateStack.push(new Integer(0));
    }
  }
  
  public void warning(SAXParseException ex)
  {
    logStatus(ex);
  }
  
  private void internalError(String elementName)
  {
    String message = NLS.bind(EclipseAdaptorMsg.ECLIPSE_CONVERTER_PARSE_UNKNOWNTOP_ELEMENT, elementName);
    FrameworkLogEntry error = new FrameworkLogEntry("org.eclipse.osgi", 4, 0, "Plug-in : " + manifestInfo.pluginId + ", " + message, 0, null, null);
    adaptor.getFrameworkLog().log(error);
  }
  
  public void processingInstruction(String instructionTarget, String data)
    throws SAXException
  {
    if (instructionTarget.equalsIgnoreCase("eclipse"))
    {
      manifestInfo.schemaVersion = "3.0";
      StringTokenizer tokenizer = new StringTokenizer(data, "=\"");
      while (tokenizer.hasMoreTokens())
      {
        String token = tokenizer.nextToken();
        if (token.equalsIgnoreCase("version"))
        {
          if (!tokenizer.hasMoreTokens()) {
            break;
          }
          manifestInfo.schemaVersion = tokenizer.nextToken();
          break;
        }
      }
    }
  }
}

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

public class Semaphore
{
  protected long notifications;
  
  public Semaphore(int count)
  {
    notifications = count;
  }
  
  public synchronized void acquire()
  {
    for (;;)
    {
      if (notifications > 0L)
      {
        notifications -= 1L;
        return;
      }
      try
      {
        wait();
      }
      catch (InterruptedException localInterruptedException) {}
    }
  }
  
  public synchronized boolean acquire(long delay)
  {
    long start = System.currentTimeMillis();
    long timeLeft = delay;
    for (;;)
    {
      if (notifications > 0L)
      {
        notifications -= 1L;
        return true;
      }
      if (timeLeft <= 0L) {
        return false;
      }
      try
      {
        wait(timeLeft);
      }
      catch (InterruptedException localInterruptedException) {}
      timeLeft = start + delay - System.currentTimeMillis();
    }
  }
  
  public synchronized void release()
  {
    notifications += 1L;
    notifyAll();
  }
  
  public String toString()
  {
    return "Semaphore(" + notifications + ")";
  }
}

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

import java.io.IOException;
import java.net.URL;
import java.net.URLConnection;
import org.eclipse.osgi.framework.internal.core.BundleURLConnection;
import org.eclipse.osgi.service.urlconversion.URLConverter;
import org.eclipse.osgi.util.NLS;

public class URLConverterImpl
  implements URLConverter
{
  public URL toFileURL(URL url)
    throws IOException
  {
    URLConnection connection = url.openConnection();
    if ((connection instanceof BundleURLConnection))
    {
      URL result = ((BundleURLConnection)connection).getFileURL();
      if (result == null) {
        throw new IOException(NLS.bind(EclipseAdaptorMsg.ECLIPSE_PLUGIN_EXTRACTION_PROBLEM, url));
      }
      return result;
    }
    return url;
  }
  
  public URL resolve(URL url)
    throws IOException
  {
    URLConnection connection = url.openConnection();
    if ((connection instanceof BundleURLConnection)) {
      return ((BundleURLConnection)connection).getLocalURL();
    }
    return url;
  }
}

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

import java.util.ArrayList;
import java.util.List;

public class BundleStats
{
  public String symbolicName;
  public long id;
  public int activationOrder;
  private long timestamp;
  private boolean duringStartup;
  private long startupTime;
  private long startupMethodTime;
  private long traceStart = -1L;
  private long traceEnd = -1L;
  private List<BundleStats> bundlesActivated = new ArrayList(3);
  private BundleStats activatedBy = null;
  
  public BundleStats(String name, long id)
  {
    symbolicName = name;
    this.id = id;
  }
  
  public long getTimestamp()
  {
    return timestamp;
  }
  
  public int getActivationOrder()
  {
    return activationOrder;
  }
  
  protected void activated(BundleStats info)
  {
    bundlesActivated.add(info);
  }
  
  public BundleStats getActivatedBy()
  {
    return activatedBy;
  }
  
  public long getId()
  {
    return id;
  }
  
  public String getSymbolicName()
  {
    return symbolicName;
  }
  
  public long getStartupTime()
  {
    return startupTime;
  }
  
  public long getStartupMethodTime()
  {
    return startupMethodTime;
  }
  
  public boolean isStartupBundle()
  {
    return duringStartup;
  }
  
  public int getClassLoadCount()
  {
    if (!StatsManager.MONITOR_CLASSES) {
      return 0;
    }
    ClassloaderStats loader = ClassloaderStats.getLoader(symbolicName);
    return loader == null ? 0 : loader.getClassLoadCount();
  }
  
  public long getClassLoadTime()
  {
    if (!StatsManager.MONITOR_CLASSES) {
      return 0L;
    }
    ClassloaderStats loader = ClassloaderStats.getLoader(symbolicName);
    return loader == null ? 0L : loader.getClassLoadTime();
  }
  
  public List<BundleStats> getBundlesActivated()
  {
    return bundlesActivated;
  }
  
  public long getTraceStart()
  {
    return traceStart;
  }
  
  public long getTraceEnd()
  {
    return traceEnd;
  }
  
  protected void setTimestamp(long value)
  {
    timestamp = value;
  }
  
  protected void setActivationOrder(int value)
  {
    activationOrder = value;
  }
  
  protected void setTraceStart(long time)
  {
    traceStart = time;
  }
  
  protected void setDuringStartup(boolean value)
  {
    duringStartup = value;
  }
  
  protected void endActivation()
  {
    startupTime = (System.currentTimeMillis() - timestamp);
  }
  
  protected void setTraceEnd(long position)
  {
    traceEnd = position;
  }
  
  protected void setActivatedBy(BundleStats value)
  {
    activatedBy = value;
  }
}

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

import java.util.ArrayList;
import java.util.List;

public class ClassStats
{
  private String className;
  private ClassloaderStats classloader;
  private int loadOrder = -1;
  private long timestamp;
  private long timeLoading;
  private long timeLoadingOthers = 0L;
  private ClassStats loadedBy = null;
  private List<ClassStats> loaded = new ArrayList(2);
  private boolean duringStartup;
  private long traceStart = -1L;
  private long traceEnd = -1L;
  
  public ClassStats(String name, ClassloaderStats classloader)
  {
    className = name;
    timestamp = System.currentTimeMillis();
    duringStartup = StatsManager.isBooting();
    this.classloader = classloader;
  }
  
  public void setLoadOrder(int order)
  {
    loadOrder = order;
  }
  
  public void loadingDone()
  {
    timeLoading = (System.currentTimeMillis() - timestamp);
  }
  
  public long getTimeLoading()
  {
    return timeLoading;
  }
  
  public long getLocalTimeLoading()
  {
    return timeLoading - timeLoadingOthers;
  }
  
  public void addTimeLoadingOthers(long time)
  {
    timeLoadingOthers += time;
  }
  
  public long getTraceStart()
  {
    return traceStart;
  }
  
  public long getTraceEnd()
  {
    return traceEnd;
  }
  
  public void setTraceStart(long position)
  {
    traceStart = position;
  }
  
  public void setTraceEnd(long position)
  {
    traceEnd = position;
  }
  
  public void loaded(ClassStats child)
  {
    loaded.add(child);
  }
  
  public void setLoadedBy(ClassStats parent)
  {
    loadedBy = parent;
  }
  
  public ClassStats getLoadedBy()
  {
    return loadedBy;
  }
  
  public List<ClassStats> getLoadedClasses()
  {
    return loaded;
  }
  
  public String getClassName()
  {
    return className;
  }
  
  public boolean isStartupClass()
  {
    return duringStartup;
  }
  
  public ClassloaderStats getClassloader()
  {
    return classloader;
  }
  
  public int getLoadOrder()
  {
    return loadOrder;
  }
  
  public long getTimestamp()
  {
    return timestamp;
  }
  
  public void toBaseClass()
  {
    duringStartup = true;
    loadOrder = -2;
  }
}

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

import java.util.Properties;

class ClassloaderStats$1
  extends Properties
{
  private static final long serialVersionUID = 3546359543853365296L;
  
  public synchronized Object put(Object key, Object value)
  {
    ClassloaderStats.addFilters((String)key, (String)value);
    return null;
  }
}

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

import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.Stack;

public class ClassloaderStats
{
  private String id;
  private long loadingTime;
  private Map<String, ClassStats> classes = Collections.synchronizedMap(new HashMap(20));
  private List<ResourceBundleStats> bundles = new ArrayList(2);
  private boolean keepTraces = false;
  private static List<String> packageFilters = new ArrayList(4);
  private static Set<String> pluginFilters = new HashSet(5);
  private static Hashtable<Thread, Stack<ClassStats>> classStacks = new Hashtable();
  private static Map<String, ClassloaderStats> loaders = Collections.synchronizedMap(new HashMap(20));
  public static File traceFile;
  
  static
  {
    if ((StatsManager.TRACE_CLASSES) || (StatsManager.TRACE_BUNDLES)) {
      initializeTraceOptions();
    }
  }
  
  /* Error */
  private static void initializeTraceOptions()
  {
    // Byte code:
    //   0: getstatic 334	org/eclipse/core/runtime/internal/stats/StatsManager:TRACE_FILENAME	Ljava/lang/String;
    //   3: astore_0
    //   4: new 161	java/io/File
    //   7: dup
    //   8: aload_0
    //   9: invokespecial 339	java/io/File:<init>	(Ljava/lang/String;)V
    //   12: putstatic 324	org/eclipse/core/runtime/internal/stats/ClassloaderStats:traceFile	Ljava/io/File;
    //   15: getstatic 324	org/eclipse/core/runtime/internal/stats/ClassloaderStats:traceFile	Ljava/io/File;
    //   18: invokevirtual 337	java/io/File:delete	()Z
    //   21: pop
    //   22: getstatic 333	org/eclipse/core/runtime/internal/stats/StatsManager:TRACE_CLASSES	Z
    //   25: ifne +4 -> 29
    //   28: return
    //   29: getstatic 335	org/eclipse/core/runtime/internal/stats/StatsManager:TRACE_FILTERS	Ljava/lang/String;
    //   32: astore_0
    //   33: aload_0
    //   34: ifnull +10 -> 44
    //   37: aload_0
    //   38: invokevirtual 350	java/lang/String:length	()I
    //   41: ifne +4 -> 45
    //   44: return
    //   45: new 161	java/io/File
    //   48: dup
    //   49: aload_0
    //   50: invokespecial 339	java/io/File:<init>	(Ljava/lang/String;)V
    //   53: astore_1
    //   54: getstatic 321	java/lang/System:out	Ljava/io/PrintStream;
    //   57: new 171	java/lang/StringBuffer
    //   60: dup
    //   61: ldc 4
    //   63: invokespecial 354	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   66: aload_1
    //   67: invokevirtual 338	java/io/File:getAbsolutePath	()Ljava/lang/String;
    //   70: invokevirtual 355	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   73: ldc 3
    //   75: invokevirtual 355	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   78: invokevirtual 353	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   81: invokevirtual 344	java/io/PrintStream:print	(Ljava/lang/String;)V
    //   84: new 162	java/io/FileInputStream
    //   87: dup
    //   88: aload_1
    //   89: invokespecial 340	java/io/FileInputStream:<init>	(Ljava/io/File;)V
    //   92: astore_2
    //   93: getstatic 321	java/lang/System:out	Ljava/io/PrintStream;
    //   96: ldc 1
    //   98: invokevirtual 345	java/io/PrintStream:println	(Ljava/lang/String;)V
    //   101: new 189	org/eclipse/core/runtime/internal/stats/ClassloaderStats$1
    //   104: dup
    //   105: invokespecial 395	org/eclipse/core/runtime/internal/stats/ClassloaderStats$1:<init>	()V
    //   108: astore_3
    //   109: aload_3
    //   110: aload_2
    //   111: invokevirtual 367	java/util/Properties:load	(Ljava/io/InputStream;)V
    //   114: goto +12 -> 126
    //   117: astore 4
    //   119: aload_2
    //   120: invokevirtual 343	java/io/InputStream:close	()V
    //   123: aload 4
    //   125: athrow
    //   126: aload_2
    //   127: invokevirtual 343	java/io/InputStream:close	()V
    //   130: goto +12 -> 142
    //   133: pop
    //   134: getstatic 321	java/lang/System:out	Ljava/io/PrintStream;
    //   137: ldc 2
    //   139: invokevirtual 345	java/io/PrintStream:println	(Ljava/lang/String;)V
    //   142: return
    // Line number table:
    //   Java source line #49	-> byte code offset #0
    //   Java source line #50	-> byte code offset #4
    //   Java source line #51	-> byte code offset #15
    //   Java source line #54	-> byte code offset #22
    //   Java source line #55	-> byte code offset #28
    //   Java source line #56	-> byte code offset #29
    //   Java source line #57	-> byte code offset #33
    //   Java source line #58	-> byte code offset #44
    //   Java source line #60	-> byte code offset #45
    //   Java source line #61	-> byte code offset #54
    //   Java source line #62	-> byte code offset #84
    //   Java source line #63	-> byte code offset #93
    //   Java source line #64	-> byte code offset #101
    //   Java source line #73	-> byte code offset #109
    //   Java source line #74	-> byte code offset #114
    //   Java source line #75	-> byte code offset #119
    //   Java source line #76	-> byte code offset #123
    //   Java source line #75	-> byte code offset #126
    //   Java source line #77	-> byte code offset #130
    //   Java source line #78	-> byte code offset #134
    //   Java source line #80	-> byte code offset #142
    // Local variable table:
    //   start	length	slot	name	signature
    //   3	47	0	filename	String
    //   53	36	1	filterFile	File
    //   92	35	2	input	java.io.InputStream
    //   108	2	3	filters	Properties
    //   117	7	4	localObject	Object
    //   133	1	5	localIOException	java.io.IOException
    // Exception table:
    //   from	to	target	type
    //   109	117	117	finally
    //   45	130	133	java/io/IOException
  }
  
  protected static void addFilters(String key, String value)
  {
    String[] filters = StatsManager.getArrayFromList(value);
    if ("plugins".equals(key)) {
      pluginFilters.addAll(Arrays.asList(filters));
    }
    if ("packages".equals(key)) {
      packageFilters.addAll(Arrays.asList(filters));
    }
  }
  
  public static void startLoadingClass(String id, String className)
  {
    findLoader(id).startLoadClass(className);
  }
  
  private static ClassloaderStats findLoader(String id)
  {
    synchronized (loaders)
    {
      ClassloaderStats result = (ClassloaderStats)loaders.get(id);
      if (result == null)
      {
        result = new ClassloaderStats(id);
        loaders.put(id, result);
      }
      return result;
    }
  }
  
  public static synchronized Stack<ClassStats> getClassStack()
  {
    Stack<ClassStats> result = (Stack)classStacks.get(Thread.currentThread());
    if (result == null)
    {
      result = new Stack();
      classStacks.put(Thread.currentThread(), result);
    }
    return result;
  }
  
  public static ClassloaderStats[] getLoaders()
  {
    return (ClassloaderStats[])loaders.values().toArray(new ClassloaderStats[0]);
  }
  
  public static void endLoadingClass(String id, String className, boolean success)
  {
    findLoader(id).endLoadClass(className, success);
  }
  
  public static void loadedBundle(String id, ResourceBundleStats info)
  {
    findLoader(id).loadedBundle(info);
  }
  
  public static ClassloaderStats getLoader(String id)
  {
    return (ClassloaderStats)loaders.get(id);
  }
  
  public ClassloaderStats(String id)
  {
    this.id = id;
    keepTraces = pluginFilters.contains(id);
  }
  
  public void addBaseClasses(String[] baseClasses)
  {
    for (int i = 0; i < baseClasses.length; i++)
    {
      String name = baseClasses[i];
      if (classes.get(name) == null)
      {
        ClassStats value = new ClassStats(name, this);
        value.toBaseClass();
        classes.put(name, value);
      }
    }
  }
  
  private void loadedBundle(ResourceBundleStats bundle)
  {
    bundles.add(bundle);
  }
  
  public List<ResourceBundleStats> getBundles()
  {
    return bundles;
  }
  
  private synchronized void startLoadClass(String name)
  {
    getClassStack().push(findClass(name));
  }
  
  private ClassStats findClass(String name)
  {
    ClassStats result = (ClassStats)classes.get(name);
    return result == null ? new ClassStats(name, this) : result;
  }
  
  private synchronized void endLoadClass(String name, boolean success)
  {
    ClassStats current = (ClassStats)getClassStack().pop();
    if (!success) {
      return;
    }
    if (current.getLoadOrder() >= 0) {
      return;
    }
    classes.put(name, current);
    current.setLoadOrder(classes.size());
    current.loadingDone();
    traceLoad(name, current);
    
    Stack<ClassStats> classStack = getClassStack();
    if (classStack.size() != 0)
    {
      ClassStats previous = (ClassStats)classStack.peek();
      previous.addTimeLoadingOthers(current.getTimeLoading());
      current.setLoadedBy(previous);
      previous.loaded(current);
    }
    else
    {
      loadingTime += current.getTimeLoading();
    }
  }
  
  /* Error */
  private void traceLoad(String name, ClassStats target)
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 323	org/eclipse/core/runtime/internal/stats/ClassloaderStats:keepTraces	Z
    //   4: ifne +58 -> 62
    //   7: iconst_0
    //   8: istore_3
    //   9: iconst_0
    //   10: istore 4
    //   12: goto +28 -> 40
    //   15: aload_1
    //   16: getstatic 328	org/eclipse/core/runtime/internal/stats/ClassloaderStats:packageFilters	Ljava/util/List;
    //   19: iload 4
    //   21: invokeinterface 399 2 0
    //   26: checkcast 170	java/lang/String
    //   29: invokevirtual 352	java/lang/String:startsWith	(Ljava/lang/String;)Z
    //   32: ifeq +5 -> 37
    //   35: iconst_1
    //   36: istore_3
    //   37: iinc 4 1
    //   40: iload_3
    //   41: ifne +16 -> 57
    //   44: iload 4
    //   46: getstatic 328	org/eclipse/core/runtime/internal/stats/ClassloaderStats:packageFilters	Ljava/util/List;
    //   49: invokeinterface 398 1 0
    //   54: if_icmplt -39 -> 15
    //   57: iload_3
    //   58: ifne +4 -> 62
    //   61: return
    //   62: aload_2
    //   63: getstatic 324	org/eclipse/core/runtime/internal/stats/ClassloaderStats:traceFile	Ljava/io/File;
    //   66: invokevirtual 336	java/io/File:length	()J
    //   69: invokevirtual 381	org/eclipse/core/runtime/internal/stats/ClassStats:setTraceStart	(J)V
    //   72: new 168	java/io/PrintWriter
    //   75: dup
    //   76: new 164	java/io/FileOutputStream
    //   79: dup
    //   80: getstatic 324	org/eclipse/core/runtime/internal/stats/ClassloaderStats:traceFile	Ljava/io/File;
    //   83: invokevirtual 338	java/io/File:getAbsolutePath	()Ljava/lang/String;
    //   86: iconst_1
    //   87: invokespecial 342	java/io/FileOutputStream:<init>	(Ljava/lang/String;Z)V
    //   90: invokespecial 347	java/io/PrintWriter:<init>	(Ljava/io/OutputStream;)V
    //   93: astore_3
    //   94: aload_3
    //   95: new 171	java/lang/StringBuffer
    //   98: dup
    //   99: ldc_w 157
    //   102: invokespecial 354	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   105: aload_1
    //   106: invokevirtual 355	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   109: invokevirtual 353	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   112: invokevirtual 348	java/io/PrintWriter:println	(Ljava/lang/String;)V
    //   115: aload_3
    //   116: ldc_w 156
    //   119: invokevirtual 348	java/io/PrintWriter:println	(Ljava/lang/String;)V
    //   122: aload_3
    //   123: new 171	java/lang/StringBuffer
    //   126: dup
    //   127: ldc_w 155
    //   130: invokespecial 354	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   133: aload_1
    //   134: invokevirtual 355	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   137: invokevirtual 353	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   140: invokevirtual 348	java/io/PrintWriter:println	(Ljava/lang/String;)V
    //   143: invokestatic 390	org/eclipse/core/runtime/internal/stats/ClassloaderStats:getClassStack	()Ljava/util/Stack;
    //   146: astore 4
    //   148: aload 4
    //   150: invokevirtual 368	java/util/Stack:size	()I
    //   153: iconst_1
    //   154: isub
    //   155: istore 5
    //   157: goto +39 -> 196
    //   160: aload_3
    //   161: new 171	java/lang/StringBuffer
    //   164: dup
    //   165: ldc_w 155
    //   168: invokespecial 354	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   171: aload 4
    //   173: iload 5
    //   175: invokevirtual 372	java/util/Stack:get	(I)Ljava/lang/Object;
    //   178: checkcast 187	org/eclipse/core/runtime/internal/stats/ClassStats
    //   181: invokevirtual 382	org/eclipse/core/runtime/internal/stats/ClassStats:getClassName	()Ljava/lang/String;
    //   184: invokevirtual 355	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   187: invokevirtual 353	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   190: invokevirtual 348	java/io/PrintWriter:println	(Ljava/lang/String;)V
    //   193: iinc 5 -1
    //   196: iload 5
    //   198: ifge -38 -> 160
    //   201: aload_3
    //   202: ldc_w 158
    //   205: invokevirtual 348	java/io/PrintWriter:println	(Ljava/lang/String;)V
    //   208: new 174	java/lang/Throwable
    //   211: dup
    //   212: invokespecial 357	java/lang/Throwable:<init>	()V
    //   215: aload_3
    //   216: invokevirtual 358	java/lang/Throwable:printStackTrace	(Ljava/io/PrintWriter;)V
    //   219: goto +12 -> 231
    //   222: astore 6
    //   224: aload_3
    //   225: invokevirtual 346	java/io/PrintWriter:close	()V
    //   228: aload 6
    //   230: athrow
    //   231: aload_3
    //   232: invokevirtual 346	java/io/PrintWriter:close	()V
    //   235: aload_2
    //   236: getstatic 324	org/eclipse/core/runtime/internal/stats/ClassloaderStats:traceFile	Ljava/io/File;
    //   239: invokevirtual 336	java/io/File:length	()J
    //   242: invokevi
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 85 86 87

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