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

Tree();
  
  protected abstract IResourceVariantTree getRemoteTree();
  
  private IStatus refresh(IResource resource, int depth, IProgressMonitor monitor)
  {
    monitor = Policy.monitorFor(monitor);
    try
    {
      monitor.beginTask(null, 100);
      Set allChanges = new HashSet();
      if (getResourceComparator().isThreeWay())
      {
        IResource[] baseChanges = getBaseTree().refresh(new IResource[] { resource }, depth, Policy.subMonitorFor(monitor, 25));
        allChanges.addAll(Arrays.asList(baseChanges));
      }
      IResource[] remoteChanges = getRemoteTree().refresh(new IResource[] { resource }, depth, Policy.subMonitorFor(monitor, 75));
      allChanges.addAll(Arrays.asList(remoteChanges));
      IResource[] changedResources = (IResource[])allChanges.toArray(new IResource[allChanges.size()]);
      fireTeamResourceChange(SubscriberChangeEvent.asSyncChangedDeltas(this, changedResources));
      return Status.OK_STATUS;
    }
    catch (TeamException e)
    {
      Object localObject2;
      return new TeamStatus(4, "org.eclipse.team.core", 0, NLS.bind(Messages.ResourceVariantTreeSubscriber_2, new String[] { resource.getFullPath().toString(), e.getMessage() }), e, resource);
    }
    finally
    {
      monitor.done();
    }
  }
  
  private IResource[] internalMembers(IResourceVariantTree tree, IResource resource)
    throws TeamException, CoreException
  {
    try
    {
      members = tree.members(resource);
    }
    catch (CoreException e)
    {
      IResource[] members;
      if ((!isSupervised(resource)) || (e.getStatus().getCode() == 368)) {
        return new IResource[0];
      }
      throw e;
    }
    IResource[] members;
    return members;
  }
}

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

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.Assert;
import org.eclipse.team.core.TeamException;

public class SessionResourceVariantByteStore
  extends ResourceVariantByteStore
{
  private static final byte[] NO_REMOTE = new byte[0];
  private Map membersCache = new HashMap();
  private Map syncBytesCache = new HashMap();
  
  public boolean deleteBytes(IResource resource)
    throws TeamException
  {
    return flushBytes(resource, 0);
  }
  
  public void dispose()
  {
    syncBytesCache.clear();
    membersCache.clear();
  }
  
  public boolean flushBytes(IResource resource, int depth)
    throws TeamException
  {
    if (getSyncBytesCache().containsKey(resource))
    {
      if (depth != 0)
      {
        IResource[] members = members(resource);
        for (int i = 0; i < members.length; i++)
        {
          IResource child = members[i];
          flushBytes(child, depth == 2 ? 2 : 0);
        }
      }
      getSyncBytesCache().remove(resource);
      internalRemoveFromParent(resource);
      return true;
    }
    return false;
  }
  
  public byte[] getBytes(IResource resource)
    throws TeamException
  {
    byte[] syncBytes = internalGetSyncBytes(resource);
    if ((syncBytes != null) && (equals(syncBytes, NO_REMOTE))) {
      return null;
    }
    return syncBytes;
  }
  
  public boolean isEmpty()
  {
    return syncBytesCache.isEmpty();
  }
  
  public IResource[] members(IResource resource)
  {
    List members = (List)membersCache.get(resource);
    if (members == null) {
      return new IResource[0];
    }
    return (IResource[])members.toArray(new IResource[members.size()]);
  }
  
  public boolean setBytes(IResource resource, byte[] bytes)
    throws TeamException
  {
    Assert.isNotNull(bytes);
    byte[] oldBytes = internalGetSyncBytes(resource);
    if ((oldBytes != null) && (equals(oldBytes, bytes))) {
      return false;
    }
    internalSetSyncInfo(resource, bytes);
    return true;
  }
  
  private Map getSyncBytesCache()
  {
    return syncBytesCache;
  }
  
  private void internalAddToParent(IResource resource)
  {
    IContainer parent = resource.getParent();
    if (parent == null) {
      return;
    }
    List members = (List)membersCache.get(parent);
    if (members == null)
    {
      members = new ArrayList();
      membersCache.put(parent, members);
    }
    members.add(resource);
  }
  
  private byte[] internalGetSyncBytes(IResource resource)
  {
    return (byte[])getSyncBytesCache().get(resource);
  }
  
  private void internalRemoveFromParent(IResource resource)
  {
    IContainer parent = resource.getParent();
    List members = (List)membersCache.get(parent);
    if (members != null)
    {
      members.remove(resource);
      if (members.isEmpty()) {
        membersCache.remove(parent);
      }
    }
  }
  
  private void internalSetSyncInfo(IResource resource, byte[] bytes)
  {
    getSyncBytesCache().put(resource, bytes);
    internalAddToParent(resource);
  }
}

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

import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;

