org.eclipse.jst.jsf.common_1.2.3.v201104061039

16:45:50.078 INFO  jd.cli.Main - Decompiling org.eclipse.jst.jsf.common_1.2.3.v201104061039.jar
package org.eclipse.jst.jsf.common;

import org.eclipse.emf.common.EMFPlugin.EclipsePlugin;

public class JSFCommonPlugin$Implementation
  extends EMFPlugin.EclipsePlugin
{
  public static final String SYMBOL_SOURCE_EXT_ID = "symbolSourceProvider";
  public static final String SYMBOL_FACTORY_EXT_ID = "contextSymbolFactory";
  
  public JSFCommonPlugin$Implementation()
  {
    JSFCommonPlugin.access$0(this);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.jsf.common.JSFCommonPlugin.Implementation
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.jsf.common;

import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IContributor;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.emf.common.EMFPlugin;
import org.eclipse.emf.common.EMFPlugin.EclipsePlugin;
import org.eclipse.emf.common.util.ResourceLocator;
import org.eclipse.jst.jsf.context.symbol.source.AbstractContextSymbolFactory;
import org.eclipse.jst.jsf.context.symbol.source.ISymbolSourceProvider;
import org.eclipse.jst.jsf.context.symbol.source.ISymbolSourceProviderFactory;
import org.osgi.framework.Bundle;

public final class JSFCommonPlugin
  extends EMFPlugin
{
  public static final String PLUGIN_ID = "org.eclipse.jst.jsf.common";
  public static final String copyright = "Copyright 2006 Oracle";
  private static List<ISymbolSourceProviderFactory> registeredSymbolSourceProviders;
  private static Map<String, AbstractContextSymbolFactory> registeredSymbolFactories;
  private static final String FACTORY_ATTRIBUTE_NAME = "factory";
  private static final String FACTORY_ATTRIBUTE_ID_NAME = "factoryId";
  private static final String SYMBOL_SOURCE_ID = "symbolSourceId";
  private static final String CONTEXT_SYMBOL_FACTORY = "contextSymbolFactory";
  public static final JSFCommonPlugin INSTANCE = new JSFCommonPlugin();
  private static Implementation plugin;
  
  public JSFCommonPlugin()
  {
    super(new ResourceLocator[0]);
  }
  
  public ResourceLocator getPluginResourceLocator()
  {
    return plugin;
  }
  
  public static Implementation getPlugin()
  {
    return plugin;
  }
  
  public static void log(Throwable e, String msg)
  {
    Implementation plugin2 = getPlugin();
    if (plugin2 != null)
    {
      ILog log = getPlugin().getLog();
      if (log != null)
      {
        log.log(new Status(4, "org.eclipse.jst.jsf.common", 0, msg, e));
        return;
      }
    }
    System.err.print(msg + ": ");
    if (e != null) {
      e.printStackTrace(System.err);
    }
  }
  
  public static void log(int severity, String message, Throwable ex)
  {
    getPlugin().getLog().log(new Status(severity, "org.eclipse.jst.jsf.common", 0, message, ex));
  }
  
  public static void log(int severity, String message)
  {
    log(severity, message, null);
  }
  
  public static ISymbolSourceProvider[] getSymbolSourceProvider()
  {
    return (ISymbolSourceProvider[])registeredSymbolSourceProviders.toArray(new ISymbolSourceProvider[0]);
  }
  
  public static synchronized List<ISymbolSourceProviderFactory> getSymbolSourceProviders()
  {
    if (registeredSymbolSourceProviders == null)
    {
      registerProviders();
      if (registeredSymbolSourceProviders == null) {
        throw new AssertionError("registerProviders failed");
      }
    }
    return Collections.unmodifiableList(registeredSymbolSourceProviders);
  }
  
  private static void registerProviders()
  {
    IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(plugin.getBundle().getSymbolicName(), "symbolSourceProvider");
    IExtension[] extensions = point.getExtensions();
    registeredSymbolSourceProviders = new ArrayList(extensions.length);
    for (int i = 0; i < extensions.length; i++)
    {
      IExtension extension = extensions[i];
      IConfigurationElement[] elements = 
        extension.getConfigurationElements();
      String bundleId = extension.getContributor().getName();
      for (int j = 0; j < elements.length; j++)
      {
        IConfigurationElement element = elements[j];
        if (("symbolSourceId".equals(element.getName())) && 
          (element.getAttribute("factory") != null))
        {
          String factoryClassName = element.getAttribute("factory");
          Bundle bundle = Platform.getBundle(bundleId);
          if (bundle != null) {
            try
            {
              Class factoryClass = bundle.loadClass(factoryClassName);
              
              ISymbolSourceProviderFactory factory = 
                (ISymbolSourceProviderFactory)factoryClass.newInstance();
              
              registeredSymbolSourceProviders.add(factory);
            }
            catch (Exception e)
            {
              plugin.log(new Status(4, plugin.getBundle().getSymbolicName(), 0, "Error loading symbol provider extension point", e));
            }
          }
        }
      }
    }
  }
  
  public static synchronized Map<String, AbstractContextSymbolFactory> getSymbolFactories()
  {
    if (registeredSymbolFactories == null)
    {
      registerSymbolFactories();
      if (registeredSymbolFactories == null) {
        throw new AssertionError("registerProviders failed");
      }
    }
    return Collections.unmodifiableMap(registeredSymbolFactories);
  }
  
  private static void registerSymbolFactories()
  {
    IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(plugin.getBundle().getSymbolicName(), "contextSymbolFactory");
    IExtension[] extensions = point.getExtensions();
    registeredSymbolFactories = new HashMap(extensions.length);
    for (int i = 0; i < extensions.length; i++)
    {
      IExtension extension = extensions[i];
      IConfigurationElement[] elements = 
        extension.getConfigurationElements();
      String bundleId = extension.getContributor().getName();
      for (int j = 0; j < elements.length; j++)
      {
        IConfigurationElement element = elements[j];
        if (("contextSymbolFactory".equals(element.getName())) && 
          (element.getAttribute("factory") != null))
        {
          String factoryClassName = element.getAttribute("factory");
          String factoryId = element.getAttribute("factoryId");
          Bundle bundle = Platform.getBundle(bundleId);
          if (bundle != null) {
            try
            {
              Class factoryClass = bundle.loadClass(factoryClassName);
              
              AbstractContextSymbolFactory factory = 
                (AbstractContextSymbolFactory)factoryClass.newInstance();
              registeredSymbolFactories.put(factoryId, factory);
            }
            catch (InstantiationException e)
            {
              plugin.log(new Status(4, plugin.getBundle().getSymbolicName(), 0, "Error loading symbol factory extension point", e));
            }
            catch (IllegalAccessException e)
            {
              plugin.log(new Status(4, plugin.getBundle().getSymbolicName(), 0, "Error loading symbol factory extension point", e));
            }
            catch (ClassNotFoundException e)
            {
              plugin.log(new Status(4, plugin.getBundle().getSymbolicName(), 0, "Error loading symbol factory extension point", e));
            }
          }
        }
      }
    }
  }
  
  public static void log(Throwable t)
  {
    ILog log = getPlugin().getLog();
    IStatus status = new Status(4, getPlugin().getSymbolicName(), 0, "Caught exception", t);
    log.log(status);
  }
  
  public static class Implementation
    extends EMFPlugin.EclipsePlugin
  {
    public static final String SYMBOL_SOURCE_EXT_ID = "symbolSourceProvider";
    public static final String SYMBOL_FACTORY_EXT_ID = "contextSymbolFactory";
    
    public Implementation()
    {
      JSFCommonPlugin.plugin = this;
    }
  }
  
  public static Class<?> loadClass(String className, String bundleId)
  {
    Class<?> aClass = null;
    try
    {
      if (bundleId != null)
      {
        Bundle bundle = Platform.getBundle(bundleId);
        if (bundle != null) {
          aClass = bundle.loadClass(className);
        }
      }
    }
    catch (ClassNotFoundException e)
    {
      log(e);
    }
    return aClass;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.jsf.common.JSFCommonPlugin
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.jsf.common.dom;

class AttrDOMAdapter$MyAttributeIdentifier
  extends AttributeIdentifier
{
  private AttrDOMAdapter$MyAttributeIdentifier(AttrDOMAdapter paramAttrDOMAdapter) {}
  
  public String getName()
  {
    return this$0.getLocalName();
  }
  
  public TagIdentifier getTagIdentifier()
  {
    return this$0.getOwningElement().getTagId();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.jsf.common.dom.AttrDOMAdapter.MyAttributeIdentifier
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.jsf.common.dom;

public abstract class AttrDOMAdapter
  extends DOMAdapter
{
  private AttributeIdentifier _attributeId;
  private final ElementDOMAdapter _owner;
  
  protected AttrDOMAdapter(ElementDOMAdapter owner)
  {
    _owner = owner;
  }
  
  public ElementDOMAdapter getOwningElement()
  {
    return _owner;
  }
  
  public abstract String getValue();
  
  public final short getNodeType()
  {
    return 2;
  }
  
  public final AttributeIdentifier getAttributeIdentifier()
  {
    synchronized (this)
    {
      if (_attributeId == null) {
        _attributeId = new MyAttributeIdentifier(null);
      }
    }
    return _attributeId;
  }
  
  private class MyAttributeIdentifier
    extends AttributeIdentifier
  {
    private MyAttributeIdentifier() {}
    
    public String getName()
    {
      return getLocalName();
    }
    
    public TagIdentifier getTagIdentifier()
    {
      return getOwningElement().getTagId();
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.jsf.common.dom.AttrDOMAdapter
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.jsf.common.dom;

public abstract class AttributeIdentifier
{
  public abstract String getName();
  
  public abstract TagIdentifier getTagIdentifier();
  
  public final boolean equals(Object compareTo)
  {
    if ((compareTo instanceof AttributeIdentifier)) {
      return isSameAttributeType((AttributeIdentifier)compareTo);
    }
    return false;
  }
  
  public final int hashCode()
  {
    int hashCode = getName().toLowerCase().hashCode();
    
    int tagCode = getTagIdentifier().hashCode();
    
    hashCode ^= tagCode;
    
    return hashCode;
  }
  
  public final boolean isSameAttributeType(AttributeIdentifier attributeId)
  {
    if (attributeId == this) {
      return true;
    }
    if (!getTagIdentifier().isSameTagType(attributeId.getTagIdentifier())) {
      return false;
    }
    return getName().toLowerCase().equals(attributeId.getName().toLowerCase());
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.jsf.common.dom.AttributeIdentifier
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.jsf.common.dom;

public abstract class DOMAdapter
{
  public abstract short getNodeType();
  
  public abstract String getPrefix();
  
  public abstract String getLocalName();
  
  public abstract String getNodeName();
}

/* Location:
 * Qualified Name:     org.eclipse.jst.jsf.common.dom.DOMAdapter
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.jsf.common.dom;

final class ElementDOMAdapter$MyTagIdentifier
  extends TagIdentifier
{
  private ElementDOMAdapter$MyTagIdentifier(ElementDOMAdapter paramElementDOMAdapter) {}
  
  public String getTagName()
  {
    return this$0.getLocalName();
  }
  
  public String getUri()
  {
    return this$0.getNamespace();
  }
  
  public boolean isJSPTag()
  {
    throw new UnsupportedOperationException("jsp flag not supported on this identifier");
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.jsf.common.dom.ElementDOMAdapter.MyTagIdentifier
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.jsf.common.dom;

import java.util.Map;

public abstract class ElementDOMAdapter
  extends DOMAdapter
{
  private TagIdentifier _tagIdentifier;
  
  public abstract Map<String, ? extends AttrDOMAdapter> getAttributes();
  
  public final short getNodeType()
  {
    return 1;
  }
  
  public abstract String getNamespace();
  
  public final TagIdentifier getTagId()
  {
    synchronized (this)
    {
      if (_tagIdentifier == null) {
        _tagIdentifier = new MyTagIdentifier(null);
      }
    }
    return _tagIdentifier;
  }
  
  private final class MyTagIdentifier
    extends TagIdentifier
  {
    private MyTagIdentifier() {}
    
    public String getTagName()
    {
      return getLocalName();
    }
    
    public String getUri()
    {
      return getNamespace();
    }
    
    public boolean isJSPTag()
    {
      throw new UnsupportedOperationException("jsp flag not supported on this identifier");
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.jsf.common.dom.ElementDOMAdapter
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.jsf.common.dom;

import javax.xml.namespace.QName;

public abstract class TagIdentifier
{
  public abstract String getUri();
  
  public abstract String getTagName();
  
  public abstract boolean isJSPTag();
  
  public final boolean equals(Object compareTo)
  {
    if ((compareTo instanceof TagIdentifier)) {
      return isSameTagType((TagIdentifier)compareTo);
    }
    return false;
  }
  
  public final int hashCode()
  {
    int hashCode = getTagName().toLowerCase().hashCode();
    
    String uri = getUri();
    if (uri != null) {
      hashCode ^= uri.hashCode();
    }
    return hashCode;
  }
  
  public final boolean isSameTagType(TagIdentifier tagWrapper)
  {
    if (tagWrapper == this) {
      return true;
    }
    String uri = tagWrapper.getUri();
    if (uri == null)
    {
      if (getUri() != null) {
        return false;
      }
    }
    else if (uri.equals(getUri()))
    {
      String tagName = tagWrapper.getTagName();
      if (tagName == null)
      {
        if (getTagName() != null) {
          return false;
        }
      }
      else if (tagName.toLowerCase().equals(getTagName().toLowerCase())) {
        return true;
      }
    }
    return false;
  }
  
  public final QName asQName()
  {
    return new QName(getUri(), getTagName());
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.jsf.common.dom.TagIdentifier
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.jsf.common.dom;

abstract interface package-info {}

/* Location:
 * Qualified Name:     org.eclipse.jst.jsf.common.dom.package-info
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.jsf.common.facet;

import org.eclipse.osgi.util.NLS;

public class Messages
  extends NLS
{
  private static final String BUNDLE_NAME = "org.eclipse.jst.jsf.common.facet.messages";
  public static String UserLibraryVersionValidator_cannotReadLibraryVersion;
  public static String UserLibraryVersionValidator_possiblyIncompatibleLibrary;
  public static String UserLibraryVersionValidator_versionMismatch;
  
  static
  {
    NLS.initializeMessages("org.eclipse.jst.jsf.common.facet.messages", Messages.class);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.jsf.common.facet.Messages
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.jsf.common.facet.libraryprovider;

import java.io.File;
import java.io.IOException;
import java.util.Enumeration;
import java.util.jar.Attributes;
import java.util.jar.JarFile;
import java.util.jar.Manifest;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jst.common.project.facet.core.libprov.user.KeyClassesValidator;
import org.eclipse.jst.common.project.facet.core.libprov.user.UserLibraryProviderInstallOperationConfig;
import org.eclipse.jst.jsf.common.facet.Messages;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;

public abstract class UserLibraryVersionValidator
  extends KeyClassesValidator
{
  private static final String MANIFEST_SPECIFICATION_VERSION = "Specification-Version";
  private static final String MANIFEST_IMPLEMENTATION_VERSION = "Implementation-Version";
  private final String classNameIdentifyingImplementationJar;
  
  public UserLibraryVersionValidator(String classNameIdentifyingImplementationJar)
  {
    this.classNameIdentifyingImplementationJar = classNameIdentifyingImplementationJar;
  }
  
  public IStatus validate(UserLibraryProviderInstallOperationConfig config)
  {
    IStatus status = super.validate(config);
    if (status.getSeverity() != 0) {
      return status;
    }
    String facetVersion = getFacetVersion(config);
    String libraryVersion = getLibraryVersion(config);
    return validateVersionStrings(facetVersion, libraryVersion);
  }
  
  protected IStatus validateVersionStrings(String facetVersion, String libraryVersion)
  {
    if (facetVersion == null) {
      throw new IllegalArgumentException("Cannot read facet version");
    }
    if (libraryVersion == null) {
      return new Status(2, "org.eclipse.jst.jsf.common", Messages.UserLibraryVersionValidator_cannotReadLibraryVersion);
    }
    if (libraryVersion.compareToIgnoreCase(facetVersion) >= 0) {
      return Status.OK_STATUS;
    }
    return new Status(2, "org.eclipse.jst.jsf.common", Messages.UserLibraryVersionValidator_possiblyIncompatibleLibrary);
  }
  
  private String getFacetVersion(UserLibraryProviderInstallOperationConfig config)
  {
    return config.getProjectFacetVersion().getVersionString();
  }
  
  /* Error */
  private String getLibraryVersion(UserLibraryProviderInstallOperationConfig config)
  {
    // Byte code:
    //   0: aconst_null
    //   1: astore_2
    //   2: aload_1
    //   3: invokevirtual 205	org/eclipse/jst/common/project/facet/core/libprov/user/UserLibraryProviderInstallOperationConfig:resolve	()Ljava/util/Collection;
    //   6: invokeinterface 214 1 0
    //   11: astore 4
    //   13: goto +104 -> 117
    //   16: aload 4
    //   18: invokeinterface 218 1 0
    //   23: checkcast 102	org/eclipse/jdt/core/IClasspathEntry
    //   26: astore_3
    //   27: aload_0
    //   28: aload_3
    //   29: invokespecial 208	org/eclipse/jst/jsf/common/facet/libraryprovider/UserLibraryVersionValidator:isLibrary	(Lorg/eclipse/jdt/core/IClasspathEntry;)Z
    //   32: ifeq +85 -> 117
    //   35: aload_3
    //   36: invokeinterface 222 1 0
    //   41: invokeinterface 219 1 0
    //   46: astore 5
    //   48: aload 5
    //   50: invokevirtual 188	java/io/File:exists	()Z
    //   53: ifeq +64 -> 117
    //   56: aload_0
    //   57: aload_3
    //   58: aload_0
    //   59: getfield 187	org/eclipse/jst/jsf/common/facet/libraryprovider/UserLibraryVersionValidator:classNameIdentifyingImplementationJar	Ljava/lang/String;
    //   62: invokespecial 210	org/eclipse/jst/jsf/common/facet/libraryprovider/UserLibraryVersionValidator:isCorrectLibraryJar	(Lorg/eclipse/jdt/core/IClasspathEntry;Ljava/lang/String;)Z
    //   65: ifeq +52 -> 117
    //   68: aconst_null
    //   69: astore 6
    //   71: new 95	java/util/jar/JarFile
    //   74: dup
    //   75: aload 5
    //   77: invokespecial 195	java/util/jar/JarFile:<init>	(Ljava/io/File;)V
    //   80: astore 6
    //   82: aload_0
    //   83: aload 6
    //   85: invokevirtual 209	org/eclipse/jst/jsf/common/facet/libraryprovider/UserLibraryVersionValidator:getLibraryVersion	(Ljava/util/jar/JarFile;)Ljava/lang/String;
    //   88: astore_2
    //   89: goto +18 -> 107
    //   92: astore 7
    //   94: aload 6
    //   96: ifnull +8 -> 104
    //   99: aload 6
    //   101: invokevirtual 194	java/util/jar/JarFile:close	()V
    //   104: aload 7
    //   106: athrow
    //   107: aload 6
    //   109: ifnull +8 -> 117
    //   112: aload 6
    //   114: invokevirtual 194	java/util/jar/JarFile:close	()V
    //   117: aload 4
    //   119: invokeinterface 217 1 0
    //   124: ifne -108 -> 16
    //   127: goto +12 -> 139
    //   130: astore_3
    //   131: aload_3
    //   132: aload_3
    //   133: invokevirtual 189	java/io/IOException:getLocalizedMessage	()Ljava/lang/String;
    //   136: invokestatic 207	org/eclipse/jst/jsf/common/JSFCommonPlugin:log	(Ljava/lang/Throwable;Ljava/lang/String;)V
    //   139: aload_2
    //   140: areturn
    // Line number table:
    //   Java source line #103	-> byte code offset #0
    //   Java source line #107	-> byte code offset #2
    //   Java source line #109	-> byte code offset #27
    //   Java source line #111	-> byte code offset #35
    //   Java source line #113	-> byte code offset #48
    //   Java source line #115	-> byte code offset #68
    //   Java source line #118	-> byte code offset #71
    //   Java source line #119	-> byte code offset #82
    //   Java source line #122	-> byte code offset #92
    //   Java source line #123	-> byte code offset #94
    //   Java source line #124	-> byte code offset #99
    //   Java source line #125	-> byte code offset #104
    //   Java source line #123	-> byte code offset #107
    //   Java source line #124	-> byte code offset #112
    //   Java source line #107	-> byte code offset #117
    //   Java source line #130	-> byte code offset #130
    //   Java source line #132	-> byte code offset #131
    //   Java source line #135	-> byte code offset #139
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	141	0	this	UserLibraryVersionValidator
    //   0	141	1	config	UserLibraryProviderInstallOperationConfig
    //   1	139	2	libraryVersion	String
    //   26	32	3	cpe	IClasspathEntry
    //   130	3	3	e	IOException
    //   11	107	4	localIterator	java.util.Iterator
    //   46	30	5	libraryFile	File
    //   69	44	6	jarFile	JarFile
    //   92	13	7	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   71	92	92	finally
    //   2	127	130	java/io/IOException
  }
  
  private boolean isLibrary(IClasspathEntry cpe)
  {
    return cpe.getEntryKind() == 1;
  }
  
  private boolean isCorrectLibraryJar(IClasspathEntry cpe, String classNameIdentifyingJar)
    throws IOException
  {
    File libraryFile = cpe.getPath().toFile();
    if (!libraryFile.exists()) {
      return false;
    }
    ZipFile zipFile = null;
    try
    {
      zipFile = new ZipFile(libraryFile);
      Enumeration<? extends ZipEntry> entries;
      for (Enumeration<? extends ZipEntry> entries = zipFile.entries(); entries.hasMoreElements();)
      {
        ZipEntry entry = (ZipEntry)entries.nextElement();
        String entryName = entry.getName();
        if (entryName.equals(classNameIdentifyingJar)) {
          return true;
        }
      }
    }
    finally
    {
      if (zipFile != null) {
        zipFile.close();
      }
    }
    if (zipFile != null) {
      zipFile.close();
    }
    return false;
  }
  
  protected String getLibraryVersion(JarFile jarFile)
    throws IOException
  {
    Manifest manifest = jarFile.getManifest();
    if (manifest == null) {
      return null;
    }
    Attributes attributes = manifest.getMainAttributes();
    
    String specificationVersion = attributes.getValue("Specification-Version");
    if (specificationVersion != null) {
      return specificationVersion;
    }
    String implementationVersion = manifest.getMainAttributes().getValue("Implementation-Version");
    return implementationVersion;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.jsf.common.facet.libraryprovider.UserLibraryVersionValidator
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.jsf.common.facet.libraryprovider.jsf;

public enum JsfLibraryUtil$JsfLibraryVendorType
{
  UNKNOWN,  MYFACES,  SUN_RI;
}

/* Location:
 * Qualified Name:     org.eclipse.jst.jsf.common.facet.libraryprovider.jsf.JsfLibraryUtil.JsfLibraryVendorType
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.jsf.common.facet.libraryprovider.jsf;

import org.eclipse.jdt.core.IClasspathEntry;

public class JsfLibraryUtil
{
  /* Error */
  public static JsfLibraryVendorType getJsfLibraryVendorType(org.eclipse.jst.common.project.facet.core.libprov.user.UserLibraryProviderInstallOperationConfig libConfig)
  {
    // Byte code:
    //   0: aload_0
    //   1: invokevirtual 128	org/eclipse/jst/common/project/facet/core/libprov/user/UserLibraryProviderInstallOperationConfig:resolve	()Ljava/util/Collection;
    //   4: invokeinterface 131 1 0
    //   9: astore_2
    //   10: goto +318 -> 328
    //   13: aload_2
    //   14: invokeinterface 135 1 0
    //   19: checkcast 65	org/eclipse/jdt/core/IClasspathEntry
    //   22: astore_1
    //   23: aload_1
    //   24: invokestatic 130	org/eclipse/jst/jsf/common/facet/libraryprovider/jsf/JsfLibraryUtil:isLibrary	(Lorg/eclipse/jdt/core/IClasspathEntry;)Z
    //   27: ifeq +301 -> 328
    //   30: aload_1
    //   31: invokeinterface 138 1 0
    //   36: invokeinterface 136 1 0
    //   41: astore_3
    //   42: aload_3
    //   43: invokevirtual 119	java/io/File:exists	()Z
    //   46: ifne +6 -> 52
    //   49: goto +279 -> 328
    //   52: aconst_null
    //   53: astore 4
    //   55: new 63	java/util/zip/ZipFile
    //   58: dup
    //   59: aload_3
    //   60: invokespecial 126	java/util/zip/ZipFile:<init>	(Ljava/io/File;)V
    //   63: astore 4
    //   65: aload 4
    //   67: invokevirtual 127	java/util/zip/ZipFile:entries	()Ljava/util/Enumeration;
    //   70: astore 5
    //   72: goto +108 -> 180
    //   75: aload 5
    //   77: invokeinterface 133 1 0
    //   82: checkcast 61	java/util/zip/ZipEntry
    //   85: astore 6
    //   87: aload 6
    //   89: invokevirtual 123	java/util/zip/ZipEntry:getName	()Ljava/lang/String;
    //   92: astore 7
    //   94: aload 7
    //   96: ldc 2
    //   98: invokevirtual 122	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   101: ifeq +36 -> 137
    //   104: getstatic 116	org/eclipse/jst/jsf/common/facet/libraryprovider/jsf/JsfLibraryUtil$JsfLibraryVendorType:MYFACES	Lorg/eclipse/jst/jsf/common/facet/libraryprovider/jsf/JsfLibraryUtil$JsfLibraryVendorType;
    //   107: astore 9
    //   109: aload 4
    //   111: ifnull +23 -> 134
    //   114: aload 4
    //   116: invokevirtual 125	java/util/zip/ZipFile:close	()V
    //   119: goto +15 -> 134
    //   122: astore 10
    //   124: aload 10
    //   126: aload 10
    //   128: invokevirtual 120	java/io/IOException:getLocalizedMessage	()Ljava/lang/String;
    //   131: invokestatic 129	org/eclipse/jst/jsf/common/JSFCommonPlugin:log	(Ljava/lang/Throwable;Ljava/lang/String;)V
    //   134: aload 9
    //   136: areturn
    //   137: aload 7
    //   139: ldc 1
    //   141: invokevirtual 122	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   144: ifeq +36 -> 180
    //   147: getstatic 117	org/eclipse/jst/jsf/common/facet/libraryprovider/jsf/JsfLibraryUtil$JsfLibraryVendorType:SUN_RI	Lorg/eclipse/jst/jsf/common/facet/libraryprovider/jsf/JsfLibraryUtil$JsfLibraryVendorType;
    //   150: astore 9
    //   152: aload 4
    //   154: ifnull +23 -> 177
    //   157: aload 4
    //   159: invokevirtual 125	java/util/zip/ZipFile:close	()V
    //   162: goto +15 -> 177
    //   165: astore 10
    //   167: aload 10
    //   169: aload 10
    //   171: invokevirtual 120	java/io/IOException:getLocalizedMessage	()Ljava/lang/String;
    //   174: invokestatic 129	org/eclipse/jst/jsf/common/JSFCommonPlugin:log	(Ljava/lang/Throwable;Ljava/lang/String;)V
    //   177: aload 9
    //   179: areturn
    //   180: aload 5
    //   182: invokeinterface 132 1 0
    //   187: ifne -112 -> 75
    //   190: goto +113 -> 303
    //   193: astore 5
    //   195: aload 5
    //   197: aload 5
    //   199: invokevirtual 124	java/util/zip/ZipException:getLocalizedMessage	()Ljava/lang/String;
    //   202: invokestatic 129	org/eclipse/jst/jsf/common/JSFCommonPlugin:log	(Ljava/lang/Throwable;Ljava/lang/String;)V
    //   205: aload 4
    //   207: ifnull +121 -> 328
    //   210: aload 4
    //   212: invokevirtual 125	java/util/zip/ZipFile:close	()V
    //   215: goto +113 -> 328
    //   218: astore 10
    //   220: aload 10
    //   222: aload 10
    //   224: invokevirtual 120	java/io/IOException:getLocalizedMessage	()Ljava/lang/String;
    //   227: invokestatic 129	org/eclipse/jst/jsf/common/JSFCommonPlugin:log	(Ljava/lang/Throwable;Ljava/lang/String;)V
    //   230: goto +98 -> 328
    //   233: astore 5
    //   235: aload 5
    //   237: aload 5
    //   239: invokevirtual 120	java/io/IOException:getLocalizedMessage	()Ljava/lang/String;
    //   242: invokestatic 129	org/eclipse/jst/jsf/common/JSFCommonPlugin:log	(Ljava/lang/Throwable;Ljava/lang/String;)V
    //   245: aload 4
    //   247: ifnull +81 -> 328
    //   250: aload 4
    //   252: invokevirtual 125	java/util/zip/ZipFile:close	()V
    //   255: goto +73 -> 328
    //   258: astore 10
    //   260: aload 10
    //   262: aload 10
    //   264: invokevirtual 120	java/io/IOException:getLocalizedMessage	()Ljava/lang/String;
    //   267: invokestatic 129	org/eclipse/jst/jsf/common/JSFCommonPlugin:log	(Ljava/lang/Throwable;Ljava/lang/String;)V
    //   270: goto +58 -> 328
    //   273: astore 8
    //   275: aload 4
    //   277: ifnull +23 -> 300
    //   280: aload 4
    //   282: invokevirtual 125	java/util/zip/ZipFile:close	()V
    //   285: goto +15 -> 300
    //   288: astore 10
    //   290: aload 10
    //   292: aload 10
    //   294: invokevirtual 120	java/io/IOException:getLocalizedMessage	()Ljava/lang/String;
    //   297: invokestatic 129	org/eclipse/jst/jsf/common/JSFCommonPlugin:log	(Ljava/lang/Throwable;Ljava/lang/String;)V
    //   300: aload 8
    //   302: athrow
    //   303: aload 4
    //   305: ifnull +23 -> 328
    //   308: aload 4
    //   310: invokevirtual 125	java/util/zip/ZipFile:close	()V
    //   313: goto +15 -> 328
    //   316: astore 10
    //   318: aload 10
    //   320: aload 10
    //   322: invokevirtual 120	java/io/IOException:getLocalizedMessage	()Ljava/lang/String;
    //   325: invokestatic 129	org/eclipse/jst/jsf/common/JSFCommonPlugin:log	(Ljava/lang/Throwable;Ljava/lang/String;)V
    //   328: aload_2
    //   329: invokeinterface 134 1 0
    //   334: ifne -321 -> 13
    //   337: getstatic 118	org/eclipse/jst/jsf/common/facet/libraryprovider/jsf/JsfLibraryUtil$JsfLibraryVendorType:UNKNOWN	Lorg/eclipse/jst/jsf/common/facet/libraryprovider/jsf/JsfLibraryUtil$JsfLibraryVendorType;
    //   340: areturn
    // Line number table:
    //   Java source line #61	-> byte code offset #0
    //   Java source line #63	-> byte code offset #23
    //   Java source line #65	-> byte code offset #30
    //   Java source line #67	-> byte code offset #42
    //   Java source line #68	-> byte code offset #49
    //   Java source line #70	-> byte code offset #52
    //   Java source line #74	-> byte code offset #55
    //   Java source line #76	-> byte code offset #65
    //   Java source line #78	-> byte code offset #75
    //   Java source line #79	-> byte code offset #87
    //   Java source line #81	-> byte code offset #94
    //   Java source line #82	-> byte code offset #104
    //   Java source line #100	-> byte code offset #109
    //   Java source line #101	-> byte code offset #114
    //   Java source line #103	-> byte code offset #122
    //   Java source line #105	-> byte code offset #124
    //   Java source line #82	-> byte code offset #134
    //   Java source line #84	-> byte code offset #137
    //   Java source line #85	-> byte code offset #147
    //   Java source line #100	-> byte code offset #152
    //   Java source line #101	-> byte code offset #157
    //   Java source line #103	-> byte code offset #165
    //   Java source line #105	-> byte code offset #167
    //   Java source line #85	-> byte code offset #177
    //   Java source line #76	-> byte code offset #180
    //   Java source line #88	-> byte code offset #193
    //   Java source line #90	-> byte code offset #195
    //   Java source line #100	-> byte code offset #205
    //   Java source line #101	-> byte code offset #210
    //   Java source line #103	-> byte code offset #218
    //   Java source line #105	-> byte code offset #220
    //   Java source line #92	-> byte code offset #233
    //   Java source line #94	-> byte code offset #235
    //   Java source line #100	-> byte code offset #245
    //   Java source line #101	-> byte code offset #250
    //   Java source line #103	-> byte code offset #258
    //   Java source line #105	-> byte code offset #260
    //   Java source line #97	-> byte code offset #273
    //   Java source line #100	-> byte code offset #275
    //   Java source line #101	-> byte code offset #280
    //   Java source line #103	-> byte code offset #288
    //   Java source line #105	-> byte code offset #290
    //   Java source line #107	-> byte code offset #300
    //   Java source line #100	-> byte code offset #303
    //   Java source line #101	-> byte code offset #308
    //   Java source line #103	-> byte code offset #316
    //   Java source line #105	-> byte code offset #318
    //   Java source line #61	-> byte code offset #328
    //   Java source line #111	-> byte code offset #337
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	341	0	libConfig	org.eclipse.jst.common.project.facet.core.libprov.user.UserLibraryProviderInstallOperationConfig
    //   22	9	1	cpe	IClasspathEntry
    //   9	320	2	localIterator	java.util.Iterator
    //   41	19	3	libraryFile	java.io.File
    //   53	256	4	zipFile	java.util.zip.ZipFile
    //   70	6	5	entries	java.util.Enumeration<? extends java.util.zip.ZipEntry>
    //   137	1	5	entries	java.util.Enumeration<? extends java.util.zip.ZipEntry>
    //   180	1	5	entries	java.util.Enumeration<? extends java.util.zip.ZipEntry>
    //   193	5	5	e	java.util.zip.ZipException
    //   233	5	5	e	java.io.IOException
    //   85	3	6	entry	java.util.zip.ZipEntry
    //   137	1	6	entry	java.util.zip.ZipEntry
    //   92	3	7	entryName	String
    //   137	1	7	entryName	String
    //   273	28	8	localObject	Object
    //   107	71	9	localJsfLibraryVendorType	JsfLibraryVendorType
    //   122	5	10	e	java.io.IOException
    //   165	5	10	e	java.io.IOException
    //   218	5	10	e	java.io.IOException
    //   258	5	10	e	java.io.IOException
    //   288	5	10	e	java.io.IOException
    //   316	5	10	e	java.io.IOException
    // Exception table:
    //   from	to	target	type
    //   109	119	122	java/io/IOException
    //   152	162	165	java/io/IOException
    //   55	109	193	java/util/zip/ZipException
    //   137	152	193	java/util/zip/ZipException
    //   180	190	193	java/util/zip/ZipException
    //   205	215	218	java/io/IOException
    //   55	109	233	java/io/IOException
    //   137	152	233	java/io/IOException
    //   180	190	233	java/io/IOException
    //   245	255	258	java/io/IOException
    //   55	109	273	finally
    //   137	152	273	finally
    //   180	205	273	finally
    //   233	245	273	finally
    //   275	285	288	java/io/IOException
    //   303	313	316	java/io/IOException
  }
  
  public static enum JsfLibraryVendorType
  {
    UNKNOWN,  MYFACES,  SUN_RI;
  }
  
  public static boolean isLibrary(IClasspathEntry cpe)
  {
    return cpe.getEntryKind() == 1;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.jsf.common.facet.libraryprovider.jsf.JsfLibraryUtil
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.jsf.common.internal;

public enum ITestTracker$Event
{
  START_TRACKING,  STOP_TRACKING;
}

/* Location:
 * Qualified Name:     org.eclipse.jst.jsf.common.internal.ITestTracker.Event
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.jsf.common.internal;

public abstract interface ITestTracker
{
  public abstract void fireEvent(Event paramEvent, long paramLong, String paramString);
  
  public static enum Event
  {
    START_TRACKING,  STOP_TRACKING;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.jsf.common.internal.ITestTracker
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.jsf.common.internal;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.core.runtime.content.IContentTypeManager;

public final class JSPUtil
{
  private static final String CTYPE_JSPSOURCE = "org.eclipse.jst.jsp.core.jspsource";
  private static final String CTYPE_JSPFRAGMENTSOURCE = "org.eclipse.jst.jsp.core.jspfragmentsource";
  
  public static boolean isJSPContentType(String contentType)
  {
    return ("org.eclipse.jst.jsp.core.jspsource".equals(contentType)) || ("org.eclipse.jst.jsp.core.jspfragmentsource".equals(contentType));
  }
  
  public static boolean isJSPContentType(IFile file)
  {
    boolean isJSPSource = isJSPSource(file);
    if (isJSPSource) {
      return true;
    }
    boolean isJSPFragment = isJSPFragment(file);
    if (isJSPFragment) {
      return true;
    }
    return false;
  }
  
  public static boolean isJSPSource(IFile file)
  {
    return isAssociatedWithContentType(file, "org.eclipse.jst.jsp.core.jspsource");
  }
  
  public static boolean isJSPFragment(IFile file)
  {
    return isAssociatedWithContentType(file, "org.eclipse.jst.jsp.core.jspfragmentsource");
  }
  
  private static boolean isAssociatedWithContentType(IFile file, String contentType)
  {
    IContentTypeManager typeManager = Platform.getContentTypeManager();
    IContentType jspContentType = 
      typeManager.getContentType(contentType);
    if ((jspContentType != null) && 
      (jspContentType.isAssociatedWith(file.getName()))) {
      return true;
    }
    return false;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.jsf.common.internal.JSPUtil
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.jsf.common.internal;

import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.core.runtime.jobs.JobChangeAdapter;

class RunOnCompletionPattern$1
  extends JobChangeAdapter
{
  RunOnCompletionPattern$1(RunOnCompletionPattern paramRunOnCompletionPattern) {}
  
  public void done(IJobChangeEvent event)
  {
    if (event.getResult().getSeverity() != 4) {
      RunOnCompletionPattern.access$0(this$0).run();
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.jsf.common.internal.RunOnCompletionPattern.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.jsf.common.internal;

import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.jst.jsf.common.JSFCommonPlugin;

public class RunOnCompletionPattern
  implements Runnable
{
  private final Job _job;
  private final Runnable _runAfter;
  
  public RunOnCompletionPattern(
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

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