org.eclipse.team.core_3.6.0.I20110525-0800

/DiffChangeSet:tree	Lorg/eclipse/team/core/mapping/provider/ResourceDiffTree;
    //   50: aconst_null
    //   51: invokevirtual 97	org/eclipse/team/core/mapping/provider/ResourceDiffTree:endInput	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   54: return
    // Line number table:
    //   Java source line #97	-> byte code offset #0
    //   Java source line #98	-> byte code offset #7
    //   Java source line #99	-> byte code offset #12
    //   Java source line #100	-> byte code offset #16
    //   Java source line #98	-> byte code offset #21
    //   Java source line #102	-> byte code offset #33
    //   Java source line #103	-> byte code offset #35
    //   Java source line #104	-> byte code offset #43
    //   Java source line #103	-> byte code offset #46
    //   Java source line #105	-> byte code offset #54
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	55	0	this	DiffChangeSet
    //   0	55	1	diffs	IDiff[]
    //   8	17	2	i	int
    //   15	3	3	diff	IDiff
    //   33	11	4	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   0	33	33	finally
  }
  
  public void remove(IResource resource)
  {
    if (contains(resource)) {
      tree.remove(resource);
    }
  }
  
  /* Error */
  public void rootRemoved(IResource resource, int depth)
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 90	org/eclipse/team/internal/core/subscribers/DiffChangeSet:tree	Lorg/eclipse/team/core/mapping/provider/ResourceDiffTree;
    //   4: aload_1
    //   5: iload_2
    //   6: invokevirtual 101	org/eclipse/team/core/mapping/provider/ResourceDiffTree:getDiffs	(Lorg/eclipse/core/resources/IResource;I)[Lorg/eclipse/team/core/diff/IDiff;
    //   9: astore_3
    //   10: aload_3
    //   11: arraylength
    //   12: ifle +81 -> 93
    //   15: aload_0
    //   16: getfield 90	org/eclipse/team/internal/core/subscribers/DiffChangeSet:tree	Lorg/eclipse/team/core/mapping/provider/ResourceDiffTree;
    //   19: invokevirtual 92	org/eclipse/team/core/mapping/provider/ResourceDiffTree:beginInput	()V
    //   22: iconst_0
    //   23: istore 4
    //   25: goto +37 -> 62
    //   28: aload_3
    //   29: iload 4
    //   31: aaload
    //   32: astore 5
    //   34: aload_0
    //   35: getfield 90	org/eclipse/team/internal/core/subscribers/DiffChangeSet:tree	Lorg/eclipse/team/core/mapping/provider/ResourceDiffTree;
    //   38: aload 5
    //   40: invokevirtual 99	org/eclipse/team/core/mapping/provider/ResourceDiffTree:getResource	(Lorg/eclipse/team/core/diff/IDiff;)Lorg/eclipse/core/resources/IResource;
    //   43: astore 6
    //   45: aload 6
    //   47: ifnull +12 -> 59
    //   50: aload_0
    //   51: getfield 90	org/eclipse/team/internal/core/subscribers/DiffChangeSet:tree	Lorg/eclipse/team/core/mapping/provider/ResourceDiffTree;
    //   54: aload 6
    //   56: invokevirtual 95	org/eclipse/team/core/mapping/provider/ResourceDiffTree:remove	(Lorg/eclipse/core/resources/IResource;)V
    //   59: iinc 4 1
    //   62: iload 4
    //   64: aload_3
    //   65: arraylength
    //   66: if_icmplt -38 -> 28
    //   69: goto +16 -> 85
    //   72: astore 7
    //   74: aload_0
    //   75: getfield 90	org/eclipse/team/internal/core/subscribers/DiffChangeSet:tree	Lorg/eclipse/team/core/mapping/provider/ResourceDiffTree;
    //   78: aconst_null
    //   79: invokevirtual 97	org/eclipse/team/core/mapping/provider/ResourceDiffTree:endInput	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   82: aload 7
    //   84: athrow
    //   85: aload_0
    //   86: getfield 90	org/eclipse/team/internal/core/subscribers/DiffChangeSet:tree	Lorg/eclipse/team/core/mapping/provider/ResourceDiffTree;
    //   89: aconst_null
    //   90: invokevirtual 97	org/eclipse/team/core/mapping/provider/ResourceDiffTree:endInput	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   93: return
    // Line number table:
    //   Java source line #124	-> byte code offset #0
    //   Java source line #125	-> byte code offset #10
    //   Java source line #127	-> byte code offset #15
    //   Java source line #128	-> byte code offset #22
    //   Java source line #129	-> byte code offset #28
    //   Java source line #130	-> byte code offset #34
    //   Java source line #131	-> byte code offset #45
    //   Java source line #132	-> byte code offset #50
    //   Java source line #128	-> byte code offset #59
    //   Java source line #134	-> byte code offset #72
    //   Java source line #135	-> byte code offset #74
    //   Java source line #136	-> byte code offset #82
    //   Java source line #135	-> byte code offset #85
    //   Java source line #138	-> byte code offset #93
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	94	0	this	DiffChangeSet
    //   0	94	1	resource	IResource
    //   0	94	2	depth	int
    //   9	56	3	diffs	IDiff[]
    //   23	40	4	i	int
    //   32	7	5	diff	IDiff
    //   43	12	6	r	IResource
    //   72	11	7	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   15	72	72	finally
  }
  
  public boolean contains(IPath path)
  {
    return getDiffTree().getDiff(path) != null;
  }
  
  public boolean containsChildren(IResource resource, int depth)
  {
    return getDiffTree().getDiffs(resource, depth).length > 0;
  }
  
  /* Error */
  public void remove(IPath[] paths)
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 90	org/eclipse/team/internal/core/subscribers/DiffChangeSet:tree	Lorg/eclipse/team/core/mapping/provider/ResourceDiffTree;
    //   4: invokevirtual 92	org/eclipse/team/core/mapping/provider/ResourceDiffTree:beginInput	()V
    //   7: iconst_0
    //   8: istore_2
    //   9: goto +18 -> 27
    //   12: aload_1
    //   13: iload_2
    //   14: aaload
    //   15: astore_3
    //   16: aload_0
    //   17: getfield 90	org/eclipse/team/internal/core/subscribers/DiffChangeSet:tree	Lorg/eclipse/team/core/mapping/provider/ResourceDiffTree;
    //   20: aload_3
    //   21: invokevirtual 96	org/eclipse/team/core/mapping/provider/ResourceDiffTree:remove	(Lorg/eclipse/core/runtime/IPath;)V
    //   24: iinc 2 1
    //   27: iload_2
    //   28: aload_1
    //   29: arraylength
    //   30: if_icmplt -18 -> 12
    //   33: goto +16 -> 49
    //   36: astore 4
    //   38: aload_0
    //   39: getfield 90	org/eclipse/team/internal/core/subscribers/DiffChangeSet:tree	Lorg/eclipse/team/core/mapping/provider/ResourceDiffTree;
    //   42: aconst_null
    //   43: invokevirtual 97	org/eclipse/team/core/mapping/provider/ResourceDiffTree:endInput	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   46: aload 4
    //   48: athrow
    //   49: aload_0
    //   50: getfield 90	org/eclipse/team/internal/core/subscribers/DiffChangeSet:tree	Lorg/eclipse/team/core/mapping/provider/ResourceDiffTree;
    //   53: aconst_null
    //   54: invokevirtual 97	org/eclipse/team/core/mapping/provider/ResourceDiffTree:endInput	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   57: return
    // Line number table:
    //   Java source line #150	-> byte code offset #0
    //   Java source line #151	-> byte code offset #7
    //   Java source line #152	-> byte code offset #12
    //   Java source line #153	-> byte code offset #16
    //   Java source line #151	-> byte code offset #24
    //   Java source line #155	-> byte code offset #36
    //   Java source line #156	-> byte code offset #38
    //   Java source line #157	-> byte code offset #46
    //   Java source line #156	-> byte code offset #49
    //   Java source line #158	-> byte code offset #57
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	58	0	this	DiffChangeSet
    //   0	58	1	paths	IPath[]
    //   8	20	2	i	int
    //   15	6	3	path	IPath
    //   36	11	4	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   0	36	36	finally
  }
  
  /* Error */
  public void remove(IResource[] resources)
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 90	org/eclipse/team/internal/core/subscribers/DiffChangeSet:tree	Lorg/eclipse/team/core/mapping/provider/ResourceDiffTree;
    //   4: invokevirtual 92	org/eclipse/team/core/mapping/provider/ResourceDiffTree:beginInput	()V
    //   7: iconst_0
    //   8: istore_2
    //   9: goto +18 -> 27
    //   12: aload_1
    //   13: iload_2
    //   14: aaload
    //   15: astore_3
    //   16: aload_0
    //   17: getfield 90	org/eclipse/team/internal/core/subscribers/DiffChangeSet:tree	Lorg/eclipse/team/core/mapping/provider/ResourceDiffTree;
    //   20: aload_3
    //   21: invokevirtual 95	org/eclipse/team/core/mapping/provider/ResourceDiffTree:remove	(Lorg/eclipse/core/resources/IResource;)V
    //   24: iinc 2 1
    //   27: iload_2
    //   28: aload_1
    //   29: arraylength
    //   30: if_icmplt -18 -> 12
    //   33: goto +16 -> 49
    //   36: astore 4
    //   38: aload_0
    //   39: getfield 90	org/eclipse/team/internal/core/subscribers/DiffChangeSet:tree	Lorg/eclipse/team/core/mapping/provider/ResourceDiffTree;
    //   42: aconst_null
    //   43: invokevirtual 97	org/eclipse/team/core/mapping/provider/ResourceDiffTree:endInput	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   46: aload 4
    //   48: athrow
    //   49: aload_0
    //   50: getfield 90	org/eclipse/team/internal/core/subscribers/DiffChangeSet:tree	Lorg/eclipse/team/core/mapping/provider/ResourceDiffTree;
    //   53: aconst_null
    //   54: invokevirtual 97	org/eclipse/team/core/mapping/provider/ResourceDiffTree:endInput	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   57: return
    // Line number table:
    //   Java source line #162	-> byte code offset #0
    //   Java source line #163	-> byte code offset #7
    //   Java source line #164	-> byte code offset #12
    //   Java source line #165	-> byte code offset #16
    //   Java source line #163	-> byte code offset #24
    //   Java source line #167	-> byte code offset #36
    //   Java source line #168	-> byte code offset #38
    //   Java source line #169	-> byte code offset #46
    //   Java source line #168	-> byte code offset #49
    //   Java source line #170	-> byte code offset #57
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	58	0	this	DiffChangeSet
    //   0	58	1	resources	IResource[]
    //   8	20	2	i	int
    //   15	6	3	resource	IResource
    //   36	11	4	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   0	36	36	finally
  }
  
  public String getComment()
  {
    return null;
  }
}

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

