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

for (int i = 0; i < filters.length; i++)
    {
      FastSyncInfoFilter filter = filters[i];
      if (!filter.select(info)) {
        return false;
      }
    }
    return true;
  }
}

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

public class FastSyncInfoFilter$AutomergableFilter
  extends FastSyncInfoFilter
{
  public boolean select(SyncInfo info)
  {
    return (info.getKind() & 0x20) != 0;
  }
}

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

public abstract class FastSyncInfoFilter$CompoundSyncInfoFilter
  extends FastSyncInfoFilter
{
  protected FastSyncInfoFilter[] filters;
  
  protected FastSyncInfoFilter$CompoundSyncInfoFilter(FastSyncInfoFilter[] filters)
  {
    this.filters = filters;
  }
}

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

public class FastSyncInfoFilter$OrSyncInfoFilter
  extends FastSyncInfoFilter.CompoundSyncInfoFilter
{
  public FastSyncInfoFilter$OrSyncInfoFilter(FastSyncInfoFilter[] filters)
  {
    super(filters);
  }
  
  public boolean select(SyncInfo info)
  {
    for (int i = 0; i < filters.length; i++)
    {
      FastSyncInfoFilter filter = filters[i];
      if (filter.select(info)) {
        return true;
      }
    }
    return false;
  }
}

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

public class FastSyncInfoFilter$PseudoConflictFilter
  extends FastSyncInfoFilter
{
  public boolean select(SyncInfo info)
  {
    return (info.getKind() != 0) && ((info.getKind() & 0x10) == 0);
  }
}

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

public class FastSyncInfoFilter$SyncInfoChangeTypeFilter
  extends FastSyncInfoFilter
{
  private int[] changeFilters = { 1, 2, 3 };
  
  public FastSyncInfoFilter$SyncInfoChangeTypeFilter(int[] changeFilters)
  {
    this.changeFilters = changeFilters;
  }
  
  public FastSyncInfoFilter$SyncInfoChangeTypeFilter(int change)
  {
    this(new int[] { change });
  }
  
  public boolean select(SyncInfo info)
  {
    int syncKind = info.getKind();
    for (int i = 0; i < changeFilters.length; i++)
    {
      int filter = changeFilters[i];
      if ((syncKind & 0x3) == filter) {
        return true;
      }
    }
    return false;
  }
}

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

public class FastSyncInfoFilter$SyncInfoDirectionFilter
  extends FastSyncInfoFilter
{
  int[] directionFilters = { 4, 8, 12 };
  
  public FastSyncInfoFilter$SyncInfoDirectionFilter(int[] directionFilters)
  {
    this.directionFilters = directionFilters;
  }
  
  public FastSyncInfoFilter$SyncInfoDirectionFilter(int direction)
  {
    this(new int[] { direction });
  }
  
  public boolean select(SyncInfo info)
  {
    int syncKind = info.getKind();
    for (int i = 0; i < directionFilters.length; i++)
    {
      int filter = directionFilters[i];
      if ((syncKind & 0xC) == filter) {
        return true;
      }
    }
    return false;
  }
}

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

import org.eclipse.core.runtime.IProgressMonitor;

