org.eclipse.jem.util_2.1.100.v201103021400

16:45:20.588 INFO  jd.cli.Main - Decompiling org.eclipse.jem.util_2.1.100.v201103021400.jar
package org.eclipse.jem.internal.util.emf.workbench;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.jem.util.RegistryReader;
import org.eclipse.jem.util.logger.proxy.Logger;

class EMFWorkbenchContextFactory$1
  extends RegistryReader
{
  EMFWorkbenchContextFactory$1(String $anonymous0, String $anonymous1, EMFWorkbenchContextFactory[] paramArrayOfEMFWorkbenchContextFactory)
  {
    super($anonymous0, $anonymous1);
  }
  
  public boolean readElement(IConfigurationElement element)
  {
    if (element.getName().equals("factoryClass")) {
      try
      {
        val$factoryHolder[0] = ((EMFWorkbenchContextFactory)element.createExecutableExtension("name"));
        return true;
      }
      catch (CoreException e)
      {
        Logger.getLogger().logError(e);
      }
    }
    return false;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jem.internal.util.emf.workbench.EMFWorkbenchContextFactory.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jem.internal.util.emf.workbench;

import java.util.List;
import java.util.Map;
import java.util.WeakHashMap;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.IProjectNature;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.jem.internal.util.emf.workbench.nls.EMFWorkbenchResourceHandler;
import org.eclipse.jem.util.RegistryReader;
import org.eclipse.jem.util.emf.workbench.EMFWorkbenchContextBase;
import org.eclipse.jem.util.emf.workbench.IEMFContextContributor;
import org.eclipse.jem.util.emf.workbench.ResourceSetWorkbenchSynchronizer;
import org.eclipse.jem.util.emf.workbench.nature.EMFNature;
import org.eclipse.jem.util.logger.proxy.Logger;

public class EMFWorkbenchContextFactory
{
  public static final EMFWorkbenchContextFactory INSTANCE = ;
  private final Class CONTRIBUTOR_CLASS = IEMFContextContributor.class;
  protected Map emfContextCache = new WeakHashMap();
  
  private static EMFWorkbenchContextFactory createFactoryInstance()
  {
    EMFWorkbenchContextFactory factory = createFactoryInstanceFromExtension();
    if (factory == null) {
      factory = new EMFWorkbenchContextFactory();
    }
    return factory;
  }
  
  private static EMFWorkbenchContextFactory createFactoryInstanceFromExtension()
  {
    final EMFWorkbenchContextFactory[] factoryHolder = new EMFWorkbenchContextFactory[1];
    RegistryReader reader = new RegistryReader("org.eclipse.jem.util", "internalWorkbenchContextFactory")
    {
      public boolean readElement(IConfigurationElement element)
      {
        if (element.getName().equals("factoryClass")) {
          try
          {
            factoryHolder[0] = ((EMFWorkbenchContextFactory)element.createExecutableExtension("name"));
            return true;
          }
          catch (CoreException e)
          {
            Logger.getLogger().logError(e);
          }
        }
        return false;
      }
    };
    reader.readRegistry();
    return factoryHolder[0];
  }
  
  protected void cacheEMFContext(IProject aProject, EMFWorkbenchContextBase emfContext)
  {
    if ((aProject != null) && (emfContext != null)) {
      emfContextCache.put(aProject, emfContext);
    }
  }
  
  protected EMFWorkbenchContextBase getCachedEMFContext(IProject aProject)
  {
    if (aProject != null) {
      return (EMFWorkbenchContextBase)emfContextCache.get(aProject);
    }
    return null;
  }
  
  public void removeCachedProject(IProject aProject)
  {
    if (aProject != null) {
      emfContextCache.remove(aProject);
    }
  }
  
  public EMFWorkbenchContextBase createEMFContext(IProject aProject, IEMFContextContributor contributor)
  {
    if (aProject == null) {
      throw new IllegalStateException("[EMFWorkbenchContextBase]" + EMFWorkbenchResourceHandler.getString("EMFWorkbenchContextFactory_UI_0"));
    }
    if (!aProject.isAccessible()) {
      throw new IllegalStateException("[EMFWorkbenchContextBase]" + EMFWorkbenchResourceHandler.getString("EMFWorkbenchContextFactory_UI_1", new Object[] { aProject.getName() }));
    }
    EMFWorkbenchContextBase context = getCachedEMFContext(aProject);
    boolean contributorFound = false;
    if (context == null)
    {
      context = primCreateEMFContext(aProject);
      cacheEMFContext(aProject, context);
      contributorFound = initializeEMFContextFromContributors(aProject, context, contributor);
    }
    if ((contributor != null) && (context != null) && (!contributorFound)) {
      contributor.primaryContributeToContext(context);
    }
    return context;
  }
  
  protected boolean initializeEMFContextFromContributors(IProject aProject, EMFWorkbenchContextBase emfContext, IEMFContextContributor contributor)
  {
    boolean contributorFound = false;
    if ((aProject == null) || (emfContext == null)) {
      return contributorFound;
    }
    List runtimes = EMFNature.getRegisteredRuntimes(aProject);
    for (int i = 0; i < runtimes.size(); i++)
    {
      IProjectNature nature = (IProjectNature)runtimes.get(i);
      if ((nature != null) && (CONTRIBUTOR_CLASS.isInstance(nature)))
      {
        if (nature == contributor) {
          contributorFound = true;
        }
        ((IEMFContextContributor)nature).primaryContributeToContext(emfContext);
      }
    }
    return contributorFound;
  }
  
  protected boolean isNatureEnabled(IProject aProject, String natureId)
  {
    try
    {
      return aProject.isNatureEnabled(natureId);
    }
    catch (CoreException localCoreException) {}
    return false;
  }
  
  protected String[] getNatureIds(IProject aProject)
  {
    try
    {
      if (aProject.isAccessible()) {
        return aProject.getDescription().getNatureIds();
      }
    }
    catch (CoreException localCoreException) {}
    return null;
  }
  
  protected IProjectNature getNature(IProject aProject, String natureId)
  {
    try
    {
      return aProject.getNature(natureId);
    }
    catch (CoreException localCoreException) {}
    return null;
  }
  
  protected EMFWorkbenchContextBase primCreateEMFContext(IProject aProject)
  {
    return new EMFWorkbenchContextBase(aProject);
  }
  
  public EMFWorkbenchContextBase getEMFContext(IProject aProject)
  {
    return getCachedEMFContext(aProject);
  }
  
  public ResourceSetWorkbenchSynchronizer createSynchronizer(ResourceSet aResourceSet, IProject aProject)
  {
    return new ResourceSetWorkbenchSynchronizer(aResourceSet, aProject);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jem.internal.util.emf.workbench.EMFWorkbenchContextFactory
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jem.internal.util.emf.workbench;

import org.eclipse.emf.common.notify.impl.NotificationImpl;

class ProjectResourceSetImpl$1
  extends NotificationImpl
{
  ProjectResourceSetImpl$1(ProjectResourceSetImpl paramProjectResourceSetImpl, int $anonymous0, Object $anonymous1, Object $anonymous2, int $anonymous3, boolean $anonymous4)
  {
    super($anonymous0, $anonymous1, $anonymous2, $anonymous3, $anonymous4);
  }
  
  public int getFeatureID(Class expectedClass)
  {
    return 1000;
  }
  
  public Object getNotifier()
  {
    return this$0;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jem.internal.util.emf.workbench.ProjectResourceSetImpl.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jem.internal.util.emf.workbench;

import java.util.Collection;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EAdapterList;

public class ProjectResourceSetImpl$ESynchronizedAdapterList
  extends BasicNotifierImpl.EAdapterList
{
  private static final long serialVersionUID = 7855438339187540718L;
  
  public ProjectResourceSetImpl$ESynchronizedAdapterList(Notifier notifier)
  {
    super(notifier);
  }
  
  public synchronized boolean add(Object object)
  {
    return super.add(object);
  }
  
  public synchronized void add(int index, Object object)
  {
    super.add(index, object);
  }
  
  public synchronized boolean addAll(Collection collection)
  {
    return super.addAll(collection);
  }
  
  public synchronized boolean remove(Object object)
  {
    return super.remove(object);
  }
  
  public synchronized Object remove(int index)
  {
    return super.remove(index);
  }
  
  public synchronized boolean removeAll(Collection collection)
  {
    return super.removeAll(collection);
  }
  
  public synchronized void clear()
  {
    super.clear();
  }
  
  public synchronized Object set(int index, Object object)
  {
    return super.set(index, object);
  }
  
  public synchronized void move(int newPosition, Object object)
  {
    super.move(newPosition, object);
  }
  
  public synchronized Object move(int newPosition, int oldPosition)
  {
    return super.move(newPosition, oldPosition);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jem.internal.util.emf.workbench.ProjectResourceSetImpl.ESynchronizedAdapterList
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jem.internal.util.emf.workbench;

import java.util.Collection;
import org.eclipse.core.runtime.jobs.ILock;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.ResourcesEList;

public class ProjectResourceSetImpl$ImmutableEList<E,  extends Resource>
  extends ResourceSetImpl.ResourcesEList<E>
  implements EList<E>
{
  private ProjectResourceSetImpl.SynchronizedResourcesEList delegate;
  private static final long serialVersionUID = 1L;
  
  public ProjectResourceSetImpl$ImmutableEList(Collection<? extends E> arg1)
  {
    super(???);
    
    size = collection.size();
    if (size > 0)
    {
      data = newData(size + size / 8 + 1);
      collection.toArray(data);
    }
    delegate = ((ProjectResourceSetImpl.SynchronizedResourcesEList)collection);
  }
  
  public void setData(int size, Object[] data)
  {
    super.setData(size, data);
    delegate.lock.acquire();
    delegate.setData(size, data);
    delegate.lock.release();
  }
  
  public E setUnique(int index, E object)
  {
    super.setUnique(index, object);
    delegate.lock.acquire();
    Object temp = delegate.setUnique(index, object);
    delegate.lock.release();
    return (E)temp;
  }
  
  public void addUnique(E object)
  {
    super.addUnique(object);
    delegate.lock.acquire();
    delegate.addUnique(object);
    delegate.lock.release();
  }
  
  public void addUnique(int index, E object)
  {
    super.addUnique(index, object);
    delegate.lock.acquire();
    delegate.addUnique(index, object);
    delegate.lock.release();
  }
  
  public boolean addAllUnique(Collection<? extends E> collection)
  {
    super.addAllUnique(collection);
    delegate.lock.acquire();
    boolean temp = delegate.addAllUnique(collection);
    delegate.lock.release();
    return temp;
  }
  
  public boolean addAllUnique(int index, Collection<? extends E> collection)
  {
    super.addAllUnique(index, collection);
    delegate.lock.acquire();
    boolean temp = delegate.addAllUnique(index, collection);
    delegate.lock.release();
    return temp;
  }
  
  public boolean addAllUnique(Object[] objects, int start, int end)
  {
    super.addAllUnique(objects, start, end);
    delegate.lock.acquire();
    boolean temp = delegate.addAllUnique(objects, start, end);
    delegate.lock.release();
    return temp;
  }
  
  public boolean addAllUnique(int index, Object[] objects, int start, int end)
  {
    super.addAllUnique(index, objects, start, end);
    delegate.lock.acquire();
    boolean temp = delegate.addAllUnique(index, objects, start, end);
    delegate.lock.release();
    return temp;
  }
  
  public E remove(int index)
  {
    super.remove(index);
    delegate.lock.acquire();
    Object temp = delegate.remove(index);
    delegate.lock.release();
    return (E)temp;
  }
  
  public E move(int targetIndex, int sourceIndex)
  {
    super.move(targetIndex, sourceIndex);
    delegate.lock.acquire();
    Object temp = delegate.move(targetIndex, sourceIndex);
    delegate.lock.release();
    return (E)temp;
  }
  
  public E set(int index, E object)
  {
    super.set(index, object);
    delegate.lock.acquire();
    Object temp = delegate.set(index, object);
    delegate.lock.release();
    return (E)temp;
  }
  
  public boolean add(E object)
  {
    super.add(object);
    delegate.lock.acquire();
    boolean temp = delegate.add(object);
    delegate.lock.release();
    return temp;
  }
  
  public void add(int index, E object)
  {
    super.add(index, object);
    delegate.lock.acquire();
    delegate.add(index, object);
    delegate.lock.release();
  }
  
  public boolean addAll(Collection<? extends E> collection)
  {
    super.addAll(collection);
    delegate.lock.acquire();
    boolean temp = delegate.addAll(collection);
    delegate.lock.release();
    return temp;
  }
  
  public boolean addAll(int index, Collection<? extends E> collection)
  {
    super.addAll(index, collection);
    delegate.lock.acquire();
    boolean temp = delegate.addAll(index, collection);
    delegate.lock.release();
    return temp;
  }
  
  public boolean remove(Object object)
  {
    super.remove(object);
    delegate.lock.acquire();
    boolean temp = delegate.remove(object);
    delegate.lock.release();
    return temp;
  }
  
  public boolean removeAll(Collection<?> collection)
  {
    super.removeAll(collection);
    delegate.lock.acquire();
    boolean temp = delegate.removeAll(collection);
    delegate.lock.release();
    return temp;
  }
  
  public boolean retainAll(Collection<?> collection)
  {
    super.retainAll(collection);
    delegate.lock.acquire();
    boolean temp = delegate.retainAll(collection);
    delegate.lock.release();
    return temp;
  }
  
  public void move(int index, E object)
  {
    super.move(index, object);
    delegate.lock.acquire();
    delegate.move(index, object);
    delegate.lock.release();
  }
  
  public NotificationChain basicAdd(E object, NotificationChain notifications)
  {
    NotificationChain temp = super.basicAdd(object, notifications);
    delegate.lock.acquire();
    delegate.basicAdd(object, notifications);
    delegate.lock.release();
    return temp;
  }
  
  public NotificationChain basicRemove(Object object, NotificationChain notifications)
  {
    NotificationChain temp = super.basicRemove(object, notifications);
    delegate.lock.acquire();
    delegate.basicRemove(object, notifications);
    delegate.lock.release();
    return temp;
  }
  
  public void clear()
  {
    super.clear();
    delegate.lock.acquire();
    delegate.clear();
    delegate.lock.release();
  }
  
  public NotificationChain basicSet(int index, E object, NotificationChain notifications)
  {
    NotificationChain temp = super.basicSet(index, object, notifications);
    delegate.lock.acquire();
    delegate.basicSet(index, object, notifications);
    delegate.lock.release();
    return temp;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jem.internal.util.emf.workbench.ProjectResourceSetImpl.ImmutableEList
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jem.internal.util.emf.workbench;

public abstract interface ProjectResourceSetImpl$ModuleURI
{
  public static final int SUB_PROTOCOL_INDX = 0;
  public static final int PROJECT_NAME_INDX = 1;
  public static final int MODULE_NAME_INDX = 2;
  public static final int CONTENT_TYPE_INDX = 3;
}

/* Location:
 * Qualified Name:     org.eclipse.jem.internal.util.emf.workbench.ProjectResourceSetImpl.ModuleURI
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jem.internal.util.emf.workbench;

import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import org.eclipse.core.runtime.jobs.IJobManager;
import org.eclipse.core.runtime.jobs.ILock;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.ResourcesEList;

public class ProjectResourceSetImpl$SynchronizedResourcesEList<E,  extends Resource>
  extends ResourceSetImpl.ResourcesEList<E>
  implements EList<E>
{
  private static final long serialVersionUID = 1L;
  
  public ProjectResourceSetImpl$SynchronizedResourcesEList(ProjectResourceSetImpl paramProjectResourceSetImpl)
  {
    super(paramProjectResourceSetImpl);
  }
  
  protected final ILock lock = Job.getJobManager().newLock();
  
  /* Error */
  public void copyInto(List list)
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 155	org/eclipse/jem/internal/util/emf/workbench/ProjectResourceSetImpl$SynchronizedResourcesEList:lock	Lorg/eclipse/core/runtime/jobs/ILock;
    //   4: invokeinterface 190 1 0
    //   9: aload_1
    //   10: aload_0
    //   11: invokeinterface 187 2 0
    //   16: pop
    //   17: goto +15 -> 32
    //   20: astore_2
    //   21: aload_0
    //   22: getfield 155	org/eclipse/jem/internal/util/emf/workbench/ProjectResourceSetImpl$SynchronizedResourcesEList:lock	Lorg/eclipse/core/runtime/jobs/ILock;
    //   25: invokeinterface 191 1 0
    //   30: aload_2
    //   31: athrow
    //   32: aload_0
    //   33: getfield 155	org/eclipse/jem/internal/util/emf/workbench/ProjectResourceSetImpl$SynchronizedResourcesEList:lock	Lorg/eclipse/core/runtime/jobs/ILock;
    //   36: invokeinterface 191 1 0
    //   41: return
    // Line number table:
    //   Java source line #296	-> byte code offset #0
    //   Java source line #297	-> byte code offset #9
    //   Java source line #298	-> byte code offset #20
    //   Java source line #299	-> byte code offset #21
    //   Java source line #300	-> byte code offset #30
    //   Java source line #299	-> byte code offset #32
    //   Java source line #301	-> byte code offset #41
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	42	0	this	SynchronizedResourcesEList<E>
    //   0	42	1	list	List
    //   20	11	2	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   0	20	20	finally
  }
  
  /* Error */
  public void move(int newPosition, E object)
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 155	org/eclipse/jem/internal/util/emf/workbench/ProjectResourceSetImpl$SynchronizedResourcesEList:lock	Lorg/eclipse/core/runtime/jobs/ILock;
    //   4: invokeinterface 190 1 0
    //   9: aload_0
    //   10: iload_1
    //   11: aload_2
    //   12: invokespecial 167	org/eclipse/emf/ecore/resource/impl/ResourceSetImpl$ResourcesEList:move	(ILjava/lang/Object;)V
    //   15: goto +15 -> 30
    //   18: astore_3
    //   19: aload_0
    //   20: getfield 155	org/eclipse/jem/internal/util/emf/workbench/ProjectResourceSetImpl$SynchronizedResourcesEList:lock	Lorg/eclipse/core/runtime/jobs/ILock;
    //   23: invokeinterface 191 1 0
    //   28: aload_3
    //   29: athrow
    //   30: aload_0
    //   31: getfield 155	org/eclipse/jem/internal/util/emf/workbench/ProjectResourceSetImpl$SynchronizedResourcesEList:lock	Lorg/eclipse/core/runtime/jobs/ILock;
    //   34: invokeinterface 191 1 0
    //   39: return
    // Line number table:
    //   Java source line #306	-> byte code offset #0
    //   Java source line #307	-> byte code offset #9
    //   Java source line #308	-> byte code offset #18
    //   Java source line #309	-> byte code offset #19
    //   Java source line #310	-> byte code offset #28
    //   Java source line #309	-> byte code offset #30
    //   Java source line #311	-> byte code offset #39
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	40	0	this	SynchronizedResourcesEList<E>
    //   0	40	1	newPosition	int
    //   0	40	2	object	E
    //   18	11	3	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   0	18	18	finally
  }
  
  public E move(int newPosition, int oldPosition)
  {
    try
    {
      lock.acquire();
      return (E)super.move(newPosition, oldPosition);
    }
    finally
    {
      lock.release();
    }
  }
  
  public boolean add(E o)
  {
    try
    {
      lock.acquire();
      return super.add(o);
    }
    finally
    {
      lock.release();
    }
  }
  
  /* Error */
  public void add(int index, E element)
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 155	org/eclipse/jem/internal/util/emf/workbench/ProjectResourceSetImpl$SynchronizedResourcesEList:lock	Lorg/eclipse/core/runtime/jobs/ILock;
    //   4: invokeinterface 190 1 0
    //   9: aload_0
    //   10: iload_1
    //   11: aload_2
    //   12: invokespecial 166	org/eclipse/emf/ecore/resource/impl/ResourceSetImpl$ResourcesEList:add	(ILjava/lang/Object;)V
    //   15: goto +15 -> 30
    //   18: astore_3
    //   19: aload_0
    //   20: getfield 155	org/eclipse/jem/internal/util/emf/workbench/ProjectResourceSetImpl$SynchronizedResourcesEList:lock	Lorg/eclipse/core/runtime/jobs/ILock;
    //   23: invokeinterface 191 1 0
    //   28: aload_3
    //   29: athrow
    //   30: aload_0
    //   31: getfield 155	org/eclipse/jem/internal/util/emf/workbench/ProjectResourceSetImpl$SynchronizedResourcesEList:lock	Lorg/eclipse/core/runtime/jobs/ILock;
    //   34: invokeinterface 191 1 0
    //   39: return
    // Line number table:
    //   Java source line #336	-> byte code offset #0
    //   Java source line #337	-> byte code offset #9
    //   Java source line #338	-> byte code offset #18
    //   Java source line #339	-> byte code offset #19
    //   Java source line #340	-> byte code offset #28
    //   Java source line #339	-> byte code offset #30
    //   Java source line #341	-> byte code offset #39
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	40	0	this	SynchronizedResourcesEList<E>
    //   0	40	1	index	int
    //   0	40	2	element	E
    //   18	11	3	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   0	18	18	finally
  }
  
  public boolean addAll(Collection<? extends E> c)
  {
    try
    {
      lock.acquire();
      return super.addAll(c);
    }
    finally
    {
      lock.release();
    }
  }
  
  public boolean addAll(int index, Collection<? extends E> c)
  {
    try
    {
      lock.acquire();
      return super.addAll(index, c);
    }
    finally
    {
      lock.release();
    }
  }
  
  /* Error */
  public void clear()
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 155	org/eclipse/jem/internal/util/emf/workbench/ProjectResourceSetImpl$SynchronizedResourcesEList:lock	Lorg/eclipse/core/runtime/jobs/ILock;
    //   4: invokeinterface 190 1 0
    //   9: aload_0
    //   10: invokespecial 160	org/eclipse/emf/ecore/resource/impl/ResourceSetImpl$ResourcesEList:clear	()V
    //   13: goto +15 -> 28
    //   16: astore_1
    //   17: aload_0
    //   18: getfield 155	org/eclipse/jem/internal/util/emf/workbench/ProjectResourceSetImpl$SynchronizedResourcesEList:lock	Lorg/eclipse/core/runtime/jobs/ILock;
    //   21: invokeinterface 191 1 0
    //   26: aload_1
    //   27: athrow
    //   28: aload_0
    //   29: getfield 155	org/eclipse/jem/internal/util/emf/workbench/ProjectResourceSetImpl$SynchronizedResourcesEList:lock	Lorg/eclipse/core/runtime/jobs/ILock;
    //   32: invokeinterface 191 1 0
    //   37: return
    // Line number table:
    //   Java source line #366	-> byte code offset #0
    //   Java source line #367	-> byte code offset #9
    //   Java source line #368	-> byte code offset #16
    //   Java source line #369	-> byte code offset #17
    //   Java source line #370	-> byte code offset #26
    //   Java source line #369	-> byte code offset #28
    //   Java source line #371	-> byte code offset #37
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	38	0	this	SynchronizedResourcesEList<E>
    //   16	11	1	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   0	16	16	finally
  }
  
  public boolean contains(Object o)
  {
    try
    {
      lock.acquire();
      return super.contains(o);
    }
    finally
    {
      lock.release();
    }
  }
  
  public boolean containsAll(Collection<?> c)
  {
    try
    {
      lock.acquire();
      return super.containsAll(c);
    }
    finally
    {
      lock.release();
    }
  }
  
  public boolean equals(Object o)
  {
    try
    {
      lock.acquire();
      return super.equals(o);
    }
    finally
    {
      lock.release();
    }
  }
  
  public E get(int index)
  {
    try
    {
      lock.acquire();
      return (E)super.get(index);
    }
    finally
    {
      lock.release();
    }
  }
  
  public int hashCode()
  {
    try
    {
      lock.acquire();
      return super.hashCode();
    }
    finally
    {
      lock.release();
    }
  }
  
  public int indexOf(Object o)
  {
    try
    {
      lock.acquire();
      return super.indexOf(o);
    }
    finally
    {
      lock.release();
    }
  }
  
  public boolean isEmpty()
  {
    try
    {
      lock.acquire();
      return super.isEmpty();
    }
    finally
    {
      lock.release();
    }
  }
  
  public Iterator<E> iterator()
  {
    try
    {
      lock.acquire();
      return super.iterator();
    }
    finally
    {
      lock.release();
    }
  }
  
  public int lastIndexOf(Object o)
  {
    try
    {
      lock.acquire();
      return super.lastIndexOf(o);
    }
    finally
    {
      lock.release();
    }
  }
  
  public ListIterator<E> listIterator()
  {
    try
    {
      lock.acquire();
      return super.listIterator();
    }
    finally
    {
      lock.release();
    }
  }
  
  public ListIterator<E> listIterator(int index)
  {
    try
    {
      lock.acquire();
      return super.listIterator(index);
    }
    finally
    {
      lock.release();
    }
  }
  
  public boolean remove(Object o)
  {
    try
    {
      lock.acquire();
      return super.remove(o);
    }
    finally
    {
      lock.release();
    }
  }
  
  public E remove(int index)
  {
    try
    {
      lock.acquire();
      return (E)super.remove(index);
    }
    finally
    {
      lock.release();
    }
  }
  
  public boolean removeAll(Collection<?> c)
  {
    try
    {
      lock.acquire();
      return super.removeAll(c);
    }
    finally
    {
      lock.release();
    }
  }
  
  public boolean retainAll(Collection<?> c)
  {
    try
    {
      lock.acquire();
      return super.retainAll(c);
    }
    finally
    {
      lock.release();
    }
  }
  
  public E set(int index, E element)
  {
    try
    {
      lock.acquire();
      return (E)super.set(index, element);
    }
    finally
    {
      lock.release();
    }
  }
  
  public int size()
  {
    try
    {
      lock.acquire();
      return super.size();
    }
    finally
    {
      lock.release();
    }
  }
  
  public List<E> subList(int fromIndex, int toIndex)
  {
    try
    {
      lock.acquire();
      return super.subList(fromIndex, toIndex);
    }
    finally
    {
      lock.release();
    }
  }
  
  public Object[] toArray()
  {
    try
    {
      lock.acquire();
      return super.toArray();
    }
    finally
    {
      lock.release();
    }
  }
  
  public <T> T[] toArray(T[] a)
  {
    try
    {
      lock.acquire();
      return super.toArray(a);
    }
    finally
    {
      lock.release();
    }
  }
  
  /* Error */
  protected void dispatchNotification(org.eclipse.emf.common.notify.Notification notification)
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 155	org/eclipse/jem/internal/util/emf/workbench/ProjectResourceSetImpl$SynchronizedResourcesEList:lock	Lorg/eclipse/core/runtime/jobs/ILock;
    //   4: invokeinterface 189 1 0
    //   9: istore_2
    //   10: iconst_0
    //   11: istore_3
    //   12: goto +15 -> 27
    //   15: aload_0
    //   16: getfield 155	org/eclipse/jem/internal/util/emf/workbench/ProjectResourceSetImpl$SynchronizedResourcesEList:lock	Lorg/eclipse/core/runtime/jobs/ILock;
    //   19: invokeinterface 191 1 0
    //   24: iinc 3 1
    //   27: iload_3
    //   28: iload_2
    //   29: if_icmplt -14 -> 15
    //   32: aload_0
    //   33: aload_1
    //   34: invokespecial 183	org/eclipse/emf/ecore/resource/impl/ResourceSetImpl$ResourcesEList:dispatchNotification	(Lorg/eclipse/emf/common/notify/Notification;)V
    //   37: goto +32 -> 69
    //   40: astore 4
    //   42: iconst_0
    //   43: istore 5
    //   45: goto +15 -> 60
    //   48: aload_0
    //   49: getfield 155	org/eclipse/jem/internal/util/emf/workbench/ProjectResourceSetImpl$SynchronizedResourcesEList:lock	Lorg/eclipse/core/runtime/jobs/ILock;
    //   52: invokeinterface 190 1 0
    //   57: iinc 5 1
    //   60: iload 5
    //   62: iload_2
    //   63: if_icmplt -15 -> 48
    //   66: aload 4
    //   68: athrow
    //   69: iconst_0
    //   70: istore 5
    //   72: goto +15 -> 87
    //   75: aload_0
    //   76: getfield 155	org/eclipse/jem/internal/util/emf/workbench/ProjectResourceSetImpl$SynchronizedResourcesEList:lock	Lorg/eclipse/core/runtime/jobs/ILock;
    //   79: invokeinterface 190 1 0
    //   84: iinc 5 1
    //   87: iload 5
    //   89: iload_2
    //   90: if_icmplt -15 -> 75
    //   93: return
    // Line number table:
    //   Java source line #577	-> byte code offset #0
    //   Java source line #579	-> byte code offset #10
    //   Java source line #580	-> byte code offset #15
    //   Java source line #579	-> byte code offset #24
    //   Java source line #581	-> byte code offset #32
    //   Java source line #582	-> byte code offset #40
    //   Java source line #583	-> byte code offset #42
    //   Java source line #584	-> byte code offset #48
    //   Java source line #583	-> byte code offset #57
    //   Java source line #585	-> byte code offset #66
    //   Java source line #583	-> byte code offset #69
    //   Java source line #584	-> byte code offset #75
    //   Java source line #583	-> byte code offset #84
    //   Java source line #586	-> byte code offset #93
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	94	0	this	SynchronizedResourcesEList<E>
    //   0	94	1	notification	org.eclipse.emf.common.notify.Notification
    //   9	81	2	lockDepth	int
    //   11	17	3	i	int
    //   40	27	4	localObject	Object
    //   43	18	5	i	int
    //   70	18	5	i	int
    // Exception table:
    //   from	to	target	type
    //   10	40	40	finally
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jem.internal.util.emf.workbench.ProjectResourceSetImpl.SynchronizedResourcesEList
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jem.internal.util.emf.workbench;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.content.IContentDescription;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.core.runtime.content.IContentTypeManager;
import org.eclipse.core.runtime.jobs.IJobManager;
import org.eclipse.core.runtime.jobs.ILock;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EAdapterList;
import org.eclipse.emf.common.notify.impl.NotificationImpl;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.Resource.Factory;
import org.eclipse.emf.ecore.resource.Resource.Factory.Registry;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.URIConverter;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.ResourcesEList;
import org.eclipse.emf.ecore.resource.impl.URIConverterImpl.URIMap;
import org.eclipse.jem.util.emf.workbench.FlexibleProjectResourceSet;
import org.eclipse.jem.util.emf.workbench.ResourceHandler;
import org.eclipse.jem.util.emf.workbench.ResourceSetWorkbenchSynchronizer;
import org.eclipse.jem.util.emf.workbench.WorkbenchResourceHelperBase;
import org.eclipse.jem.util.emf.workbench.nature.EMFNature;
import org.eclipse.jem.util.logger.proxy.Logger;
import org.eclipse.jem.util.plugin.JEMUtilPlugin;

public class ProjectResourceSetImpl
  extends ResourceSetImpl
  implements FlexibleProjectResourceSet
{
  public class ImmutableEList<E,  extends Resource>
    extends ResourceSetImpl.ResourcesEList<E>
    implements EList<E>
  {
    private ProjectResourceSetImpl.SynchronizedResourcesEList delegate;
    private static final long serialVersionUID = 1L;
    
    public ImmutableEList()
    {
      super();
      
      size = collection.size();
      if (size > 0)
      {
        data = newData(size + size / 8 + 1);
        collection.toArray(data);
      }
      delegate = ((ProjectResourceSetImpl.SynchronizedResourcesEList)collection);
    }
    
    public void setData(int size, Object[] data)
    {
      super.setData(size, data);
      delegate.lock.acquire();
      delegate.setData(size, data);
      delegate.lock.release();
    }
    
    public E setUnique(int index, E object)
    {
      super.setUnique(index, object);
      delegate.lock.acquire();
      Object temp = delegate.setUnique(index, object);
      delegate.lock.release();
      return (E)temp;
    }
    
    public void addUnique(E object)
    {
      super.addUnique(object);
      delegate.lock.acquire();
      delegate.addUnique(object);
      delegate.lock.release();
    }
    
    public void addUnique(int index, E object)
    {
      super.addUnique(index, object);
      delegate.lock.acquire();
      delegate.addUnique(index, object);
      delegate.lock.release();
    }
    
    public boolean addAllUnique(Collection<? extends E> collection)
    {
      super.addAllUnique(collection);
      delegate.lock.acquire();
      boolean temp = delegate.addAllUnique(collection);
      delegate.lock.release();
      return temp;
    }
    
    public boolean addAllUnique(int index, Collection<? extends E> collection)
    {
      super.addAllUnique(index, collection);
      delegate.lock.acquire();
      boolean temp = delegate.addAllUnique(index, collection);
      delegate.lock.release();
      return temp;
    }
    
    public boolean addAllUnique(Object[] objects, int start, int end)
    {
      super.addAllUnique(objects, start, end);
      delegate.lock.acquire();
      boolean temp = delegate.addAllUnique(objects, start, end);
      delegate.lock.release();
      return temp;
    }
    
    public boolean addAllUnique(int index, Object[] objects, int start, int end)
    {
      super.addAllUnique(index, objects, start, end);
      delegate.lock.acquire();
      boolean temp = delegate.addAllUnique(index, objects, start, end);
      delegate.lock.release();
      return temp;
    }
    
    public E remove(int index)
    {
      super.remove(index);
      delegate.lock.acquire();
      Object temp = delegate.remove(index);
      delegate.lock.release();
      return (E)temp;
    }
    
    public E move(int targetIndex, int sourceIndex)
    {
      super.move(targetIndex, sourceIndex);
      delegate.lock.acquire();
      Object temp = delegate.move(targetIndex, sourceIndex);
      delegate.lock.release();
      return (E)temp;
    }
    
    public E set(int index, E object)
    {
      super.set(index, object);
      delegate.lock.acquire();
      Object temp = delegate.set(index, object);
      delegate.lock.release();
      return (E)temp;
    }
    
    public boolean add(E object)
    {
      super.add(object);
      delegate.lock.acquire();
      boolean temp = delegate.add(object);
      delegate.lock.release();
      return temp;
    }
    
    public void add(int index, E object)
    {
      super.add(index, object);
      delegate.lock.acquire();
      delegate.add(index, object);
      delegate.lock.release();
    }
    
    public boolean addAll(Collection<? extends E> collection)
    {
      super.addAll(collection);
      delegate.lock.acquire();
      boolean temp = delegate.addAll(collection);
      delegate.lock.release();
      return temp;
    }
    
    public boolean addAll(int index, Collection<? extends E> collection)
    {
      super.addAll(index, collection);
      delegate.lock.acquire();
      boolean temp = delegate.addAll(index, collection);
      delegate.lock.release();
      return temp;
    }
    
    public boolean remove(Object object)
    {
      super.remove(object);
      delegate.lock.acquire();
      boolean temp = delegate.remove(object);
      delegate.lock.release();
      return temp;
    }
    
    public boolean removeAll(Collection<?> collection)
    {
      super.removeAll(collection);
      delegate.lock.acquire();
      boolean temp = delegate.removeAll(collection);
      delegate.lock.release();
      return temp;
    }
    
    public boolean retainAll(Collection<?> collection)
    {
      super.retainAll(collection);
      delegate.lock.acquire();
      boolean temp = delegate.retainAll(collection);
      delegate.lock.release();
      return temp;
    }
    
    public void move(int index, E object)
    {
      super.move(index, object);
      delegate.lock.acquire();
      delegate.move(index, object);
      delegate.lock.release();
    }
    
    public NotificationChain basicAdd(E object, NotificationChain notifications)
    {
      NotificationChain temp = super.basicAdd(object, notifications);
      delegate.lock.acquire();
      delegate.basicAdd(object, notifications);
      delegate.lock.release();
      return temp;
    }
    
    public NotificationChain basicRemove(Object object, NotificationChain notifications)
    {
      NotificationChain temp = super.basicRemove(object, notifications);
      delegate.lock.acquire();
      delegate.basicRemove(object, notifications);
      delegate.lock.release();
      return temp;
    }
    
    public void clear()
    {
      super.clear();
      delegate.lock.acquire();
      delegate.clear();
      delegate.lock.release();
    }
    
    public NotificationChain basicSet(int index, E object, NotificationChain notifications)
    {
      NotificationChain temp = super.basicSet(index, object, notifications);
      delegate.lock.acquire();
      delegate.basicSet(index, object, notifications);
      delegate.lock.release();
      return temp;
    }
  }
  
  public class SynchronizedResourcesEList<E,  extends Resource>
    extends ResourceSetImpl.ResourcesEList<E>
    implements EList<E>
  {
    private static final long serialVersionUID = 1L;
    
    public SynchronizedResourcesEList()
    {
      super();
    }
    
    protected final ILock lock = Job.getJobManager().newLock();
    
    /* Error */
    public void copyInto(List list)
    {
      // Byte code:
  
1 2 3 4 5 6 7

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