class ThreeWayRemoteTree$1
  implements IWorkspaceRunnable
{
  final ThreeWayRemoteTree this$0;
  private final IResource[][] val$resources;
  private final IResource val$local;
  private final IResourceVariant val$remote;
  private final int val$depth;
  
  ThreeWayRemoteTree$1(ThreeWayRemoteTree paramThreeWayRemoteTree, IResource[][] paramArrayOfIResource, IResource paramIResource, IResourceVariant paramIResourceVariant, int paramInt)
  {
    this$0 = paramThreeWayRemoteTree;val$resources = paramArrayOfIResource;val$local = paramIResource;val$remote = paramIResourceVariant;val$depth = paramInt;
  }
  
  public void run(IProgressMonitor monitor)
    throws CoreException
  {
    val$resources[0] = ThreeWayRemoteTree.access$0(this$0, val$local, val$remote, val$depth, monitor);
  }
}

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

import org.eclipse.core.resources.IResource;
import org.eclipse.team.core.TeamException;

class ThreeWayRemoteTree$RemoteResourceVariantByteStore
  extends ResourceVariantByteStore
{
  private ThreeWaySynchronizer synchronizer;
  
  public ThreeWayRemoteTree$RemoteResourceVariantByteStore(ThreeWaySynchronizer synchronizer)
  {
    this.synchronizer = synchronizer;
  }
  
  public void dispose() {}
  
  public byte[] getBytes(IResource resource)
    throws TeamException
  {
    return getSynchronizer().getRemoteBytes(resource);
  }
  
  public boolean setBytes(IResource resource, byte[] bytes)
    throws TeamException
  {
    return getSynchronizer().setRemoteBytes(resource, bytes);
  }
  
  public boolean flushBytes(IResource resource, int depth)
    throws TeamException
  {
    return false;
  }
  
  public boolean isVariantKnown(IResource resource)
    throws TeamException
  {
    return getSynchronizer().hasSyncBytes(resource);
  }
  
  public boolean deleteBytes(IResource resource)
    throws TeamException
  {
    return getSynchronizer().removeRemoteBytes(resource);
  }
  
  public IResource[] members(IResource resource)
    throws TeamException
  {
    return synchronizer.members(resource);
  }
  
  private ThreeWaySynchronizer getSynchronizer()
  {
    return synchronizer;
  }
}

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

import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.core.TeamException;

public abstract class ThreeWayRemoteTree
  extends ResourceVariantTree
{
  private ThreeWaySubscriber subscriber;
  
  static class RemoteResourceVariantByteStore
    extends ResourceVariantByteStore
  {
    private ThreeWaySynchronizer synchronizer;
    
    public RemoteResourceVariantByteStore(ThreeWaySynchronizer synchronizer)
    {
      this.synchronizer = synchronizer;
    }
    
    public void dispose() {}
    
    public byte[] getBytes(IResource resource)
      throws TeamException
    {
      return getSynchronizer().getRemoteBytes(resource);
    }
    
    public boolean setBytes(IResource resource, byte[] bytes)
      throws TeamException
    {
      return getSynchronizer().setRemoteBytes(resource, bytes);
    }
    
    public boolean flushBytes(IResource resource, int depth)
      throws TeamException
    {
      return false;
    }
    
    public boolean isVariantKnown(IResource resource)
      throws TeamException
    {
      return getSynchronizer().hasSyncBytes(resource);
    }
    
    public boolean deleteBytes(IResource resource)
      throws TeamException
    {
      return getSynchronizer().removeRemoteBytes(resource);
    }
    
    public IResource[] members(IResource resource)
      throws TeamException
    {
      return synchronizer.members(resource);
    }
    
    private ThreeWaySynchronizer getSynchronizer()
    {
      return synchronizer;
    }
  }
  
  public ThreeWayRemoteTree(ThreeWaySubscriber subscriber)
  {
    super(new RemoteResourceVariantByteStore(subscriber.getSynchronizer()));
    this.subscriber = subscriber;
  }
  
  public IResource[] roots()
  {
    return getSubscriber().roots();
  }
  
  public IResourceVariant getResourceVariant(IResource resource)
    throws TeamException
  {
    return getSubscriber().getResourceVariant(resource, getByteStore().getBytes(resource));
  }
  
  protected ThreeWaySubscriber getSubscriber()
  {
    return subscriber;
  }
  
  protected IResource[] collectChanges(IResource local, IResourceVariant remote, int depth, IProgressMonitor monitor)
    throws TeamException
  {
    IResource[][] resources = new IResource[1][];
    getSubscriber().getSynchronizer().run(local, new IWorkspaceRunnable()
    {
      private final IResource[][] val$resources;
      private final IResource val$local;
      private final IResourceVariant val$remote;
      private final int val$depth;
      
      public void run(IProgressMonitor monitor)
        throws CoreException
      {
        val$resources[0] = ThreeWayRemoteTree.this.collectChanges(val$local, val$remote, val$depth, monitor);
      }
    }, monitor);
    return resources[0];
  }
}

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

import org.eclipse.core.resources.IResource;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.internal.core.TeamPlugin;