public class FastSyncInfoFilter
  extends SyncInfoFilter
{
  public static FastSyncInfoFilter getDirectionAndChangeFilter(int direction, int change)
  {
    return new AndSyncInfoFilter(new FastSyncInfoFilter[] { new SyncInfoDirectionFilter(direction), new SyncInfoChangeTypeFilter(change) });
  }
  
  public static abstract class CompoundSyncInfoFilter
    extends FastSyncInfoFilter
  {
    protected FastSyncInfoFilter[] filters;
    
    protected CompoundSyncInfoFilter(FastSyncInfoFilter[] filters)
    {
      this.filters = filters;
    }
  }
  
  public static class AndSyncInfoFilter
    extends FastSyncInfoFilter.CompoundSyncInfoFilter
  {
    public AndSyncInfoFilter(FastSyncInfoFilter[] filters)
    {
      super();
    }
    
    public boolean select(SyncInfo info)
    {
      for (int i = 0; i < filters.length; i++)
      {
        FastSyncInfoFilter filter = filters[i];
        if (!filter.select(info)) {
          return false;
        }
      }
      return true;
    }
  }
  
  public static class AutomergableFilter
    extends FastSyncInfoFilter
  {
    public boolean select(SyncInfo info)
    {
      return (info.getKind() & 0x20) != 0;
    }
  }
  
  public static class PseudoConflictFilter
    extends FastSyncInfoFilter
  {
    public boolean select(SyncInfo info)
    {
      return (info.getKind() != 0) && ((info.getKind() & 0x10) == 0);
    }
  }
  
  public static class OrSyncInfoFilter
    extends FastSyncInfoFilter.CompoundSyncInfoFilter
  {
    public OrSyncInfoFilter(FastSyncInfoFilter[] filters)
    {
      super();
    }
    
    public boolean select(SyncInfo info)
    {
      for (int i = 0; i < filters.length; i++)
      {
        FastSyncInfoFilter filter = filters[i];
        if (filter.select(info)) {
          return true;
        }
      }
      return false;
    }
  }
  
  public static class SyncInfoChangeTypeFilter
    extends FastSyncInfoFilter
  {
    private int[] changeFilters = { 1, 2, 3 };
    
    public SyncInfoChangeTypeFilter(int[] changeFilters)
    {
      this.changeFilters = changeFilters;
    }
    
    public SyncInfoChangeTypeFilter(int change)
    {
      this(new int[] { change });
    }
    
    public boolean select(SyncInfo info)
    {
      int syncKind = info.getKind();
      for (int i = 0; i < changeFilters.length; i++)
      {
        int filter = changeFilters[i];
        if ((syncKind & 0x3) == filter) {
          return true;
        }
      }
      return false;
    }
  }
  
  public static class SyncInfoDirectionFilter
    extends FastSyncInfoFilter
  {
    int[] directionFilters = { 4, 8, 12 };
    
    public SyncInfoDirectionFilter(int[] directionFilters)
    {
      this.directionFilters = directionFilters;
    }
    
    public SyncInfoDirectionFilter(int direction)
    {
      this(new int[] { direction });
    }
    
    public boolean select(SyncInfo info)
    {
      int syncKind = info.getKind();
      for (int i = 0; i < directionFilters.length; i++)
      {
        int filter = directionFilters[i];
        if ((syncKind & 0xC) == filter) {
          return true;
        }
      }
      return false;
    }
  }
  
  public boolean select(SyncInfo info)
  {
    return info.getKind() != 0;
  }
  
  public final boolean select(SyncInfo info, IProgressMonitor monitor)
  {
    return select(info);
  }
}

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

import org.eclipse.core.resources.IResource;

public abstract interface ISyncInfoSetChangeEvent
{
  public abstract SyncInfo[] getAddedResources();
  
  public abstract SyncInfo[] getChangedResources();
  
  public abstract IResource[] getRemovedResources();
  
  public abstract SyncInfoSet getSet();
}

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

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.core.ITeamStatus;

public abstract interface ISyncInfoSetChangeListener
{
  public abstract void syncInfoSetReset(SyncInfoSet paramSyncInfoSet, IProgressMonitor paramIProgressMonitor);
  
  public abstract void syncInfoChanged(ISyncInfoSetChangeEvent paramISyncInfoSetChangeEvent, IProgressMonitor paramIProgressMonitor);
  
  public abstract void syncInfoSetErrors(SyncInfoSet paramSyncInfoSet, ITeamStatus[] paramArrayOfITeamStatus, IProgressMonitor paramIProgressMonitor);
}

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

import org.eclipse.core.resources.IResource;

public abstract interface ISyncInfoTreeChangeEvent
  extends ISyncInfoSetChangeEvent
{
  public abstract IResource[] getAddedSubtreeRoots();
  
  public abstract IResource[] getRemovedSubtreeRoots();
}

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

import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.variants.IResourceVariant;
import org.eclipse.team.core.variants.IResourceVariantComparator;
import org.eclipse.team.internal.core.Messages;