import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import org.eclipse.team.core.diff.IDiff;
import org.eclipse.team.core.diff.IThreeWayDiff;
import org.eclipse.team.core.synchronize.SyncInfo;

public class DiffTreeStatistics
{
  protected Map stats = Collections.synchronizedMap(new HashMap());
  
  public void add(int state)
  {
    Long count = (Long)stats.get(new Integer(state));
    if (count == null) {
      count = new Long(0L);
    }
    stats.put(new Integer(state), new Long(count.longValue() + 1L));
  }
  
  public void remove(int state)
  {
    Integer kind = new Integer(state);
    Long count = (Long)stats.get(kind);
    if (count != null)
    {
      long newCount = count.intValue() - 1;
      if (newCount > 0L) {
        stats.put(kind, new Long(newCount));
      } else {
        stats.remove(kind);
      }
    }
  }
  
  public long countFor(int state, int mask)
  {
    if (mask == 0)
    {
      Long count = (Long)stats.get(new Integer(state));
      return count == null ? 0L : count.longValue();
    }
    Set keySet = stats.keySet();
    long count = 0L;
    synchronized (stats)
    {
      Iterator it = keySet.iterator();
      while (it.hasNext())
      {
        Integer key = (Integer)it.next();
        if ((key.intValue() & mask) == state) {
          count += ((Long)stats.get(key)).intValue();
        }
      }
    }
    return count;
  }
  