public class ThreeWayResourceComparator
  implements IResourceVariantComparator
{
  private ThreeWaySynchronizer synchronizer;
  
  public ThreeWayResourceComparator(ThreeWaySynchronizer synchronizer)
  {
    this.synchronizer = synchronizer;
  }
  
  public boolean compare(IResource local, IResourceVariant remote)
  {
    if ((local.getType() == 1) == remote.isContainer()) {
      return false;
    }
    try
    {
      if ((local.getType() == 1) && (getSynchronizer().isLocallyModified(local))) {
        return false;
      }
      if (getSynchronizer().getBaseBytes(local) == null) {
        return false;
      }
      return equals(getSynchronizer().getBaseBytes(local), getBytes(remote));
    }
    catch (TeamException e)
    {
      TeamPlugin.log(e);
    }
    return false;
  }
  
  public boolean compare(IResourceVariant base, IResourceVariant remote)
  {
    byte[] bytes1 = getBytes(base);
    byte[] bytes2 = getBytes(remote);
    return equals(bytes1, bytes2);
  }
  
  public boolean isThreeWay()
  {
    return true;
  }
  
  private ThreeWaySynchronizer getSynchronizer()
  {
    return synchronizer;
  }
  
  private byte[] getBytes(IResourceVariant remote)
  {
    return remote.asBytes();
  }
  
  private boolean equals(byte[] syncBytes, byte[] oldBytes)
  {
    if (syncBytes.length != oldBytes.length) {
      return false;
    }
    for (int i = 0; i < oldBytes.length; i++) {
      if (oldBytes[i] != syncBytes[i]) {
        return false;
      }
    }
    return true;
  }
}

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

import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IPath;
import org.eclipse.team.core.Team;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.subscribers.SubscriberChangeEvent;
import org.eclipse.team.internal.core.TeamPlugin;
import org.eclipse.team.internal.core.subscribers.ThreeWayBaseTree;

public abstract class ThreeWaySubscriber
  extends ResourceVariantTreeSubscriber
  implements ISynchronizerChangeListener
{
  private ThreeWayResourceComparator comparator;
  private ThreeWayBaseTree baseTree;
  private ThreeWayRemoteTree remoteTree;
  private ThreeWaySynchronizer synchronizer;
  
  protected ThreeWaySubscriber(ThreeWaySynchronizer synchronizer)
  {
    this.synchronizer = synchronizer;
    baseTree = new ThreeWayBaseTree(this);
    getSynchronizer().addListener(this);
  }
  
  protected final IResourceVariantTree getBaseTree()
  {
    return baseTree;
  }
  
  protected final IResourceVariantTree getRemoteTree()
  {
    if (remoteTree == null) {
      remoteTree = createRemoteTree();
    }
    return remoteTree;
  }
  
  public final IResourceVariantComparator getResourceComparator()
  {
    if (comparator == null) {
      comparator = new ThreeWayResourceComparator(getSynchronizer());
    }
    return comparator;
  }
  
  public void syncStateChanged(IResource[] resources)
  {
    fireTeamResourceChange(SubscriberChangeEvent.asSyncChangedDeltas(this, resources));
  }
  
  public boolean isSupervised(IResource resource)
    throws TeamException
  {
    if (!isChildOfRoot(resource)) {
      return false;
    }
    if (getSynchronizer().isIgnored(resource)) {
      return false;
    }
    if (Team.isIgnoredHint(resource)) {
      return false;
    }
    return true;
  }
  
  public ThreeWaySynchronizer getSynchronizer()
  {
    return synchronizer;
  }
  
  public abstract IResourceVariant getResourceVariant(IResource paramIResource, byte[] paramArrayOfByte)
    throws TeamException;
  
  protected abstract ThreeWayRemoteTree createRemoteTree();
  
  protected void handleRootChanged(IResource resource, boolean added)
  {
    if (added) {
      rootAdded(resource);
    } else {
      rootRemoved(resource);
    }
  }
  
  private void rootAdded(IResource resource)
  {
    SubscriberChangeEvent delta = new SubscriberChangeEvent(this, 2, resource);
    fireTeamResourceChange(new SubscriberChangeEvent[] { delta });
  }
  
  private void rootRemoved(IResource resource)
  {
    try
    {
      getSynchronizer().flush(resource, 2);
    }
    catch (TeamException e)
    {
      TeamPlugin.log(e);
    }
    SubscriberChangeEvent delta = new SubscriberChangeEvent(this, 4, resource);
    fireTeamResourceChange(new SubscriberChangeEvent[] { delta });
  }
  
  private boolean isChildOfRoot(IResource resource)
  {
    IResource[] roots = roots();
    IPath fullPath = resource.getFullPath();
    for (int i = 0; i < roots.length; i++)
    {
      IResource root = roots[i];
      if (root.getFullPath().isPrefixOf(fullPath)) {
        return true;
      }
    }
    return false;
  }
}

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

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.internal.core.subscribers.BatchingLock.IFlushOperation;
import org.eclipse.team.internal.core.subscribers.BatchingLock.ThreadInfo;