public class SyncInfo
  implements IAdaptable
{
  public static final int IN_SYNC = 0;
  public static final int ADDITION = 1;
  public static final int DELETION = 2;
  public static final int CHANGE = 3;
  public static final int CHANGE_MASK = 3;
  public static final int OUTGOING = 4;
  public static final int INCOMING = 8;
  public static final int CONFLICTING = 12;
  public static final int DIRECTION_MASK = 12;
  public static final int PSEUDO_CONFLICT = 16;
  public static final int AUTOMERGE_CONFLICT = 32;
  public static final int MANUAL_CONFLICT = 64;
  private IResource local;
  private IResourceVariant base;
  private IResourceVariant remote;
  private IResourceVariantComparator comparator;
  private int syncKind;
  
  public SyncInfo(IResource local, IResourceVariant base, IResourceVariant remote, IResourceVariantComparator comparator)
  {
    Assert.isNotNull(local);
    Assert.isNotNull(comparator);
    this.local = local;
    this.base = base;
    this.remote = remote;
    this.comparator = comparator;
  }
  
  public IResource getLocal()
  {
    return local;
  }
  
  public String getLocalContentIdentifier()
  {
    return null;
  }
  
  public String getLocalAuthor(IProgressMonitor monitor)
  {
    return null;
  }
  
  public IResourceVariant getBase()
  {
    return base;
  }
  
  public IResourceVariant getRemote()
  {
    return remote;
  }
  
  public IResourceVariantComparator getComparator()
  {
    return comparator;
  }
  
  public int getKind()
  {
    return syncKind;
  }
  
  public static boolean isInSync(int kind)
  {
    return kind == 0;
  }
  
  public static int getDirection(int kind)
  {
    return kind & 0xC;
  }
  
  public static int getChange(int kind)
  {
    return kind & 0x3;
  }
  
  public boolean equals(Object other)
  {
    if (other == this) {
      return true;
    }
    if ((other instanceof SyncInfo)) {
      return equalNodes(this, (SyncInfo)other);
    }
    return false;
  }
  
  public int hashCode()
  {
    return getLocal().hashCode();
  }
  
  private boolean equalNodes(SyncInfo node1, SyncInfo node2)
  {
    if ((node1 == null) || (node2 == null)) {
      return false;
    }
    IResource local1 = null;
    if (node1.getLocal() != null) {
      local1 = node1.getLocal();
    }
    IResource local2 = null;
    if (node2.getLocal() != null) {
      local2 = node2.getLocal();
    }
    if (!equalObjects(local1, local2)) {
      return false;
    }
    IResourceVariant base1 = null;
    if (node1.getBase() != null) {
      base1 = node1.getBase();
    }
    IResourceVariant base2 = null;
    if (node2.getBase() != null) {
      base2 = node2.getBase();
    }
    if (!equalObjects(base1, base2)) {
      return false;
    }
    IResourceVariant remote1 = null;
    if (node1.getRemote() != null) {
      remote1 = node1.getRemote();
    }
    IResourceVariant remote2 = null;
    if (node2.getRemote() != null) {
      remote2 = node2.getRemote();
    }
    if (!equalObjects(remote1, remote2)) {
      return false;
    }
    return true;
  }
  
  private boolean equalObjects(Object o1, Object o2)
  {
    if ((o1 == null) && (o2 == null)) {
      return true;
    }
    if ((o1 == null) || (o2 == null)) {
      return false;
    }
    return o1.equals(o2);
  }
  
  public Object getAdapter(Class adapter)
  {
    if (adapter == IResource.class) {
      return getLocal();
    }
    return null;
  }
  
  public String toString()
  {
    return getLocal().getName() + " " + kindToString(getKind());
  }
  
  public static String kindToString(int kind)
  {
    String label = "";
    if (kind == 0)
    {
      label = Messages.RemoteSyncElement_insync;
    }
    else
    {
      switch (kind & 0xC)
      {
      case 12: 
        label = Messages.RemoteSyncElement_conflicting; break;
      case 4: 
        label = Messages.RemoteSyncElement_outgoing; break;
      case 8: 
        label = Messages.RemoteSyncElement_incoming;
      }
      switch (kind & 0x3)
      {
      case 3: 
        label = NLS.bind(Messages.concatStrings, new String[] { label, Messages.RemoteSyncElement_change }); break;
      case 1: 
        label = NLS.bind(Messages.concatStrings, new String[] { label, Messages.RemoteSyncElement_addition }); break;
      case 2: 
        label = NLS.bind(Messages.concatStrings, new String[] { label, Messages.RemoteSyncElement_deletion });
      }
      if ((kind & 0x40) != 0) {
        label = NLS.bind(Messages.concatStrings, new String[] { label, Messages.RemoteSyncElement_manual });
      }
      if ((kind & 0x20) != 0) {
        label = NLS.bind(Messages.concatStrings, new String[] { label, Messages.RemoteSyncElement_auto });
      }
    }
    return NLS.bind(Messages.RemoteSyncElement_delimit, new String[] { label });
  }
  
  public final void init()
    throws TeamException
  {
    syncKind = calculateKind();
  }
  
  protected int calculateKind()
    throws TeamException
  {
    int description = 0;
    
    boolean localExists = local.exists();
    if (comparator.isThreeWay())
    {
      if (base == null)
      {
        if (remote == null)
        {
          if (!localExists) {
            description = 0;
          } else {
            description = 5;
          }
        }
        else if (!localExists)
        {
          description = 9;
        }
        else
        {
          description = 13;
          if (comparator.compare(local, remote)) {
            description |= 0x10;
          }
        }
      }
      else if (!localExists)
      {
        if (remote == null) {
          description = 30;
        } else if (comparator.compare(base, remote)) {
          description = 6;
        } else {
          description = 15;
        }
      }
      else if (remote == null)
      {
        if (comparator.compare(local, base)) {
          description = 10;
        } else {
          description = 15;
        }
      }
      else
      {
        boolean ay = comparator.compare(local, base);
        boolean am = comparator.compare(base, remote);
        if ((!ay) || (!am)) {
          if ((ay) && (!am)) {
            description = 11;
          } else if ((!ay) && (am)) {
            description = 7;
          } else if (!comparator.compare(local, remote)) {
            description = 15;
          }
        }
      }
    }
    else if (remote == null)
    {
      if (!localExists) {
        Assert.isTrue(false);
      } else {
        description = 2;
      }
    }
    else if (!localExists) {
      description = 1;
    } else if (!comparator.compare(local, remote)) {
      description = 3;
    }
    return description;
  }
}

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

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.core.variants.IResourceVariant;
import org.eclipse.team.internal.core.subscribers.ContentComparator;