  public void clear()
  {
    stats.clear();
  }
  
  public String toString()
  {
    StringBuffer out = new StringBuffer();
    Iterator it = stats.keySet().iterator();
    while (it.hasNext())
    {
      Integer kind = (Integer)it.next();
      out.append(SyncInfo.kindToString(kind.intValue()) + ": " + stats.get(kind) + "\n");
    }
    return out.toString();
  }
  
  public void add(IDiff delta)
  {
    int state = getState(delta);
    add(state);
  }
  
  public void remove(IDiff delta)
  {
    int state = getState(delta);
    remove(state);
  }
  
  private int getState(IDiff delta)
  {
    int state = delta.getKind();
    if ((delta instanceof IThreeWayDiff))
    {
      IThreeWayDiff twd = (IThreeWayDiff)delta;
      state |= twd.getDirection();
    }
    return state;
  }
}

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

import org.eclipse.core.runtime.IPath;

public abstract interface IChangeSetChangeListener
{
  public abstract void setAdded(ChangeSet paramChangeSet);
  
  public abstract void defaultSetChanged(ChangeSet paramChangeSet1, ChangeSet paramChangeSet2);
  
  public abstract void setRemoved(ChangeSet paramChangeSet);
  
  public abstract void nameChanged(ChangeSet paramChangeSet);
  
  public abstract void resourcesChanged(ChangeSet paramChangeSet, IPath[] paramArrayOfIPath);
}

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

import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.resources.mapping.ResourceMapping;
import org.eclipse.core.resources.mapping.ResourceMappingContext;
import org.eclipse.core.resources.mapping.ResourceTraversal;
import org.eclipse.team.core.mapping.ISynchronizationScope;
import org.eclipse.team.internal.core.mapping.AbstractResourceMappingScope;