class ThreeWaySynchronizer$1
  implements BatchingLock.IFlushOperation
{
  final ThreeWaySynchronizer this$0;
  
  ThreeWaySynchronizer$1(ThreeWaySynchronizer paramThreeWaySynchronizer)
  {
    this$0 = paramThreeWaySynchronizer;
  }
  
  public void flush(BatchingLock.ThreadInfo info, IProgressMonitor monitor)
    throws TeamException
  {
    if ((info != null) && (!info.isEmpty())) {
      ThreeWaySynchronizer.access$0(this$0, info.getChangedResources());
    }
  }
}

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

import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.ISafeRunnable;

class ThreeWaySynchronizer$2
  implements ISafeRunnable
{
  final ThreeWaySynchronizer this$0;
  private final ISynchronizerChangeListener val$listener;
  private final IResource[] val$resources;
  
  ThreeWaySynchronizer$2(ThreeWaySynchronizer paramThreeWaySynchronizer, ISynchronizerChangeListener paramISynchronizerChangeListener, IResource[] paramArrayOfIResource)
  {
    this$0 = paramThreeWaySynchronizer;val$listener = paramISynchronizerChangeListener;val$resources = paramArrayOfIResource;
  }
  
  public void handleException(Throwable exception) {}
  
  public void run()
    throws Exception
  {
    val$listener.syncStateChanged(val$resources);
  }
}

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

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.QualifiedName;
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.ISchedulingRule;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.internal.core.subscribers.BatchingLock;
import org.eclipse.team.internal.core.subscribers.BatchingLock.IFlushOperation;
import org.eclipse.team.internal.core.subscribers.BatchingLock.ThreadInfo;
import org.eclipse.team.internal.core.subscribers.SyncByteConverter;

public class ThreeWaySynchronizer
{
  private BatchingLock.IFlushOperation flushOperation = new BatchingLock.IFlushOperation()
  {
    public void flush(BatchingLock.ThreadInfo info, IProgressMonitor monitor)
      throws TeamException
    {
      if ((info != null) && (!info.isEmpty())) {
        ThreeWaySynchronizer.this.broadcastSyncChanges(info.getChangedResources());
      }
    }
  };
  private static final byte[] IGNORED_BYTES = "i".getBytes();
  private ILock lock = Job.getJobManager().newLock();
  private BatchingLock batchingLock = new BatchingLock();
  private ResourceVariantByteStore cache;
  private Set listeners = new HashSet();
  
  public ThreeWaySynchronizer(QualifiedName name)
  {
    this(new PersistantResourceVariantByteStore(name));
  }
  
  public ThreeWaySynchronizer(ResourceVariantByteStore store)
  {
    cache = store;
  }
  
  public void addListener(ISynchronizerChangeListener listener)
  {
    synchronized (listeners)
    {
      listeners.add(listener);
    }
  }
  
  public void removeListener(ISynchronizerChangeListener listener)
  {
    synchronized (listeners)
    {
      listeners.remove(listener);
    }
  }
  
  public byte[] getBaseBytes(IResource resource)
    throws TeamException
  {
    try
    {
      beginOperation();
      byte[] syncBytes = internalGetSyncBytes(resource);
      if (syncBytes == null) {
        return null;
      }
      byte[] baseBytes = getSlot(syncBytes, 1);
      if ((baseBytes == null) || (baseBytes.length == 0)) {
        return null;
      }
      return baseBytes;
    }
    finally
    {
      endOperation();
    }
  }
  