public class SyncInfoFilter$ContentComparisonSyncInfoFilter
  extends SyncInfoFilter
{
  ContentComparator criteria = new ContentComparator(false);
  
  public SyncInfoFilter$ContentComparisonSyncInfoFilter()
  {
    this(false);
  }
  
  public SyncInfoFilter$ContentComparisonSyncInfoFilter(boolean ignoreWhitespace)
  {
    criteria = new ContentComparator(ignoreWhitespace);
  }
  
  public boolean select(SyncInfo info, IProgressMonitor monitor)
  {
    IResourceVariant remote = info.getRemote();
    IResource local = info.getLocal();
    if (local.getType() != 1) {
      return true;
    }
    if (remote == null) {
      return !local.exists();
    }
    if (!local.exists()) {
      return false;
    }
    return compareContents((IFile)local, remote, monitor);
  }
  
  public boolean compareContents(IFile local, IResourceVariant remote, IProgressMonitor monitor)
  {
    Assert.isNotNull(local);
    Assert.isNotNull(remote);
    return criteria.compare(local, remote, monitor);
  }
}

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

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.core.variants.IResourceVariant;
import org.eclipse.team.internal.core.subscribers.ContentComparator;

public abstract class SyncInfoFilter
{
  public abstract boolean select(SyncInfo paramSyncInfo, IProgressMonitor paramIProgressMonitor);
  
  public static class ContentComparisonSyncInfoFilter
    extends SyncInfoFilter
  {
    ContentComparator criteria = new ContentComparator(false);
    
    public ContentComparisonSyncInfoFilter()
    {
      this(false);
    }
    
    public ContentComparisonSyncInfoFilter(boolean ignoreWhitespace)
    {
      criteria = new ContentComparator(ignoreWhitespace);
    }
    
    public boolean select(SyncInfo info, IProgressMonitor monitor)
    {
      IResourceVariant remote = info.getRemote();
      IResource local = info.getLocal();
      if (local.getType() != 1) {
        return true;
      }
      if (remote == null) {
        return !local.exists();
      }
      if (!local.exists()) {
        return false;
      }
      return compareContents((IFile)local, remote, monitor);
    }
    
    public boolean compareContents(IFile local, IResourceVariant remote, IProgressMonitor monitor)
    {
      Assert.isNotNull(local);
      Assert.isNotNull(remote);
      return criteria.compare(local, remote, monitor);
    }
  }
}

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

import org.eclipse.core.resources.IWorkspaceRunnable;