public class RootResourceSynchronizationScope
  extends AbstractResourceMappingScope
{
  private IResource[] roots;
  
  public RootResourceSynchronizationScope(IResource[] roots)
  {
    this.roots = roots;
  }
  
  public ResourceTraversal[] getTraversals()
  {
    return new ResourceTraversal[] { new ResourceTraversal(roots, 2, 0) };
  }
  
  public void setRoots(IResource[] roots)
  {
    this.roots = roots;
    fireTraversalsChangedEvent(getTraversals(), getMappings());
  }
  
  public ResourceMapping[] getInputMappings()
  {
    return getMappings();
  }
  
  public ISynchronizationScope asInputScope()
  {
    return this;
  }
  
  public ResourceMapping[] getMappings()
  {
    List result = new ArrayList();
    for (int i = 0; i < roots.length; i++)
    {
      IResource resource = roots[i];
      Object o = resource.getAdapter(ResourceMapping.class);
      if ((o instanceof ResourceMapping)) {
        result.add(o);
      }
    }
    return (ResourceMapping[])result.toArray(new ResourceMapping[result.size()]);
  }
  
  public ResourceTraversal[] getTraversals(ResourceMapping mapping)
  {
    Object object = mapping.getModelObject();
    if ((object instanceof IResource))
    {
      IResource resource = (IResource)object;
      return new ResourceTraversal[] { new ResourceTraversal(new IResource[] { resource }, 2, 0) };
    }
    return null;
  }
  
  public boolean hasAdditionalMappings()
  {
    return false;
  }
  
  public boolean hasAdditonalResources()
  {
    return false;
  }
  
  public IProject[] getProjects()
  {
    return ResourcesPlugin.getWorkspace().getRoot().getProjects();
  }
  
  public ResourceMappingContext getContext()
  {
    return ResourceMappingContext.LOCAL_CONTEXT;
  }
  
  public void refresh(ResourceMapping[] mappings) {}
}

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

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.team.core.diff.IDiff;
import org.eclipse.team.core.mapping.provider.ResourceDiffTree;
import org.eclipse.team.core.subscribers.Subscriber;
import org.eclipse.team.internal.core.BackgroundEventHandler;
import org.eclipse.team.internal.core.BackgroundEventHandler.Event;
import org.eclipse.team.internal.core.Messages;
import org.eclipse.team.internal.core.Policy;
import org.eclipse.team.internal.core.TeamPlugin;