  /* Error */
  public void setBaseBytes(IResource resource, byte[] baseBytes)
    throws TeamException
  {
    // Byte code:
    //   0: aload_2
    //   1: invokestatic 321	org/eclipse/core/runtime/Assert:isNotNull	(Ljava/lang/Object;)V
    //   4: aconst_null
    //   5: astore_3
    //   6: aload_0
    //   7: aload_1
    //   8: aconst_null
    //   9: invokespecial 346	org/eclipse/team/core/variants/ThreeWaySynchronizer:beginBatching	(Lorg/eclipse/core/runtime/jobs/ISchedulingRule;Lorg/eclipse/core/runtime/IProgressMonitor;)Lorg/eclipse/core/runtime/jobs/ISchedulingRule;
    //   12: astore_3
    //   13: aload_0
    //   14: invokespecial 331	org/eclipse/team/core/variants/ThreeWaySynchronizer:beginOperation	()V
    //   17: new 152	java/lang/String
    //   20: dup
    //   21: aload_2
    //   22: invokespecial 316	java/lang/String:<init>	([B)V
    //   25: astore 4
    //   27: iconst_3
    //   28: anewarray 152	java/lang/String
    //   31: dup
    //   32: iconst_0
    //   33: new 150	java/lang/Long
    //   36: dup
    //   37: aload_1
    //   38: invokeinterface 372 1 0
    //   43: invokespecial 310	java/lang/Long:<init>	(J)V
    //   46: invokevirtual 311	java/lang/Long:toString	()Ljava/lang/String;
    //   49: aastore
    //   50: dup
    //   51: iconst_1
    //   52: aload 4
    //   54: aastore
    //   55: dup
    //   56: iconst_2
    //   57: aload 4
    //   59: aastore
    //   60: astore 5
    //   62: aload_0
    //   63: aload 5
    //   65: invokespecial 336	org/eclipse/team/core/variants/ThreeWaySynchronizer:toBytes	([Ljava/lang/String;)[B
    //   68: astore 6
    //   70: aload_0
    //   71: aload_1
    //   72: aload 6
    //   74: invokespecial 342	org/eclipse/team/core/variants/ThreeWaySynchronizer:internalSetSyncBytes	(Lorg/eclipse/core/resources/IResource;[B)Z
    //   77: pop
    //   78: aload_0
    //   79: getfield 308	org/eclipse/team/core/variants/ThreeWaySynchronizer:batchingLock	Lorg/eclipse/team/internal/core/subscribers/BatchingLock;
    //   82: aload_1
    //   83: invokevirtual 352	org/eclipse/team/internal/core/subscribers/BatchingLock:resourceChanged	(Lorg/eclipse/core/resources/IResource;)V
    //   86: goto +12 -> 98
    //   89: astore 7
    //   91: aload_0
    //   92: invokespecial 332	org/eclipse/team/core/variants/ThreeWaySynchronizer:endOperation	()V
    //   95: aload 7
    //   97: athrow
    //   98: aload_0
    //   99: invokespecial 332	org/eclipse/team/core/variants/ThreeWaySynchronizer:endOperation	()V
    //   102: goto +18 -> 120
    //   105: astore 8
    //   107: aload_3
    //   108: ifnull +9 -> 117
    //   111: aload_0
    //   112: aload_3
    //   113: aconst_null
    //   114: invokespecial 345	org/eclipse/team/core/variants/ThreeWaySynchronizer:endBatching	(Lorg/eclipse/core/runtime/jobs/ISchedulingRule;Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   117: aload 8
    //   119: athrow
    //   120: aload_3
    //   121: ifnull +9 -> 130
    //   124: aload_0
    //   125: aload_3
    //   126: aconst_null
    //   127: invokespecial 345	org/eclipse/team/core/variants/ThreeWaySynchronizer:endBatching	(Lorg/eclipse/core/runtime/jobs/ISchedulingRule;Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   130: return
    // Line number table:
    //   Java source line #148	-> byte code offset #0
    //   Java source line #149	-> byte code offset #4
    //   Java source line #151	-> byte code offset #6
    //   Java source line #153	-> byte code offset #13
    //   Java source line #154	-> byte code offset #17
    //   Java source line #155	-> byte code offset #27
    //   Java source line #156	-> byte code offset #33
    //   Java source line #157	-> byte code offset #52
    //   Java source line #158	-> byte code offset #57
    //   Java source line #155	-> byte code offset #60
    //   Java source line #160	-> byte code offset #62
    //   Java source line #161	-> byte code offset #70
    //   Java source line #162	-> byte code offset #78
    //   Java source line #163	-> byte code offset #89
    //   Java source line #164	-> byte code offset #91
    //   Java source line #165	-> byte code offset #95
    //   Java source line #164	-> byte code offset #98
    //   Java source line #166	-> byte code offset #105
    //   Java source line #167	-> byte code offset #107
    //   Java source line #168	-> byte code offset #117
    //   Java source line #167	-> byte code offset #120
    //   Java source line #169	-> byte code offset #130
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	131	0	this	ThreeWaySynchronizer
    //   0	131	1	resource	IResource
    //   0	131	2	baseBytes	byte[]
    //   5	121	3	rule	ISchedulingRule
    //   25	33	4	base	String
    //   60	4	5	slots	String[]
    //   68	5	6	syncBytes	byte[]
    //   89	7	7	localObject1	Object
    //   105	13	8	localObject2	Object
    // Exception table:
    //   from	to	target	type
    //   13	89	89	finally
    //   6	105	105	finally
  }
  
  public boolean isLocallyModified(IResource resource)
    throws TeamException
  {
    return ((internalGetSyncBytes(resource) == null) && (!isIgnored(resource))) || (getLocalTimestamp(resource) != resource.getModificationStamp()) || ((getBaseBytes(resource) != null) && (!resource.exists()));
  }
  
  public byte[] getRemoteBytes(IResource resource)
    throws TeamException
  {
    try
    {
      beginOperation();
      byte[] syncBytes = internalGetSyncBytes(resource);
      if (syncBytes == null) {
        return null;
      }
      byte[] remoteBytes = getSlot(syncBytes, 2);
      if ((remoteBytes == null) || (remoteBytes.length == 0)) {
        return null;
      }
      return remoteBytes;
    }
    finally
    {
      endOperation();
    }
  }
  