class SyncInfoSet$1
  implements IWorkspaceRunnable
{
  final SyncInfoSet this$0;
  private final ISyncInfoSetChangeListener val$listener;
  
  SyncInfoSet$1(SyncInfoSet paramSyncInfoSet, ISyncInfoSetChangeListener paramISyncInfoSetChangeListener)
  {
    this$0 = paramSyncInfoSet;val$listener = paramISyncInfoSetChangeListener;
  }
  
  /* Error */
  public void run(org.eclipse.core.runtime.IProgressMonitor monitor)
  {
    // Byte code:
    //   0: aload_1
    //   1: aconst_null
    //   2: bipush 100
    //   4: invokeinterface 52 3 0
    //   9: aload_0
    //   10: getfield 47	org/eclipse/team/core/synchronize/SyncInfoSet$1:this$0	Lorg/eclipse/team/core/synchronize/SyncInfoSet;
    //   13: aload_0
    //   14: getfield 46	org/eclipse/team/core/synchronize/SyncInfoSet$1:val$listener	Lorg/eclipse/team/core/synchronize/ISyncInfoSetChangeListener;
    //   17: invokevirtual 49	org/eclipse/team/core/synchronize/SyncInfoSet:addSyncSetChangedListener	(Lorg/eclipse/team/core/synchronize/ISyncInfoSetChangeListener;)V
    //   20: aload_0
    //   21: getfield 46	org/eclipse/team/core/synchronize/SyncInfoSet$1:val$listener	Lorg/eclipse/team/core/synchronize/ISyncInfoSetChangeListener;
    //   24: aload_0
    //   25: getfield 47	org/eclipse/team/core/synchronize/SyncInfoSet$1:this$0	Lorg/eclipse/team/core/synchronize/SyncInfoSet;
    //   28: aload_1
    //   29: bipush 95
    //   31: invokestatic 50	org/eclipse/team/internal/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   34: invokeinterface 53 3 0
    //   39: goto +12 -> 51
    //   42: astore_2
    //   43: aload_1
    //   44: invokeinterface 51 1 0
    //   49: aload_2
    //   50: athrow
    //   51: aload_1
    //   52: invokeinterface 51 1 0
    //   57: return
    // Line number table:
    //   Java source line #277	-> byte code offset #0
    //   Java source line #278	-> byte code offset #9
    //   Java source line #279	-> byte code offset #20
    //   Java source line #280	-> byte code offset #42
    //   Java source line #281	-> byte code offset #43
    //   Java source line #282	-> byte code offset #49
    //   Java source line #281	-> byte code offset #51
    //   Java source line #283	-> byte code offset #57
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	58	0	this	1
    //   0	58	1	monitor	org.eclipse.core.runtime.IProgressMonitor
    //   42	8	2	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   0	42	42	finally
  }
}

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

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.team.core.ITeamStatus;