class SubscriberChangeSetManager$EventHandler
  extends BackgroundEventHandler
{
  private List dispatchEvents;
  final SubscriberChangeSetManager this$0;
  
  protected SubscriberChangeSetManager$EventHandler(SubscriberChangeSetManager paramSubscriberChangeSetManager, String jobName, String errorTitle)
  {
    super(jobName, errorTitle);this$0 = paramSubscriberChangeSetManager;dispatchEvents = new ArrayList();
  }
  
  protected void processEvent(BackgroundEventHandler.Event event, IProgressMonitor monitor)
    throws CoreException
  {
    if (isShutdown()) {
      throw new OperationCanceledException();
    }
    dispatchEvents.add(event);
  }
  
  /* Error */
  protected boolean doDispatchEvents(IProgressMonitor monitor)
    throws org.eclipse.team.core.TeamException
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 211	org/eclipse/team/internal/core/subscribers/SubscriberChangeSetManager$EventHandler:dispatchEvents	Ljava/util/List;
    //   4: invokeinterface 250 1 0
    //   9: ifeq +5 -> 14
    //   12: iconst_0
    //   13: ireturn
    //   14: aload_0
    //   15: invokevirtual 239	org/eclipse/team/internal/core/subscribers/SubscriberChangeSetManager$EventHandler:isShutdown	()Z
    //   18: ifeq +11 -> 29
    //   21: new 108	org/eclipse/core/runtime/OperationCanceledException
    //   24: dup
    //   25: invokespecial 215	org/eclipse/core/runtime/OperationCanceledException:<init>	()V
    //   28: athrow
    //   29: aconst_null
    //   30: checkcast 97	[Lorg/eclipse/team/core/mapping/provider/ResourceDiffTree;
    //   33: astore_2
    //   34: aload_0
    //   35: invokespecial 243	org/eclipse/team/internal/core/subscribers/SubscriberChangeSetManager$EventHandler:beginDispath	()[Lorg/eclipse/team/core/mapping/provider/ResourceDiffTree;
    //   38: astore_2
    //   39: aload_0
    //   40: getfield 211	org/eclipse/team/internal/core/subscribers/SubscriberChangeSetManager$EventHandler:dispatchEvents	Ljava/util/List;
    //   43: invokeinterface 252 1 0
    //   48: astore_3
    //   49: goto +90 -> 139
    //   52: aload_3
    //   53: invokeinterface 247 1 0
    //   58: checkcast 113	org/eclipse/team/internal/core/BackgroundEventHandler$Event
    //   61: astore 4
    //   63: aload 4
    //   65: invokevirtual 222	org/eclipse/team/internal/core/BackgroundEventHandler$Event:getType	()I
    //   68: tableswitch	default:+56->124, 1:+24->92, 2:+36->104
    //   92: aload_0
    //   93: aload 4
    //   95: invokevirtual 223	org/eclipse/team/internal/core/BackgroundEventHandler$Event:getResource	()Lorg/eclipse/core/resources/IResource;
    //   98: invokespecial 240	org/eclipse/team/internal/core/subscribers/SubscriberChangeSetManager$EventHandler:handleRemove	(Lorg/eclipse/core/resources/IResource;)V
    //   101: goto +23 -> 124
    //   104: aload_0
    //   105: aload 4
    //   107: invokevirtual 223	org/eclipse/team/internal/core/BackgroundEventHandler$Event:getResource	()Lorg/eclipse/core/resources/IResource;
    //   110: aload 4
    //   112: checkcast 114	org/eclipse/team/internal/core/BackgroundEventHandler$ResourceEvent
    //   115: invokevirtual 224	org/eclipse/team/internal/core/BackgroundEventHandler$ResourceEvent:getDepth	()I
    //   118: invokespecial 242	org/eclipse/team/internal/core/subscribers/SubscriberChangeSetManager$EventHandler:handleChange	(Lorg/eclipse/core/resources/IResource;I)V
    //   121: goto +3 -> 124
    //   124: aload_0
    //   125: invokevirtual 239	org/eclipse/team/internal/core/subscribers/SubscriberChangeSetManager$EventHandler:isShutdown	()Z
    //   128: ifeq +11 -> 139
    //   131: new 108	org/eclipse/core/runtime/OperationCanceledException
    //   134: dup
    //   135: invokespecial 215	org/eclipse/core/runtime/OperationCanceledException:<init>	()V
    //   138: athrow
    //   139: aload_3
    //   140: invokeinterface 246 1 0
    //   145: ifne -93 -> 52
    //   148: goto +46 -> 194
    //   151: astore_3
    //   152: aload_3
    //   153: invokestatic 216	org/eclipse/team/core/TeamException:asTeamException	(Lorg/eclipse/core/runtime/CoreException;)Lorg/eclipse/team/core/TeamException;
    //   156: athrow
    //   157: astore 5
    //   159: aload_0
    //   160: aload_2
    //   161: aload_1
    //   162: invokespecial 244	org/eclipse/team/internal/core/subscribers/SubscriberChangeSetManager$EventHandler:endDispatch	([Lorg/eclipse/team/core/mapping/provider/ResourceDiffTree;Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   165: goto +17 -> 182
    //   168: astore 6
    //   170: aload_0
    //   171: getfield 211	org/eclipse/team/internal/core/subscribers/SubscriberChangeSetManager$EventHandler:dispatchEvents	Ljava/util/List;
    //   174: invokeinterface 249 1 0
    //   179: aload 6
    //   181: athrow
    //   182: aload_0
    //   183: getfield 211	org/eclipse/team/internal/core/subscribers/SubscriberChangeSetManager$EventHandler:dispatchEvents	Ljava/util/List;
    //   186: invokeinterface 249 1 0
    //   191: aload 5
    //   193: athrow
    //   194: aload_0
    //   195: aload_2
    //   196: aload_1
    //   197: invokespecial 244	org/eclipse/team/internal/core/subscribers/SubscriberChangeSetManager$EventHandler:endDispatch	([Lorg/eclipse/team/core/mapping/provider/ResourceDiffTree;Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   200: goto +17 -> 217
    //   203: astore 6
    //   205: aload_0
    //   206: getfield 211	org/eclipse/team/internal/core/subscribers/SubscriberChangeSetManager$EventHandler:dispatchEvents	Ljava/util/List;
    //   209: invokeinterface 249 1 0
    //   214: aload 6
    //   216: athrow
    //   217: aload_0
    //   218: getfield 211	org/eclipse/team/internal/core/subscribers/SubscriberChangeSetManager$EventHandler:dispatchEvents	Ljava/util/List;
    //   221: invokeinterface 249 1 0
    //   226: iconst_1
    //   227: ireturn
    // Line number table:
    //   Java source line #65	-> byte code offset #0
    //   Java source line #66	-> byte code offset #12
    //   Java source line #68	-> byte code offset #14
    //   Java source line #69	-> byte code offset #21
    //   Java source line #70	-> byte code offset #29
    //   Java source line #72	-> byte code offset #34
    //   Java source line #73	-> byte code offset #39
    //   Java source line #74	-> byte code offset #52
    //   Java source line #75	-> byte code offset #63
    //   Java source line #77	-> byte code offset #92
    //   Java source line #78	-> byte code offset #101
    //   Java source line #80	-> byte code offset #104
    //   Java source line #81	-> byte code offset #121
    //   Java source line #85	-> byte code offset #124
    //   Java source line #86	-> byte code offset #131
    //   Java source line #73	-> byte code offset #139
    //   Java source line #88	-> byte code offset #151
    //   Java source line #89	-> byte code offset #152
    //   Java source line #90	-> byte code offset #157
    //   Java source line #92	-> byte code offset #159
    //   Java source line #93	-> byte code offset #168
    //   Java source line #94	-> byte code offset #170
    //   Java source line #95	-> byte code offset #179
    //   Java source line #94	-> byte code offset #182
    //   Java source line #96	-> byte code offset #191
    //   Java source line #92	-> byte code offset #194
    //   Java source line #93	-> byte code offset #203
    //   Java source line #94	-> byte code offset #205
    //   Java source line #95	-> byte code offset #214
    //   Java source line #94	-> byte code offset #217
    //   Java source line #97	-> byte code offset #226
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	228	0	this	EventHandler
    //   0	228	1	monitor	IProgressMonitor
    //   33	163	2	locked	ResourceDiffTree[]
    //   48	92	3	iter	Iterator
    //   151	2	3	e	CoreException
    //   61	50	4	event	BackgroundEventHandler.Event
    //   157	35	5	localObject1	Object
    //   168	12	6	localObject2	Object
    //   203	12	6	localObject3	Object
    // Exception table:
    //   from	to	target	type
    //   34	148	151	org/eclipse/core/runtime/CoreException
    //   34	157	157	finally
    //   159	168	168	finally
    //   194	203	203	finally
  }
  
  private ResourceDiffTree[] beginDispath()
  {
    ChangeSet[] sets = this$0.getSets();
    List lockedSets = new ArrayList();
    try
    {
      for (int i = 0; i < sets.length; i++)
      {
        ActiveChangeSet set = (ActiveChangeSet)sets[i];
        ResourceDiffTree tree = set.internalGetDiffTree();
        lockedSets.add(tree);
        tree.beginInput();
      }
      return (ResourceDiffTree[])lockedSets.toArray(new ResourceDiffTree[lockedSets.size()]);
    }
    catch (RuntimeException e)
    {
      try
      {
        for (Iterator iter = lockedSets.iterator(); iter.hasNext();)
        {
          ResourceDiffTree tree = (ResourceDiffTree)iter.next();
          try
          {
            tree.endInput(null);
          }
          catch (Throwable localThrowable1) {}
        }
      }
      catch (Throwable localThrowable2) {}
      throw e;
    }
  }
  
  private void endDispatch(ResourceDiffTree[] locked, IProgressMonitor monitor)
  {
    if (locked == null) {
      return;
    }
    monitor.beginTask(null, 100 * locked.length);
    for (int i = 0; i < locked.length; i++)
    {
      ResourceDiffTree tree = locked[i];
      try
      {
        tree.endInput(Policy.subMonitorFor(monitor, 100));
      }
      catch (RuntimeException e)
      {
        TeamPlugin.log(4, Messages.SubscriberChangeSetCollector_0, e);
        throw e;
      }
    }
    monitor.done();
  }
  
  protected synchronized void queueEvent(BackgroundEventHandler.Event event, boolean front)
  {
    super.queueEvent(event, front);
  }
  
  private void handleRemove(IResource resource)
  {
    ChangeSet[] sets = this$0.getSets();
    for (int i = 0; i < sets.length; i++)
    {
      ChangeSet set = sets[i];
      if (!set.isEmpty())
      {
        set.rootRemoved(resource, 2);
        if (set.isEmpty()) {
          this$0.remove(set);
        }
      }
    }
  }
  
  private void handleChange(IResource resource, int depth)
    throws CoreException
  {
    IDiff diff = this$0.getDiff(resource);
    if (this$0.isModified(diff))
    {
      ActiveChangeSet[] containingSets = getContainingSets(resource);
      if (containingSets.length == 0)
      {
        if (this$0.getDefaultSet() != null) {
          this$0.getDefaultSet().add(diff);
        }
      }
      else {
        for (int i = 0; i < containingSets.length; i++)
        {
          ActiveChangeSet set = containingSets[i];
          
          set.add(diff);
        }
      }
    }
    else
    {
      removeFromAllSets(resource);
    }
    if (depth != 0)
    {
      IResource[] members = this$0.getSubscriber().members(resource);
      for (int i = 0; i < members.length; i++)
      {
        IResource member = members[i];
        handleChange(member, depth == 1 ? 0 : 2);
      }
    }
  }
  
  private void removeFromAllSets(IResource resource)
  {
    List toRemove = new ArrayList();
    ChangeSet[] sets = this$0.getSets();
    for (int i = 0; i < sets.length; i++)
    {
      ChangeSet set = sets[i];
      if (set.contains(resource))
      {
        set.remove(resource);
        if (set.isEmpty()) {
          toRemove.add(set);
        }
      }
    }
    for (Iterator iter = toRemove.iterator(); iter.hasNext();)
    {
      ActiveChangeSet set = (ActiveChangeSet)iter.next();
      this$0.remove(set);
    }
  }
  
  private ActiveChangeSet[] getContainingSets(IResource resource)
  {
    Set result = new HashSet();
    ChangeSet[] sets = this$0.getSets();
    for (int i = 0; i < sets.length; i++)
    {
      ChangeSet set = sets[i];
      if (set.contains(resource)) {
        result.add(set);
      }
    }
    return (ActiveChangeSet[])result.toArray(new ActiveChangeSet[result.size()]);
  }
}

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