  /* Error */
  public boolean setRemoteBytes(IResource resource, byte[] remoteBytes)
    throws TeamException
  {
    // Byte code:
    //   0: aload_2
    //   1: invokestatic 321	org/eclipse/core/runtime/Assert:isNotNull	(Ljava/lang/Object;)V
    //   4: aconst_null
    //   5: astore_3
    //   6: aload_0
    //   7: aload_1
    //   8: aconst_null
    //   9: invokespecial 346	org/eclipse/team/core/variants/ThreeWaySynchronizer:beginBatching	(Lorg/eclipse/core/runtime/jobs/ISchedulingRule;Lorg/eclipse/core/runtime/IProgressMonitor;)Lorg/eclipse/core/runtime/jobs/ISchedulingRule;
    //   12: astore_3
    //   13: aload_0
    //   14: invokespecial 331	org/eclipse/team/core/variants/ThreeWaySynchronizer:beginOperation	()V
    //   17: aload_0
    //   18: aload_1
    //   19: invokespecial 341	org/eclipse/team/core/variants/ThreeWaySynchronizer:internalGetSyncBytes	(Lorg/eclipse/core/resources/IResource;)[B
    //   22: astore 4
    //   24: aload 4
    //   26: ifnonnull +41 -> 67
    //   29: iconst_3
    //   30: anewarray 152	java/lang/String
    //   33: dup
    //   34: iconst_0
    //   35: ldc 1
    //   37: aastore
    //   38: dup
    //   39: iconst_1
    //   40: ldc 1
    //   42: aastore
    //   43: dup
    //   44: iconst_2
    //   45: new 152	java/lang/String
    //   48: dup
    //   49: aload_2
    //   50: invokespecial 316	java/lang/String:<init>	([B)V
    //   53: aastore
    //   54: astore 5
    //   56: aload_0
    //   57: aload 5
    //   59: invokespecial 336	org/eclipse/team/core/variants/ThreeWaySynchronizer:toBytes	([Ljava/lang/String;)[B
    //   62: astore 4
    //   64: goto +48 -> 112
    //   67: aload_0
    //   68: aload 4
    //   70: iconst_2
    //   71: invokespecial 333	org/eclipse/team/core/variants/ThreeWaySynchronizer:getSlot	([BI)[B
    //   74: astore 5
    //   76: aload_0
    //   77: aload_2
    //   78: aload 5
    //   80: invokespecial 335	org/eclipse/team/core/variants/ThreeWaySynchronizer:equals	([B[B)Z
    //   83: ifeq +19 -> 102
    //   86: aload_0
    //   87: invokespecial 332	org/eclipse/team/core/variants/ThreeWaySynchronizer:endOperation	()V
    //   90: aload_3
    //   91: ifnull +9 -> 100
    //   94: aload_0
    //   95: aload_3
    //   96: aconst_null
    //   97: invokespecial 345	org/eclipse/team/core/variants/ThreeWaySynchronizer:endBatching	(Lorg/eclipse/core/runtime/jobs/ISchedulingRule;Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   100: iconst_0
    //   101: ireturn
    //   102: aload_0
    //   103: aload 4
    //   105: iconst_2
    //   106: aload_2
    //   107: invokespecial 334	org/eclipse/team/core/variants/ThreeWaySynchronizer:setSlot	([BI[B)[B
    //   110: astore 4
    //   112: aload_0
    //   113: aload_1
    //   114: aload 4
    //   116: invokespecial 342	org/eclipse/team/core/variants/ThreeWaySynchronizer:internalSetSyncBytes	(Lorg/eclipse/core/resources/IResource;[B)Z
    //   119: pop
    //   120: aload_0
    //   121: getfield 308	org/eclipse/team/core/variants/ThreeWaySynchronizer:batchingLock	Lorg/eclipse/team/internal/core/subscribers/BatchingLock;
    //   124: aload_1
    //   125: invokevirtual 352	org/eclipse/team/internal/core/subscribers/BatchingLock:resourceChanged	(Lorg/eclipse/core/resources/IResource;)V
    //   128: aload_0
    //   129: invokespecial 332	org/eclipse/team/core/variants/ThreeWaySynchronizer:endOperation	()V
    //   132: aload_3
    //   133: ifnull +9 -> 142
    //   136: aload_0
    //   137: aload_3
    //   138: aconst_null
    //   139: invokespecial 345	org/eclipse/team/core/variants/ThreeWaySynchronizer:endBatching	(Lorg/eclipse/core/runtime/jobs/ISchedulingRule;Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   142: iconst_1
    //   143: ireturn
    //   144: astore 6
    //   146: aload_0
    //   147: invokespecial 332	org/eclipse/team/core/variants/ThreeWaySynchronizer:endOperation	()V
    //   150: aload 6
    //   152: athrow
    //   153: astore 7
    //   155: aload_3
    //   156: ifnull +9 -> 165
    //   159: aload_0
    //   160: aload_3
    //   161: aconst_null
    //   162: invokespecial 345	org/eclipse/team/core/variants/ThreeWaySynchronizer:endBatching	(Lorg/eclipse/core/runtime/jobs/ISchedulingRule;Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   165: aload 7
    //   167: athrow
    // Line number table:
    //   Java source line #224	-> byte code offset #0
    //   Java source line #225	-> byte code offset #4
    //   Java source line #227	-> byte code offset #6
    //   Java source line #229	-> byte code offset #13
    //   Java source line #230	-> byte code offset #17
    //   Java source line #231	-> byte code offset #24
    //   Java source line #232	-> byte code offset #29
    //   Java source line #233	-> byte code offset #35
    //   Java source line #234	-> byte code offset #40
    //   Java source line #235	-> byte code offset #45
    //   Java source line #232	-> byte code offset #54
    //   Java source line #237	-> byte code offset #56
    //   Java source line #239	-> byte code offset #67
    //   Java source line #240	-> byte code offset #76
    //   Java source line #247	-> byte code offset #86
    //   Java source line #250	-> byte code offset #90
    //   Java source line #240	-> byte code offset #100
    //   Java source line #241	-> byte code offset #102
    //   Java source line #243	-> byte code offset #112
    //   Java source line #244	-> byte code offset #120
    //   Java source line #247	-> byte code offset #128
    //   Java source line #250	-> byte code offset #132
    //   Java source line #245	-> byte code offset #142
    //   Java source line #246	-> byte code offset #144
    //   Java source line #247	-> byte code offset #146
    //   Java source line #248	-> byte code offset #150
    //   Java source line #249	-> byte code offset #153
    //   Java source line #250	-> byte code offset #155
    //   Java source line #251	-> byte code offset #165
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	168	0	this	ThreeWaySynchronizer
    //   0	168	1	resource	IResource
    //   0	168	2	remoteBytes	byte[]
    //   5	156	3	rule	ISchedulingRule
    //   22	47	4	syncBytes	byte[]
    //   102	13	4	syncBytes	byte[]
    //   54	4	5	slots	String[]
    //   74	5	5	currentRemote	byte[]
    //   102	1	5	currentRemote	byte[]
    //   144	7	6	localObject1	Object
    //   153	13	7	localObject2	Object
    // Exception table:
    //   from	to	target	type
    //   13	86	144	finally
    //   102	128	144	finally
    //   6	90	153	finally
    //   102	132	153	finally
    //   144	153	153	finally
  }
  