class SyncInfoSet$2
  implements ISafeRunnable
{
  final SyncInfoSet this$0;
  private final SyncInfoSetChangeEvent val$event;
  private final ISyncInfoSetChangeListener val$listener;
  private final IProgressMonitor val$monitor;
  private final ITeamStatus[] val$newErrors;
  
  SyncInfoSet$2(SyncInfoSet paramSyncInfoSet, SyncInfoSetChangeEvent paramSyncInfoSetChangeEvent, ISyncInfoSetChangeListener paramISyncInfoSetChangeListener, IProgressMonitor paramIProgressMonitor, ITeamStatus[] paramArrayOfITeamStatus)
  {
    this$0 = paramSyncInfoSet;val$event = paramSyncInfoSetChangeEvent;val$listener = paramISyncInfoSetChangeListener;val$monitor = paramIProgressMonitor;val$newErrors = paramArrayOfITeamStatus;
  }
  
  public void handleException(Throwable exception) {}
  
  /* Error */
  public void run()
    throws java.lang.Exception
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 65	org/eclipse/team/core/synchronize/SyncInfoSet$2:this$0	Lorg/eclipse/team/core/synchronize/SyncInfoSet;
    //   4: iconst_1
    //   5: invokestatic 68	org/eclipse/team/core/synchronize/SyncInfoSet:access$0	(Lorg/eclipse/team/core/synchronize/SyncInfoSet;Z)V
    //   8: aload_0
    //   9: getfield 66	org/eclipse/team/core/synchronize/SyncInfoSet$2:val$event	Lorg/eclipse/team/core/synchronize/SyncInfoSetChangeEvent;
    //   12: invokevirtual 69	org/eclipse/team/core/synchronize/SyncInfoSetChangeEvent:isReset	()Z
    //   15: ifeq +28 -> 43
    //   18: aload_0
    //   19: getfield 64	org/eclipse/team/core/synchronize/SyncInfoSet$2:val$listener	Lorg/eclipse/team/core/synchronize/ISyncInfoSetChangeListener;
    //   22: aload_0
    //   23: getfield 65	org/eclipse/team/core/synchronize/SyncInfoSet$2:this$0	Lorg/eclipse/team/core/synchronize/SyncInfoSet;
    //   26: aload_0
    //   27: getfield 62	org/eclipse/team/core/synchronize/SyncInfoSet$2:val$monitor	Lorg/eclipse/core/runtime/IProgressMonitor;
    //   30: bipush 100
    //   32: invokestatic 70	org/eclipse/team/internal/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   35: invokeinterface 72 3 0
    //   40: goto +25 -> 65
    //   43: aload_0
    //   44: getfield 64	org/eclipse/team/core/synchronize/SyncInfoSet$2:val$listener	Lorg/eclipse/team/core/synchronize/ISyncInfoSetChangeListener;
    //   47: aload_0
    //   48: getfield 66	org/eclipse/team/core/synchronize/SyncInfoSet$2:val$event	Lorg/eclipse/team/core/synchronize/SyncInfoSetChangeEvent;
    //   51: aload_0
    //   52: getfield 62	org/eclipse/team/core/synchronize/SyncInfoSet$2:val$monitor	Lorg/eclipse/core/runtime/IProgressMonitor;
    //   55: bipush 100
    //   57: invokestatic 70	org/eclipse/team/internal/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   60: invokeinterface 71 3 0
    //   65: aload_0
    //   66: getfield 63	org/eclipse/team/core/synchronize/SyncInfoSet$2:val$newErrors	[Lorg/eclipse/team/core/ITeamStatus;
    //   69: arraylength
    //   70: ifle +43 -> 113
    //   73: aload_0
    //   74: getfield 64	org/eclipse/team/core/synchronize/SyncInfoSet$2:val$listener	Lorg/eclipse/team/core/synchronize/ISyncInfoSetChangeListener;
    //   77: aload_0
    //   78: getfield 65	org/eclipse/team/core/synchronize/SyncInfoSet$2:this$0	Lorg/eclipse/team/core/synchronize/SyncInfoSet;
    //   81: aload_0
    //   82: getfield 63	org/eclipse/team/core/synchronize/SyncInfoSet$2:val$newErrors	[Lorg/eclipse/team/core/ITeamStatus;
    //   85: aload_0
    //   86: getfield 62	org/eclipse/team/core/synchronize/SyncInfoSet$2:val$monitor	Lorg/eclipse/core/runtime/IProgressMonitor;
    //   89: bipush 50
    //   91: invokestatic 70	org/eclipse/team/internal/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   94: invokeinterface 73 4 0
    //   99: goto +14 -> 113
    //   102: astore_1
    //   103: aload_0
    //   104: getfield 65	org/eclipse/team/core/synchronize/SyncInfoSet$2:this$0	Lorg/eclipse/team/core/synchronize/SyncInfoSet;
    //   107: iconst_0
    //   108: invokestatic 68	org/eclipse/team/core/synchronize/SyncInfoSet:access$0	(Lorg/eclipse/team/core/synchronize/SyncInfoSet;Z)V
    //   111: aload_1
    //   112: athrow
    //   113: aload_0
    //   114: getfield 65	org/eclipse/team/core/synchronize/SyncInfoSet$2:this$0	Lorg/eclipse/team/core/synchronize/SyncInfoSet;
    //   117: iconst_0
    //   118: invokestatic 68	org/eclipse/team/core/synchronize/SyncInfoSet:access$0	(Lorg/eclipse/team/core/synchronize/SyncInfoSet;Z)V
    //   121: return
    // Line number table:
    //   Java source line #570	-> byte code offset #0
    //   Java source line #571	-> byte code offset #8
    //   Java source line #572	-> byte code offset #18
    //   Java source line #574	-> byte code offset #43
    //   Java source line #576	-> byte code offset #65
    //   Java source line #577	-> byte code offset #73
    //   Java source line #579	-> byte code offset #102
    //   Java source line #580	-> byte code offset #103
    //   Java source line #581	-> byte code offset #111
    //   Java source line #580	-> byte code offset #113
    //   Java source line #582	-> byte code offset #121
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	122	0	this	2
    //   102	10	1	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   0	102	102	finally
  }
}

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

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.SafeRunner;
import org.eclipse.core.runtime.jobs.IJobManager;
import org.eclipse.core.runtime.jobs.ILock;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.team.core.ITeamStatus;
import org.eclipse.team.internal.core.subscribers.SyncInfoStatistics;

public class SyncInfoSet
{
  private Map resources = Collections.synchronizedMap(new HashMap());
  private SyncInfoStatistics statistics = new SyncInfoStatistics();
  private Map errors = new HashMap();
  private boolean lockedForModification;
  
  public SyncInfoSet() {}
  
  public SyncInfoSet(SyncInfo[] infos)
  {
    this();
    for (int i = 0; i < infos.length; i++) {
      internalAdd(infos[i]);
    }
  }
  
  public synchronized SyncInfo[] getSyncInfos()
  {
    return (SyncInfo[])resources.values().toArray(new SyncInfo[resources.size()]);
  }
  
  public IResource[] getResources()
  {
    SyncInfo[] infos = getSyncInfos();
    List resources = new ArrayList();
    for (int i = 0; i < infos.length; i++)
    {
      SyncInfo info = infos[i];
      resources.add(info.getLocal());
    }
    return (IResource[])resources.toArray(new IResource[resources.size()]);
  }
  
  public synchronized SyncInfo getSyncInfo(IResource resource)
  {
    return (SyncInfo)resources.get(resource.getFullPath());
  }
  
  public synchronized int size()
  {
    return resources.size();
  }
  
  public long countFor(int kind, int mask)
  {
    return statistics.countFor(kind, mask);
  }
  