import org.eclipse.core.resources.IResource;
import org.eclipse.team.core.subscribers.Subscriber;
import org.eclipse.team.internal.core.BackgroundEventHandler.ResourceEvent;

class SubscriberChangeSetManager$ResourceCollector
  extends SubscriberResourceCollector
{
  final SubscriberChangeSetManager this$0;
  
  public SubscriberChangeSetManager$ResourceCollector(SubscriberChangeSetManager paramSubscriberChangeSetManager, Subscriber subscriber)
  {
    super(subscriber);
    this$0 = paramSubscriberChangeSetManager;
  }
  
  protected void remove(IResource resource)
  {
    if (SubscriberChangeSetManager.access$0(this$0) != null) {
      SubscriberChangeSetManager.access$0(this$0).queueEvent(new BackgroundEventHandler.ResourceEvent(resource, 1, 2), false);
    }
  }
  
  protected void change(IResource resource, int depth)
  {
    if (SubscriberChangeSetManager.access$0(this$0) != null) {
      SubscriberChangeSetManager.access$0(this$0).queueEvent(new BackgroundEventHandler.ResourceEvent(resource, 2, depth), false);
    }
  }
  
  protected boolean hasMembers(IResource resource)
  {
    return this$0.hasMembers(resource);
  }
}

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

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.core.diff.IDiff;
import org.eclipse.team.core.mapping.IResourceDiffTree;
import org.eclipse.team.core.mapping.provider.ResourceDiffTree;
import org.eclipse.team.core.subscribers.Subscriber;
import org.eclipse.team.internal.core.BackgroundEventHandler;
import org.eclipse.team.internal.core.BackgroundEventHandler.Event;
import org.eclipse.team.internal.core.BackgroundEventHandler.ResourceEvent;
import org.eclipse.team.internal.core.Messages;
import org.eclipse.team.internal.core.Policy;
import org.eclipse.team.internal.core.TeamPlugin;
import org.osgi.framework.Bundle;
import org.osgi.service.prefs.Preferences;