  /* Error */
  public boolean removeRemoteBytes(IResource resource)
    throws TeamException
  {
    // Byte code:
    //   0: aconst_null
    //   1: astore_2
    //   2: aload_0
    //   3: aload_1
    //   4: aconst_null
    //   5: invokespecial 346	org/eclipse/team/core/variants/ThreeWaySynchronizer:beginBatching	(Lorg/eclipse/core/runtime/jobs/ISchedulingRule;Lorg/eclipse/core/runtime/IProgressMonitor;)Lorg/eclipse/core/runtime/jobs/ISchedulingRule;
    //   8: astore_2
    //   9: aload_0
    //   10: invokespecial 331	org/eclipse/team/core/variants/ThreeWaySynchronizer:beginOperation	()V
    //   13: aload_0
    //   14: aload_1
    //   15: invokespecial 341	org/eclipse/team/core/variants/ThreeWaySynchronizer:internalGetSyncBytes	(Lorg/eclipse/core/resources/IResource;)[B
    //   18: astore_3
    //   19: aload_3
    //   20: ifnull +83 -> 103
    //   23: new 152	java/lang/String
    //   26: dup
    //   27: aload_0
    //   28: aload_3
    //   29: iconst_2
    //   30: invokespecial 333	org/eclipse/team/core/variants/ThreeWaySynchronizer:getSlot	([BI)[B
    //   33: invokespecial 316	java/lang/String:<init>	([B)V
    //   36: astore 4
    //   38: aload 4
    //   40: invokevirtual 314	java/lang/String:length	()I
    //   43: ifne +19 -> 62
    //   46: aload_0
    //   47: invokespecial 332	org/eclipse/team/core/variants/ThreeWaySynchronizer:endOperation	()V
    //   50: aload_2
    //   51: ifnull +9 -> 60
    //   54: aload_0
    //   55: aload_2
    //   56: aconst_null
    //   57: invokespecial 345	org/eclipse/team/core/variants/ThreeWaySynchronizer:endBatching	(Lorg/eclipse/core/runtime/jobs/ISchedulingRule;Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   60: iconst_0
    //   61: ireturn
    //   62: aload_0
    //   63: aload_3
    //   64: iconst_2
    //   65: iconst_0
    //   66: newarray <illegal type>
    //   68: invokespecial 334	org/eclipse/team/core/variants/ThreeWaySynchronizer:setSlot	([BI[B)[B
    //   71: astore_3
    //   72: aload_0
    //   73: aload_1
    //   74: aload_3
    //   75: invokespecial 342	org/eclipse/team/core/variants/ThreeWaySynchronizer:internalSetSyncBytes	(Lorg/eclipse/core/resources/IResource;[B)Z
    //   78: pop
    //   79: aload_0
    //   80: getfield 308	org/eclipse/team/core/variants/ThreeWaySynchronizer:batchingLock	Lorg/eclipse/team/internal/core/subscribers/BatchingLock;
    //   83: aload_1
    //   84: invokevirtual 352	org/eclipse/team/internal/core/subscribers/BatchingLock:resourceChanged	(Lorg/eclipse/core/resources/IResource;)V
    //   87: aload_0
    //   88: invokespecial 332	org/eclipse/team/core/variants/ThreeWaySynchronizer:endOperation	()V
    //   91: aload_2
    //   92: ifnull +9 -> 101
    //   95: aload_0
    //   96: aload_2
    //   97: aconst_null
    //   98: invokespecial 345	org/eclipse/team/core/variants/ThreeWaySynchronizer:endBatching	(Lorg/eclipse/core/runtime/jobs/ISchedulingRule;Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   101: iconst_1
    //   102: ireturn
    //   103: aload_0
    //   104: invokespecial 332	org/eclipse/team/core/variants/ThreeWaySynchronizer:endOperation	()V
    //   107: aload_2
    //   108: ifnull +9 -> 117
    //   111: aload_0
    //   112: aload_2
    //   113: aconst_null
    //   114: invokespecial 345	org/eclipse/team/core/variants/ThreeWaySynchronizer:endBatching	(Lorg/eclipse/core/runtime/jobs/ISchedulingRule;Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   117: iconst_0
    //   118: ireturn
    //   119: astore 5
    //   121: aload_0
    //   122: invokespecial 332	org/eclipse/team/core/variants/ThreeWaySynchronizer:endOperation	()V
    //   125: aload 5
    //   127: athrow
    //   128: astore 6
    //   130: aload_2
    //   131: ifnull +9 -> 140
    //   134: aload_0
    //   135: aload_2
    //   136: aconst_null
    //   137: invokespecial 345	org/eclipse/team/core/variants/ThreeWaySynchronizer:endBatching	(Lorg/eclipse/core/runtime/jobs/ISchedulingRule;Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   140: aload 6
    //   142: athrow
    // Line number table:
    //   Java source line #262	-> byte code offset #0
    //   Java source line #264	-> byte code offset #2
    //   Java source line #266	-> byte code offset #9
    //   Java source line #267	-> byte code offset #13
    //   Java source line #268	-> byte code offset #19
    //   Java source line #269	-> byte code offset #23
    //   Java source line #270	-> byte code offset #38
    //   Java source line #278	-> byte code offset #46
    //   Java source line #281	-> byte code offset #50
    //   Java source line #270	-> byte code offset #60
    //   Java source line #271	-> byte code offset #62
    //   Java source line #272	-> byte code offset #72
    //   Java source line #273	-> byte code offset #79
    //   Java source line #278	-> byte code offset #87
    //   Java source line #281	-> byte code offset #91
    //   Java source line #274	-> byte code offset #101
    //   Java source line #278	-> byte code offset #103
    //   Java source line #281	-> byte code offset #107
    //   Java source line #276	-> byte code offset #117
    //   Java source line #277	-> byte code offset #119
    //   Java source line #278	-> byte code offset #121
    //   Java source line #279	-> byte code offset #125
    //   Java source line #280	-> byte code offset #128
    //   Java source line #281	-> byte code offset #130
    //   Java source line #282	-> byte code offset #140
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	143	0	this	ThreeWaySynchronizer
    //   0	143	1	resource	IResource
    //   1	135	2	rule	ISchedulingRule
    //   18	11	3	syncBytes	byte[]
    //   62	13	3	syncBytes	byte[]
    //   103	1	3	syncBytes	byte[]
    //   36	3	4	currentRemote	String
    //   62	1	4	currentRemote	String
    //   119	7	5	localObject1	Object
    //   128	13	6	localObject2	Object
    // Exception table:
    //   from	to	target	type
    //   9	46	119	finally
    //   62	87	119	finally
    //   2	50	128	finally
    //   62	91	128	finally
    //   103	107	128	finally
    //   119	128	128	finally
  }
  
  public boolean hasSyncBytes(IResource resource)
    throws TeamException
  {
    return internalGetSyncBytes(resource) != null;
  }
  
  public boolean isIgnored(IResource resource)
    throws TeamException
  {
    byte[] bytes = cache.getBytes(resource);
    return (bytes != null) && (equals(bytes, IGNORED_BYTES));
  }
  
  public void setIgnored(IResource resource)
    throws TeamException
  {
    internalSetSyncBytes(resource, IGNORED_BYTES);
  }
  
  public IResource[] members(IResource resource)
    throws TeamException
  {
    if (resource.getType() == 1) {
      return new IResource[0];
    }
    try
    {
      Set 
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