  public boolean hasConflicts()
  {
    return countFor(12, 12) > 0L;
  }
  
  public synchronized boolean isEmpty()
  {
    return resources.isEmpty();
  }
  
  protected synchronized void internalAdd(SyncInfo info)
  {
    Assert.isTrue(!lockedForModification);
    IResource local = info.getLocal();
    IPath path = local.getFullPath();
    SyncInfo oldSyncInfo = (SyncInfo)resources.put(path, info);
    if (oldSyncInfo == null)
    {
      statistics.add(info);
    }
    else
    {
      statistics.remove(oldSyncInfo);
      statistics.add(info);
    }
  }
  
  protected synchronized SyncInfo internalRemove(IResource resource)
  {
    Assert.isTrue(!lockedForModification);
    IPath path = resource.getFullPath();
    SyncInfo info = (SyncInfo)resources.remove(path);
    if (info != null) {
      statistics.remove(info);
    }
    return info;
  }
  
  public void addSyncSetChangedListener(ISyncInfoSetChangeListener listener)
  {
    synchronized (listeners)
    {
      listeners.add(listener);
    }
  }
  
  public void removeSyncSetChangedListener(ISyncInfoSetChangeListener listener)
  {
    synchronized (listeners)
    {
      listeners.remove(listener);
    }
  }
  
  /* Error */
  public void clear()
  {
    // Byte code:
    //   0: aload_0
    //   1: invokevirtual 322	org/eclipse/team/core/synchronize/SyncInfoSet:beginInput	()V
    //   4: aload_0
    //   5: getfield 301	org/eclipse/team/core/synchronize/SyncInfoSet:errors	Ljava/util/Map;
    //   8: invokeinterface 363 1 0
    //   13: aload_0
    //   14: getfield 302	org/eclipse/team/core/synchronize/SyncInfoSet:resources	Ljava/util/Map;
    //   17: invokeinterface 363 1 0
    //   22: aload_0
    //   23: getfield 306	org/eclipse/team/core/synchronize/SyncInfoSet:statistics	Lorg/eclipse/team/internal/core/subscribers/SyncInfoStatistics;
    //   26: invokevirtual 353	org/eclipse/team/internal/core/subscribers/SyncInfoStatistics:clear	()V
    //   29: aload_0
    //   30: invokevirtual 335	org/eclipse/team/core/synchronize/SyncInfoSet:getChangeEvent	()Lorg/eclipse/team/core/synchronize/SyncInfoSetChangeEvent;
    //   33: invokevirtual 341	org/eclipse/team/core/synchronize/SyncInfoSetChangeEvent:reset	()V
    //   36: goto +11 -> 47
    //   39: astore_1
    //   40: aload_0
    //   41: aconst_null
    //   42: invokevirtual 326	org/eclipse/team/core/synchronize/SyncInfoSet:endInput	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   45: aload_1
    //   46: athrow
    //   47: aload_0
    //   48: aconst_null
    //   49: invokevirtual 326	org/eclipse/team/core/synchronize/SyncInfoSet:endInput	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   52: return
    // Line number table:
    //   Java source line #218	-> byte code offset #0
    //   Java source line #219	-> byte code offset #4
    //   Java source line #220	-> byte code offset #13
    //   Java source line #221	-> byte code offset #22
    //   Java source line #222	-> byte code offset #29
    //   Java source line #223	-> byte code offset #39
    //   Java source line #224	-> byte code offset #40
    //   Java source line #225	-> byte code offset #45
    //   Java source line #224	-> byte code offset #47
    //   Java source line #226	-> byte code offset #52
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	53	0	this	SyncInfoSet
    //   39	7	1	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   0	39	39	finally
  }
  