public class SubscriberChangeSetManager
  extends ActiveChangeSetManager
{
  private static final String PREF_CHANGE_SETS = "changeSets";
  private static final int RESOURCE_REMOVAL = 1;
  private static final int RESOURCE_CHANGE = 2;
  private EventHandler handler;
  private ResourceCollector collector;
  
  private class EventHandler
    extends BackgroundEventHandler
  {
    private List dispatchEvents = new ArrayList();
    
    protected EventHandler(String jobName, String errorTitle)
    {
      super(errorTitle);
    }
    
    protected void processEvent(BackgroundEventHandler.Event event, IProgressMonitor monitor)
      throws CoreException
    {
      if (isShutdown()) {
        throw new OperationCanceledException();
      }
      dispatchEvents.add(event);
    }
    
    /* Error */
    protected boolean doDispatchEvents(IProgressMonitor monitor)
      throws org.eclipse.team.core.TeamException
    {
      // Byte code:
      //   0: aload_0
      //   1: getfield 211	org/eclipse/team/internal/core/subscribers/SubscriberChangeSetManager$EventHandler:dispatchEvents	Ljava/util/List;
      //   4: invokeinterface 250 1 0
      //   9: ifeq +5 -> 14
      //   12: iconst_0
      //   13: ireturn
      //   14: aload_0
      //   15: invokevirtual 239	org/eclipse/team/internal/core/subscribers/SubscriberChangeSetManager$EventHandler:isShutdown	()Z
      //   18: ifeq +11 -> 29
      //   21: new 108	org/eclipse/core/runtime/OperationCanceledException
      //   24: dup
      //   25: invokespecial 215	org/eclipse/core/runtime/OperationCanceledException:<init>	()V
      //   28: athrow
      //   29: aconst_null
      //   30: checkcast 97	[Lorg/eclipse/team/core/mapping/provider/ResourceDiffTree;
      //   33: astore_2
      //   34: aload_0
      //   35: invokespecial 243	org/eclipse/team/internal/core/subscribers/SubscriberChangeSetManager$EventHandler:beginDispath	()[Lorg/eclipse/team/core/mapping/provider/ResourceDiffTree;
      //   38: astore_2
      //   39: aload_0
      //   40: getfield 211	org/eclipse/team/internal/core/subscribers/SubscriberChangeSetManager$EventHandler:dispatchEvents	Ljava/util/List;
      //   43: invokeinterface 252 1 0
      //   48: astore_3
      //   49: goto +90 -> 139
      //   52: aload_3
      //   53: invokeinterface 247 1 0
      //   58: checkcast 113	org/eclipse/team/internal/core/BackgroundEventHandler$Event
      //   61: astore 4
      //   63: aload 4
      //   65: invokevirtual 222	org/eclipse/team/internal/core/BackgroundEventHandler$Event:getType	()I
      //   68: tableswitch	default:+56->124, 1:+24->92, 2:+36->104
      //   92: aload_0
      //   93: aload 4
      //   95: invokevirtual 223	org/eclipse/team/internal/core/BackgroundEventHandler$Event:getResource	()Lorg/eclipse/core/resources/IResource;
      //   98: invokespecial 240	org/eclipse/team/internal/core/subscribers/SubscriberChangeSetManager$EventHandler:handleRemove	(Lorg/eclipse/core/resources/IResource;)V
      //   101: goto +23 -> 124
      //   104: aload_0
      //   105: aload 4
      //   107: invokevirtual 223	org/eclipse/team/internal/core/BackgroundEventHandler$Event:getResource	()Lorg/eclipse/core/resources/IResource;
      //   110: aload 4
      //   112: checkcast 114	org/eclipse/team/internal/core/BackgroundEventHandler$ResourceEvent
      //   115: invokevirtual 224	org/eclipse/team/internal/core/BackgroundEventHandler$ResourceEvent:getDepth	()I
      //   118: invokespecial 242	org/eclipse/team/internal/core/subscribers/SubscriberChangeSetManager$EventHandler:handleChange	(Lorg/eclipse/core/resources/IResource;I)V
      //   121: goto +3 -> 124
      //   124: aload_0
      //   125: invokevirtual 239	org/eclipse/team/internal/core/subscribers/SubscriberChangeSetManager$EventHandler:isShutdown	()Z
      //   128: ifeq +11 -> 139
      //   131: new 108	org/eclipse/core/runtime/OperationCanceledException
      //   134: dup
      //   135: invokespecial 215	org/eclipse/core/runtime/OperationCanceledException:<init>	()V
      //   138: athrow
      //   139: aload_3
      //   140: invokeinterface 246 1 0
      //   145: ifne -93 -> 52
      //   148: goto +46 -> 194
      //   151: astore_3
      //   152: aload_3
      //   153: invokestatic 216	org/eclipse/team/core/TeamException:asTeamException	(Lorg/eclipse/core/runtime/CoreException;)Lorg/eclipse/team/core/TeamException;
      //   156: athrow
      //   157: astore 5
      //   159: aload_0
      //   160: aload_2
      //   161: aload_1
      //   162: invokespecial 244	org/eclipse/team/internal/core/subscribers/SubscriberChangeSetManager$EventHandler:endDispatch	([Lorg/eclipse/team/core/mapping/provider/ResourceDiffTree;Lorg/eclipse/core/runtime/IProgressMonitor;)V
      //   165: goto +17 -> 182
      //   168: astore 6
      //   170: aload_0
      //   171: getfield 211	org/eclipse/team/internal/core/subscribers/SubscriberChangeSetManager$EventHandler:dispatchEvents	Ljava/util/List;
      //   174: invokeinterface 249 1 0
      //   179: aload 6
      //   181: athrow
      //   182: aload_0
      //   183: getfield 211	org/eclipse/team/internal/core/subscribers/SubscriberChangeSetManager$EventHandler:dispatchEvents	Ljava/util/List;
      //   186: invokeinterface 249 1 0
      //   191: aload 5
      //   193: athrow
      //   194: aload_0
      //   195: aload_2
      //   196: aload_1
      //   197: invokespecial 244	org/eclipse/team/internal/core/subscribers/SubscriberChangeSetManager$EventHandler:endDispatch	([Lorg/eclipse/team/core/mapping/provider/ResourceDiffTree;Lorg/eclipse/core/runtime/IProgressMonitor;)V
      //   200: goto +17 -> 217
      //   203: astore 6
      //   205: aload_0
      //   206: getfield 211	org/eclipse/team/internal/core/subscribers/SubscriberChangeSetManager$EventHandler:dispatchEvents	Ljava/util/List;
      //   209: invokeinterface 249 1 0
      //   214: aload 6
      //   216: athrow
      //   217: aload_0
      //   218: getfield 211	org/eclipse/team/internal/core/subscribers/SubscriberChangeSetManager$EventHandler:dispatchEvents	Ljava/util/List;
      //   221: invokeinterface 249 1 0
      //   226: iconst_1
      //   227: ireturn
      // Line number table:
      //   Java source line #65	-> byte code offset #0
      //   Java source line #66	-> byte code offset #12
      //   Java source line #68	-> byte code offset #14
      //   Java source line #69	-> byte code offset #21
      //   Java source line #70	-> byte code offset #29
      //   Java source line #72	-> byte code offset #34
      //   Java source line #73	-> byte code offset #39
      //   Java source line #74	-> byte code offset #52
      //   Java source line #75	-> byte code offset #63
      //   Java source line #77	-> byte code offset #92
      //   Java source line #78	-> byte code offset #101
      //   Java source line #80	-> byte code offset #104
      //   Java source line #81	-> byte code offset #121
      //   Java source line #85	-> byte code offset #124
      //   Java source line #86	-> byte code offset #131
      //   Java source line #73	-> byte code offset #139
      //   Java source line #88	-> byte code offset #151
      //   Java source line #89	-> byte code offset #152
      //   Java source line #90	-> byte code offset #157
      //   Java source line #92	-> byte code offset #159
      //   Java source line #93	-> byte code offset #168
      //   Java source line #94	-> byte code offset #170
      //   Java source line #95	-> byte code offset #179
      //   Java source line #94	-> byte code offset #182
      //   Java source line #96	-> byte code offset #191
      //   Java source line #92	-> byte code offset #194
      //   Java source line #93	-> byte code offset #203
      //   Java source line #94	-> byte code offset #205
      //   Java source line #95	-> byte code offset #214
      //   Java source line #94	-> byte code offset #217
      //   Java source line #97	-> byte code offs
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

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