  /* Error */
  private void run(IWorkspaceRunnable runnable, IProgressMonitor monitor)
  {
    // Byte code:
    //   0: aload_2
    //   1: invokestatic 350	org/eclipse/team/internal/core/Policy:monitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   4: astore_2
    //   5: aload_2
    //   6: aconst_null
    //   7: bipush 100
    //   9: invokeinterface 376 3 0
    //   14: aload_0
    //   15: invokevirtual 322	org/eclipse/team/core/synchronize/SyncInfoSet:beginInput	()V
    //   18: aload_1
    //   19: aload_2
    //   20: bipush 80
    //   22: invokestatic 351	org/eclipse/team/internal/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   25: invokeinterface 374 2 0
    //   30: goto +53 -> 83
    //   33: astore_3
    //   34: aload_0
    //   35: new 164	org/eclipse/team/core/TeamStatus
    //   38: dup
    //   39: iconst_4
    //   40: ldc 1
    //   42: iconst_2
    //   43: aload_3
    //   44: invokevirtual 314	org/eclipse/core/runtime/CoreException:getMessage	()Ljava/lang/String;
    //   47: aload_3
    //   48: aconst_null
    //   49: invokespecial 317	org/eclipse/team/core/TeamStatus:<init>	(ILjava/lang/String;ILjava/lang/String;Ljava/lang/Throwable;Lorg/eclipse/core/resources/IResource;)V
    //   52: invokevirtual 328	org/eclipse/team/core/synchronize/SyncInfoSet:addError	(Lorg/eclipse/team/core/ITeamStatus;)V
    //   55: aload_0
    //   56: aload_2
    //   57: bipush 20
    //   59: invokestatic 351	org/eclipse/team/internal/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   62: invokevirtual 326	org/eclipse/team/core/synchronize/SyncInfoSet:endInput	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   65: goto +28 -> 93
    //   68: astore 4
    //   70: aload_0
    //   71: aload_2
    //   72: bipush 20
    //   74: invokestatic 351	org/eclipse/team/internal/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   77: invokevirtual 326	org/eclipse/team/core/synchronize/SyncInfoSet:endInput	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   80: aload 4
    //   82: athrow
    //   83: aload_0
    //   84: aload_2
    //   85: bipush 20
    //   87: invokestatic 351	org/eclipse/team/internal/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   90: invokevirtual 326	org/eclipse/team/core/synchronize/SyncInfoSet:endInput	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   93: return
    // Line number table:
    //   Java source line #244	-> byte code offset #0
    //   Java source line #245	-> byte code offset #5
    //   Java source line #247	-> byte code offset #14
    //   Java source line #248	-> byte code offset #18
    //   Java source line #249	-> byte code offset #33
    //   Java source line #250	-> byte code offset #34
    //   Java source line #252	-> byte code offset #55
    //   Java source line #251	-> byte code offset #68
    //   Java source line #252	-> byte code offset #70
    //   Java source line #253	-> byte code offset #80
    //   Java source line #252	-> byte code offset #83
    //   Java source line #254	-> byte code offset #93
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	94	0	this	SyncInfoSet
    //   0	94	1	runnable	IWorkspaceRunnable
    //   0	94	2	monitor	IProgressMonitor
    //   33	15	3	e	org.eclipse.core.runtime.CoreException
    //   68	13	4	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   14	30	33	org/eclipse/core/runtime/CoreException
    //   14	55	68	finally
  }
  
  public void connect(ISyncInfoSetChangeListener listener, IProgressMonitor monitor)
  {
    run(new IWorkspaceRunnable()
    {
      private final ISyncInfoSetChangeListener val$listener;
      
      /* Error */
      public void run(IProgressMonitor monitor)
      {
        // Byte code:
        //   0: aload_1
        //   1: aconst_null
        //   2: bipush 100
        //   4: invokeinterface 52 3 0
        //   9: aload_0
        //   10: getfield 47	org/eclipse/team/core/synchronize/SyncInfoSet$1:this$0	Lorg/eclipse/team/core/synchronize/SyncInfoSet;
        //   13: aload_0
        //   14: getfield 46	org/eclipse/team/core/synchronize/SyncInfoSet$1:val$listener	Lorg/eclipse/team/core/synchronize/ISyncInfoSetChangeListener;
        //   17: invokevirtual 49	org/eclipse/team/core/synchronize/SyncInfoSet:addSyncSetChangedListener	(Lorg/eclipse/team/core/synchronize/ISyncInfoSetChangeListener;)V
        //   20: aload_0
        //   21: getfield 46	org/eclipse/team/core/synchronize/SyncInfoSet$1:val$listener	Lorg/eclipse/team/core/synchronize/ISyncInfoSetChangeListener;
        //   24: aload_0
        //   25: getfield 47	org/eclipse/team/core/synchronize/SyncInfoSet$1:this$0	Lorg/eclipse/team/core/synchronize/SyncInfoSet;
        //   28: aload_1
        //   29: bipush 95
        //   31: invokestatic 50	org/eclipse/team/internal/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
        //   34: invokeinterface 53 3 0
        //   39: goto +12 -> 51
        //   42: astore_2
        //   43: aload_1
        //   44: invokeinterface 51 1 0
        //   49: aload_2
        //   50: athrow
        //   51: aload_1
        //   52: invokeinterface 51 1 0
        //   57: return
        // Line number table:
        //   Java source line #277	-> byte code offset #0
        //   Java source line #278	-> byte code offset #9
        //   Java source line #279	-> byte code offset #20
        //   Java source line #280	-> byte code offset #42
        //   Java source line #281	-> byte code offset #43
        //   Java source line #282	-> byte code offset #49
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