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

        //   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	IProgressMonitor
        //   42	8	2	localObject	Object
        // Exception table:
        //   from	to	target	type
        //   0	42	42	finally
      }
    }, monitor);
  }
  
  private ILock lock = Job.getJobManager().newLock();
  private Set listeners = Collections.synchronizedSet(new HashSet());
  private SyncInfoSetChangeEvent changes = createEmptyChangeEvent();
  
  /* Error */
  public void add(SyncInfo info)
  {
    // Byte code:
    //   0: aload_0
    //   1: invokevirtual 322	org/eclipse/team/core/synchronize/SyncInfoSet:beginInput	()V
    //   4: aload_0
    //   5: aload_1
    //   6: invokevirtual 320	org/eclipse/team/core/synchronize/SyncInfo:getLocal	()Lorg/eclipse/core/resources/IResource;
    //   9: invokevirtual 337	org/eclipse/team/core/synchronize/SyncInfoSet:getSyncInfo	(Lorg/eclipse/core/resources/IResource;)Lorg/eclipse/team/core/synchronize/SyncInfo;
    //   12: ifnull +7 -> 19
    //   15: iconst_1
    //   16: goto +4 -> 20
    //   19: iconst_0
    //   20: istore_2
    //   21: aload_0
    //   22: aload_1
    //   23: invokevirtual 333	org/eclipse/team/core/synchronize/SyncInfoSet:internalAdd	(Lorg/eclipse/team/core/synchronize/SyncInfo;)V
    //   26: iload_2
    //   27: ifeq +14 -> 41
    //   30: aload_0
    //   31: invokevirtual 335	org/eclipse/team/core/synchronize/SyncInfoSet:getChangeEvent	()Lorg/eclipse/team/core/synchronize/SyncInfoSetChangeEvent;
    //   34: aload_1
    //   35: invokevirtual 348	org/eclipse/team/core/synchronize/SyncInfoSetChangeEvent:changed	(Lorg/eclipse/team/core/synchronize/SyncInfo;)V
    //   38: goto +22 -> 60
    //   41: aload_0
    //   42: invokevirtual 335	org/eclipse/team/core/synchronize/SyncInfoSet:getChangeEvent	()Lorg/eclipse/team/core/synchronize/SyncInfoSetChangeEvent;
    //   45: aload_1
    //   46: invokevirtual 347	org/eclipse/team/core/synchronize/SyncInfoSetChangeEvent:added	(Lorg/eclipse/team/core/synchronize/SyncInfo;)V
    //   49: goto +11 -> 60
    //   52: astore_3
    //   53: aload_0
    //   54: aconst_null
    //   55: invokevirtual 326	org/eclipse/team/core/synchronize/SyncInfoSet:endInput	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   58: aload_3
    //   59: athrow
    //   60: aload_0
    //   61: aconst_null
    //   62: invokevirtual 326	org/eclipse/team/core/synchronize/SyncInfoSet:endInput	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   65: return
    // Line number table:
    //   Java source line #310	-> byte code offset #0
    //   Java source line #311	-> byte code offset #4
    //   Java source line #312	-> byte code offset #21
    //   Java source line #313	-> byte code offset #26
    //   Java source line #314	-> byte code offset #30
    //   Java source line #316	-> byte code offset #41
    //   Java source line #318	-> byte code offset #52
    //   Java source line #319	-> byte code offset #53
    //   Java source line #320	-> byte code offset #58
    //   Java source line #319	-> byte code offset #60
    //   Java source line #321	-> byte code offset #65
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	66	0	this	SyncInfoSet
    //   0	66	1	info	SyncInfo
    //   20	7	2	alreadyExists	boolean
    //   52	7	3	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   0	52	52	finally
  }
  
  /* Error */
  public void addAll(SyncInfoSet set)
  {
    // Byte code:
    //   0: aload_0
    //   1: invokevirtual 322	org/eclipse/team/core/synchronize/SyncInfoSet:beginInput	()V
    //   4: aload_1
    //   5: invokevirtual 331	org/eclipse/team/core/synchronize/SyncInfoSet:getSyncInfos	()[Lorg/eclipse/team/core/synchronize/SyncInfo;
    //   8: astore_2
    //   9: iconst_0
    //   10: istore_3
    //   11: goto +13 -> 24
    //   14: aload_0
    //   15: aload_2
    //   16: iload_3
    //   17: aaload
    //   18: invokevirtual 332	org/eclipse/team/core/synchronize/SyncInfoSet:add	(Lorg/eclipse/team/core/synchronize/SyncInfo;)V
    //   21: iinc 3 1
    //   24: iload_3
    //   25: aload_2
    //   26: arraylength
    //   27: if_icmplt -13 -> 14
    //   30: goto +13 -> 43
    //   33: astore 4
    //   35: aload_0
    //   36: aconst_null
    //   37: invokevirtual 326	org/eclipse/team/core/synchronize/SyncInfoSet:endInput	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   40: aload 4
    //   42: athrow
    //   43: aload_0
    //   44: aconst_null
    //   45: invokevirtual 326	org/eclipse/team/core/synchronize/SyncInfoSet:endInput	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   48: return
    // Line number table:
    //   Java source line #330	-> byte code offset #0
    //   Java source line #331	-> byte code offset #4
    //   Java source line #332	-> byte code offset #9
    //   Java source line #333	-> byte code offset #14
    //   Java source line #332	-> byte code offset #21
    //   Java source line #335	-> byte code offset #33
    //   Java source line #336	-> byte code offset #35
    //   Java source line #337	-> byte code offset #40
    //   Java source line #336	-> byte code offset #43
    //   Java source line #338	-> byte code offset #48
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	49	0	this	SyncInfoSet
    //   0	49	1	set	SyncInfoSet
    //   8	18	2	infos	SyncInfo[]
    //   10	15	3	i	int
    //   33	8	4	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   0	33	33	finally
  }
  
  /* Error */
  public void remove(IResource resource)
  {
    // Byte code:
    //   0: aload_0
    //   1: invokevirtual 322	org/eclipse/team/core/synchronize/SyncInfoSet:beginInput	()V
    //   4: aload_0
    //   5: aload_1
    //   6: invokevirtual 338	org/eclipse/team/core/synchronize/SyncInfoSet:internalRemove	(Lorg/eclipse/core/resources/IResource;)Lorg/eclipse/team/core/synchronize/SyncInfo;
    //   9: pop
    //   10: aload_0
    //   11: invokevirtual 335	org/eclipse/team/core/synchronize/SyncInfoSet:getChangeEvent	()Lorg/eclipse/team/core/synchronize/SyncInfoSetChangeEvent;
    //   14: aload_1
    //   15: invokevirtual 344	org/eclipse/team/core/synchronize/SyncInfoSetChangeEvent:removed	(Lorg/eclipse/core/resources/IResource;)V
    //   18: goto +11 -> 29
    //   21: astore_2
    //   22: aload_0
    //   23: aconst_null
    //   24: invokevirtual 326	org/eclipse/team/core/synchronize/SyncInfoSet:endInput	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   27: aload_2
    //   28: athrow
    //   29: aload_0
    //   30: aconst_null
    //   31: invokevirtual 326	org/eclipse/team/core/synchronize/SyncInfoSet:endInput	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   34: return
    // Line number table:
    //   Java source line #347	-> byte code offset #0
    //   Java source line #348	-> byte code offset #4
    //   Java source line #349	-> byte code offset #10
    //   Java source line #350	-> byte code offset #21
    //   Java source line #351	-> byte code offset #22
    //   Java source line #352	-> byte code offset #27
    //   Java source line #351	-> byte code offset #29
    //   Java source line #353	-> byte code offset #34
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	35	0	this	SyncInfoSet
    //   0	35	1	resource	IResource
    //   21	7	2	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   0	21	21	finally
  }
  
  /* Error */
  public void removeAll(IResource[] resources)
  {
    // Byte code:
    //   0: aload_0
    //   1: invokevirtual 322	org/eclipse/team/core/synchronize/SyncInfoSet:beginInput	()V
    //   4: iconst_0
    //   5: istore_2
    //   6: goto +13 -> 19
    //   9: aload_0
    //   10: aload_1
    //   11: iload_2
    //   12: aaload
    //   13: invokevirtual 325	org/eclipse/team/core/synchronize/SyncInfoSet:remove	(Lorg/eclipse/core/resources/IResource;)V
    //   16: iinc 2 1
    //   19: iload_2
    //   20: aload_1
    //   21: arraylength
    //   22: if_icmplt -13 -> 9
    //   25: goto +11 -> 36
    //   28: astore_3
    //   29: aload_0
    //   30: aconst_null
    //   31: invokevirtual 326	org/eclipse/team/core/synchronize/SyncInfoSet:endInput	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   34: aload_3
    //   35: athrow
    //   36: aload_0
    //   37: aconst_null
    //   38: invokevirtual 326	org/eclipse/team/core/synchronize/SyncInfoSet:endInput	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   41: return
    // Line number table:
    //   Java source line #362	-> byte code offset #0
    //   Java source line #363	-> byte code offset #4
    //   Java source line #364	-> byte code offset #9
    //   Java source line #363	-> byte code offset #16
    //   Java source line #366	-> byte code offset #28
    //   Java source line #367	-> byte code offset #29
    //   Java source line #368	-> byte code offset #34
    //   Java source line #367	-> byte code offset #36
    //   Java source line #369	-> byte code offset #41
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	42	0	this	SyncInfoSet
    //   0	42	1	resources	IResource[]
    //   5	15	2	i	int
    //   28	7	3	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   0	28	28	finally
  }
  
  public void removeConflictingNodes()
  {
    rejectNodes(new FastSyncInfoFilter.SyncInfoDirectionFilter(12));
  }
  
  public void removeOutgoingNodes()
  {
    rejectNodes(new FastSyncInfoFilter.SyncInfoDirectionFilter(4));
  }
  
  public void removeIncomingNodes()
  {
    rejectNodes(new FastSyncInfoFilter.SyncInfoDirectionFilter(8));
  }
  
  public boolean hasNodes(FastSyncInfoFilter filter)
  {
    SyncInfo[] infos = getSyncInfos();
    for (int i = 0; i < infos.length; i++)
    {
      SyncInfo info = infos[i];
      if ((info != null) && (filter.select(info))) {
        return true;
      }
    }
    return false;
  }
  
  /* Error */
  public void selectNodes(FastSyncInfoFilter filter)
  {
    // Byte code:
    //   0: aload_0
    //   1: invokevirtual 322	org/eclipse/team/core/synchronize/SyncInfoSet:beginInput	()V
    //   4: aload_0
    //   5: invokevirtual 331	org/eclipse/team/core/synchronize/SyncInfoSet:getSyncInfos	()[Lorg/eclipse/team/core/synchronize/SyncInfo;
    //   8: astore_2
    //   9: iconst_0
    //   10: istore_3
    //   11: goto +34 -> 45
    //   14: aload_2
    //   15: iload_3
    //   16: aaload
    //   17: astore 4
    //   19: aload 4
    //   21: ifnull +12 -> 33
    //   24: aload_1
    //   25: aload 4
    //   27: invokevirtual 318	org/eclipse/team/core/synchronize/FastSyncInfoFilter:select	(Lorg/eclipse/team/core/synchronize/SyncInfo;)Z
    //   30: ifne +12 -> 42
    //   33: aload_0
    //   34: aload 4
    //   36: invokevirtual 320	org/eclipse/team/core/synchronize/SyncInfo:getLocal	()Lorg/eclipse/core/resources/IResource;
    //   39: invokevirtual 325	org/eclipse/team/core/synchronize/SyncInfoSet:remove	(Lorg/eclipse/core/resources/IResource;)V
    //   42: iinc 3 1
    //   45: iload_3
    //   46: aload_2
    //   47: arraylength
    //   48: if_icmplt -34 -> 14
    //   51: goto +13 -> 64
    //   54: astore 5
    //   56: aload_0
    //   57: aconst_null
    //   58: invokevirtual 326	org/eclipse/team/core/synchronize/SyncInfoSet:endInput	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   61: aload 5
    //   63: athrow
    //   64: aload_0
    //   65: aconst_null
    //   66: invokevirtual 326	org/eclipse/team/core/synchronize/SyncInfoSet:endInput	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   69: return
    // Line number table:
    //   Java source line #417	-> byte code offset #0
    //   Java source line #418	-> byte code offset #4
    //   Java source line #419	-> byte code offset #9
    //   Java source line #420	-> byte code offset #14
    //   Java source line #421	-> byte code offset #19
    //   Java source line #422	-> byte code offset #33
    //   Java source line #419	-> byte code offset #42
    //   Java source line #425	-> byte code offset #54
    //   Java source line #426	-> byte code offset #56
    //   Java source line #427	-> byte code offset #61
    //   Java source line #426	-> byte code offset #64
    //   Java source line #428	-> byte code offset #69
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	70	0	this	SyncInfoSet
    //   0	70	1	filter	FastSyncInfoFilter
    //   8	39	2	infos	SyncInfo[]
    //   10	36	3	i	int
    //   17	18	4	info	SyncInfo
    //   54	8	5	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   0	54	54	finally
  }
  
  /* Error */
  public void rejectNodes(FastSyncInfoFilter filter)
  {
    // Byte code:
    //   0: aload_0
    //   1: invokevirtual 322	org/eclipse/team/core/synchronize/SyncInfoSet:beginInput	()V
    //   4: aload_0
    //   5: invokevirtual 331	org/eclipse/team/core/synchronize/SyncInfoSet:getSyncInfos	()[Lorg/eclipse/team/core/synchronize/SyncInfo;
    //   8: astore_2
    //   9: iconst_0
    //   10: istore_3
    //   11: goto +34 -> 45
    //   14: aload_2
    //   15: iload_3
    //   16: aaload
    //   17: astore 4
    //   19: aload 4
    //   21: ifnull +21 -> 42
    //   24: aload_1
    //   25: aload 4
    //   27: invokevirtual 318	org/eclipse/team/core/synchronize/FastSyncInfoFilter:select	(Lorg/eclipse/team/core/synchronize/SyncInfo;)Z
    //   30: ifeq +12 -> 42
    //   33: aload_0
    //   34: aload 4
    //   36: invokevirtual 320	org/eclipse/team/core/synchronize/SyncInfo:getLocal	()Lorg/eclipse/core/resources/IResource;
    //   39: invokevirtual 325	org/eclipse/team/core/synchronize/SyncInfoSet:remove	(Lorg/eclipse/core/resources/IResource;)V
    //   42: iinc 3 1
    //   45: iload_3
    //   46: aload_2
    //   47: arraylength
    //   48: if_icmplt -34 -> 14
    //   51: goto +13 -> 64
    //   54: astore 5
    //   56: aload_0
    //   57: aconst_null
    //   58: invokevirtual 326	org/eclipse/team/core/synchronize/SyncInfoSet:endInput	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   61: aload 5
    //   63: athrow
    //   64: aload_0
    //   65: aconst_null
    //   66: invokevirtual 326	org/eclipse/team/core/synchronize/SyncInfoSet:endInput	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   69: return
    // Line number table:
    //   Java source line #438	-> byte code offset #0
    //   Java source line #439	-> byte code offset #4
    //   Java source line #440	-> byte code offset #9
    //   Java source line #441	-> byte code offset #14
    //   Java source line #442	-> byte code offset #19
    //   Java source line #443	-> byte code offset #33
    //   Java source line #440	-> byte code offset #42
    //   Java source line #446	-> byte code offset #54
    //   Java source line #447	-> byte code offset #56
    //   Java source line #448	-> byte code offset #61
    //   Java source line #447	-> byte code offset #64
    //   Java source line #449	-> byte code offset #69
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	70	0	this	SyncInfoSet
    //   0	70	1	filter	FastSyncInfoFilter
    //   8	39	2	infos	SyncInfo[]
    //   10	36	3	i	int
    //   17	18	4	info	SyncInfo
    //   54	8	5	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   0	54	54	finally
  }
  
  public SyncInfo[] getNodes(FastSyncInfoFilter filter)
  {
    List result = new ArrayList();
    SyncInfo[] infos = getSyncInfos();
    for (int i = 0; i < infos.length; i++)
    {
      SyncInfo info = infos[i];
      if ((info != null) && (filter.select(info))) {
        result.add(info);
      }
    }
    return (SyncInfo[])result.toArray(new SyncInfo[result.size()]);
  }
  
  public boolean hasIncomingChanges()
  {
    return countFor(8, 12) > 0L;
  }
  
  public boolean hasOutgoingChanges()
  {
    return countFor(4, 12) > 0L;
  }
  
  public void beginInput()
  {
    lock.acquire();
  }
  
  /* Error */
  public void endInput(IProgressMonitor monitor)
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 304	org/eclipse/team/core/synchronize/SyncInfoSet:lock	Lorg/eclipse/core/runtime/jobs/ILock;
    //   4: invokeinterface 378 1 0
    //   9: iconst_1
    //   10: if_icmpne +26 -> 36
    //   13: aload_0
    //   14: aload_1
    //   15: invokestatic 350	org/eclipse/team/internal/core/Policy:monitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   18: invokespecial 327	org/eclipse/team/core/synchronize/SyncInfoSet:fireChanges	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   21: goto +15 -> 36
    //   24: astore_2
    //   25: aload_0
    //   26: getfield 304	org/eclipse/team/core/synchronize/SyncInfoSet:lock	Lorg/eclipse/core/runtime/jobs/ILock;
    //   29: invokeinterface 380 1 0
    //   34: aload_2
    //   35: athrow
    //   36: aload_0
    //   37: getfield 304	org/eclipse/team/core/synchronize/SyncInfoSet:lock	Lorg/eclipse/core/runtime/jobs/ILock;
    //   40: invokeinterface 380 1 0
    //   45: return
    // Line number table:
    //   Java source line #521	-> byte code offset #0
    //   Java source line #524	-> byte code offset #13
    //   Java source line #526	-> byte code offset #24
    //   Java source line #527	-> byte code offset #25
    //   Java source line #528	-> byte code offset #34
    //   Java source line #527	-> byte code offset #36
    //   Java source line #529	-> byte code offset #45
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	46	0	this	SyncInfoSet
    //   0	46	1	monitor	IProgressMonitor
    //   24	11	2	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   0	24	24	finally
  }
  
  protected void resetChanges()
  {
    changes = createEmptyChangeEvent();
  }
  
  protected SyncInfoSetChangeEvent createEmptyChangeEvent()
  {
    return new SyncInfoSetChangeEvent(this);
  }
  
  private void fireChanges(IProgressMonitor monitor)
  {
    SyncInfoSetChangeEvent event = getChangeEvent();
    resetChanges();
    if ((event.isEmpty()) && (!event.isReset())) {
      return;
    }
    ISyncInfoSetChangeListener[] allListeners = getListeners();
    
    ITeamStatus[] newErrors = event.getErrors();
    monitor.beginTask(null, 100 + (newErrors.length > 0 ? 50 : 0) * allListeners.length);
    for (int i = 0; i < allListeners.length; i++)
    {
      ISyncInfoSetChangeListener listener = allListeners[i];
      SafeRunner.run(new ISafeRunnable()
      {
        private final SyncInfoSetChangeEvent val$event;
        private final ISyncInfoSetChangeListener val$listener;
        private final IProgressMonitor val$monitor;
        private final ITeamStatus[] val$newErrors;
        
        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
        }
      });
    }
    monitor.done();
  }
  
  protected ISyncInfoSetChangeListener[] getListeners()
  {
    ISyncInfoSetChangeListener[] allListeners;
    synchronized (listeners)
    {
      allListeners = (ISyncInfoSetChangeListener[])listeners.toArray(new ISyncInfoSetChangeListener[listeners.size()]);
    }
    ISyncInfoSetChangeListener[] allListeners;
    return allListeners;
  }
  
  protected SyncInfoSetChangeEvent getChangeEvent()
  {
    return changes;
  }
  
  /* Error */
  public void addError(ITeamStatus status)
  {
    // 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: aload_1
    //   9: invokeinterface 381 1 0
    //   14: aload_1
    //   15: invokeinterface 368 3 0
    //   20: pop
    //   21: aload_0
    //   22: invokevirtual 335	org/eclipse/team/core/synchronize/SyncInfoSet:getChangeEvent	()Lorg/eclipse/team/core/synchronize/SyncInfoSetChangeEvent;
    //   25: aload_1
    //   26: invokevirtual 346	org/eclipse/team/core/synchronize/SyncInfoSetChangeEvent:errorOccurred	(Lorg/eclipse/team/core/ITeamStatus;)V
    //   29: goto +11 -> 40
    //   32: astore_2
    //   33: aload_0
    //   34: aconst_null
    //   35: invokevirtual 326	org/eclipse/team/core/synchronize/SyncInfoSet:endInput	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   38: aload_2
    //   39: athrow
    //   40: aload_0
    //   41: aconst_null
    //   42: invokevirtual 326	org/eclipse/team/core/synchronize/SyncInfoSet:endInput	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   45: return
    // Line number table:
    //   Java source line #629	-> byte code offset #0
    //   Java source line #630	-> byte code offset #4
    //   Java source line #631	-> byte code offset #21
    //   Java source line #632	-> byte code offset #32
    //   Java source line #633	-> byte code offset #33
    //   Java source line #634	-> byte code offset #38
    //   Java source line #633	-> byte code offset #40
    //   Java source line #635	-> byte code offset #45
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	46	0	this	SyncInfoSet
    //   0	46	1	status	ITeamStatus
    //   32	7	2	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   0	32	32	finally
  }
  
  public ITeamStatus[] getErrors()
  {
    return (ITeamStatus[])errors.values().toArray(new ITeamStatus[errors.size()]);
  }
  
  public Iterator iterator()
  {
    return resources.values().iterator();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.core.synchronize.SyncInfoSet
 * 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.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.core.resources.IResource;
import org.eclipse.team.core.ITeamStatus;

public class SyncInfoSetChangeEvent
  implements ISyncInfoSetChangeEvent
{
  private SyncInfoSet set;
  private Map changedResources = new HashMap();
  private Set removedResources = new HashSet();
  private Map addedResources = new HashMap();
  private boolean reset = false;
  private List errors = new ArrayList();
  
  public SyncInfoSetChangeEvent(SyncInfoSet set)
  {
    this.set = set;
  }
  
  public void added(SyncInfo info)
  {
    if (removedResources.contains(info.getLocal()))
    {
      removedResources.remove(info.getLocal());
      changed(info);
    }
    else
    {
      addedResources.put(info.getLocal(), info);
    }
  }
  
  public void removed(IResource resource)
  {
    if (changedResources.containsKey(resource))
    {
      changedResources.remove(resource);
    }
    else if (addedResources.containsKey(resource))
    {
      addedResources.remove(resource);
      return;
    }
    removedResources.add(resource);
  }
  
  public void changed(SyncInfo info)
  {
    IResource resource = info.getLocal();
    if (addedResources.containsKey(resource))
    {
      addedResources.put(resource, info);
      return;
    }
    changedResources.put(resource, info);
  }
  
  public SyncInfo[] getAddedResources()
  {
    return (SyncInfo[])addedResources.values().toArray(new SyncInfo[addedResources.size()]);
  }
  
  public SyncInfo[] getChangedResources()
  {
    return (SyncInfo[])changedResources.values().toArray(new SyncInfo[changedResources.size()]);
  }
  
  public IResource[] getRemovedResources()
  {
    return (IResource[])removedResources.toArray(new IResource[removedResources.size()]);
  }
  
  public SyncInfoSet getSet()
  {
    return set;
  }
  
  public void reset()
  {
    reset = true;
  }
  
  public boolean isReset()
  {
    return reset;
  }
  
  public boolean isEmpty()
  {
    return (changedResources.isEmpty()) && (removedResources.isEmpty()) && (addedResources.isEmpty()) && (errors.isEmpty());
  }
  
  public void errorOccurred(ITeamStatus status)
  {
    errors.add(status);
  }
  
  public ITeamStatus[] getErrors()
  {
    return (ITeamStatus[])errors.toArray(new ITeamStatus[errors.size()]);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.core.synchronize.SyncInfoSetChangeEvent
 * 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.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.IContainer;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.team.internal.core.Messages;
import org.eclipse.team.internal.core.TeamPlugin;
import org.eclipse.team.internal.core.subscribers.SyncInfoTreeChangeEvent;

public class SyncInfoTree
  extends SyncInfoSet
{
  protected Map parents = Collections.synchronizedMap(new HashMap());
  
  public SyncInfoTree() {}
  
  public SyncInfoTree(SyncInfo[] infos)
  {
    super(infos);
    for (int i = 0; i < infos.length; i++)
    {
      SyncInfo info = infos[i];
      IResource local = info.getLocal();
      addToParents(local, local);
    }
  }
  
  public synchronized boolean hasMembers(IResource resource)
  {
    if (resource.getType() == 1) {
      return false;
    }
    IContainer parent = (IContainer)resource;
    if (parent.getType() == 8) {
      return !isEmpty();
    }
    IPath path = parent.getFullPath();
    Set allDescendants = (Set)parents.get(path);
    return (allDescendants != null) && (!allDescendants.isEmpty());
  }
  
  public synchronized SyncInfo[] getSyncInfos(IResource resource, int depth)
  {
    if ((depth == 0) || (resource.getType() == 1))
    {
      SyncInfo info = getSyncInfo(resource);
      if (info == null) {
        return new SyncInfo[0];
      }
      return new SyncInfo[] { info };
    }
    if (depth == 1)
    {
      List result = new ArrayList();
      SyncInfo info = getSyncInfo(resource);
      if (info != null) {
        result.add(info);
      }
      IResource[] members = members(resource);
      for (int i = 0; i < members.length; i++)
      {
        IResource member = members[i];
        info = getSyncInfo(member);
        if (info != null) {
          result.add(info);
        }
      }
      return (SyncInfo[])result.toArray(new SyncInfo[result.size()]);
    }
    if (resource.getType() == 8) {
      return getSyncInfos();
    }
    return internalGetDeepSyncInfo((IContainer)resource);
  }
  
  private synchronized SyncInfo[] internalGetDeepSyncInfo(IContainer resource)
  {
    List infos = new ArrayList();
    IResource[] children = internalGetOutOfSyncDescendants(resource);
    for (int i = 0; i < children.length; i++)
    {
      IResource child = children[i];
      SyncInfo info = getSyncInfo(child);
      if (info != null) {
        infos.add(info);
      } else {
        TeamPlugin.log(1, Messages.SyncInfoTree_0 + child.getFullPath(), null);
      }
    }
    return (SyncInfo[])infos.toArray(new SyncInfo[infos.size()]);
  }
  
  protected SyncInfoSetChangeEvent createEmptyChangeEvent()
  {
    return new SyncInfoTreeChangeEvent(this);
  }
  
  /* Error */
  public void add(SyncInfo info)
  {
    // Byte code:
    //   0: aload_0
    //   1: invokevirtual 241	org/eclipse/team/core/synchronize/SyncInfoTree:beginInput	()V
    //   4: aload_0
    //   5: aload_1
    //   6: invokevirtual 235	org/eclipse/team/core/synchronize/SyncInfo:getLocal	()Lorg/eclipse/core/resources/IResource;
    //   9: invokevirtual 255	org/eclipse/team/core/synchronize/SyncInfoTree:getSyncInfo	(Lorg/eclipse/core/resources/IResource;)Lorg/eclipse/team/core/synchronize/SyncInfo;
    //   12: ifnull +7 -> 19
    //   15: iconst_1
    //   16: goto +4 -> 20
    //   19: iconst_0
    //   20: istore_2
    //   21: aload_0
    //   22: aload_1
    //   23: invokespecial 239	org/eclipse/team/core/synchronize/SyncInfoSet:add	(Lorg/eclipse/team/core/synchronize/SyncInfo;)V
    //   26: iload_2
    //   27: ifne +28 -> 55
    //   30: aload_1
    //   31: invokevirtual 235	org/eclipse/team/core/synchronize/SyncInfo:getLocal	()Lorg/eclipse/core/resources/IResource;
    //   34: astore_3
    //   35: aload_0
    //   36: aload_3
    //   37: aload_3
    //   38: invokespecial 251	org/eclipse/team/core/synchronize/SyncInfoTree:addToParents	(Lorg/eclipse/core/resources/IResource;Lorg/eclipse/core/resources/IResource;)Z
    //   41: pop
    //   42: goto +13 -> 55
    //   45: astore 4
    //   47: aload_0
    //   48: aconst_null
    //   49: invokevirtual 246	org/eclipse/team/core/synchronize/SyncInfoTree:endInput	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   52: aload 4
    //   54: athrow
    //   55: aload_0
    //   56: aconst_null
    //   57: invokevirtual 246	org/eclipse/team/core/synchronize/SyncInfoTree:endInput	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   60: return
    // Line number table:
    //   Java source line #168	-> byte code offset #0
    //   Java source line #169	-> byte code offset #4
    //   Java source line #170	-> byte code offset #21
    //   Java source line #171	-> byte code offset #26
    //   Java source line #172	-> byte code offset #30
    //   Java source line #173	-> byte code offset #35
    //   Java source line #175	-> byte code offset #45
    //   Java source line #176	-> byte code offset #47
    //   Java source line #177	-> byte code offset #52
    //   Java source line #176	-> byte code offset #55
    //   Java source line #178	-> byte code offset #60
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	61	0	this	SyncInfoTree
    //   0	61	1	info	SyncInfo
    //   20	7	2	alreadyExists	boolean
    //   34	4	3	local	IResource
    //   45	8	4	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   0	45	45	finally
  }
  
  /* Error */
  public void remove(IResource resource)
  {
    // Byte code:
    //   0: aload_0
    //   1: invokevirtual 241	org/eclipse/team/core/synchronize/SyncInfoTree:beginInput	()V
    //   4: aload_0
    //   5: aload_1
    //   6: invokespecial 238	org/eclipse/team/core/synchronize/SyncInfoSet:remove	(Lorg/eclipse/core/resources/IResource;)V
    //   9: aload_0
    //   10: aload_1
    //   11: aload_1
    //   12: invokespecial 252	org/eclipse/team/core/synchronize/SyncInfoTree:removeFromParents	(Lorg/eclipse/core/resources/IResource;Lorg/eclipse/core/resources/IResource;)Z
    //   15: pop
    //   16: goto +11 -> 27
    //   19: astore_2
    //   20: aload_0
    //   21: aconst_null
    //   22: invokevirtual 246	org/eclipse/team/core/synchronize/SyncInfoTree:endInput	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   25: aload_2
    //   26: athrow
    //   27: aload_0
    //   28: aconst_null
    //   29: invokevirtual 246	org/eclipse/team/core/synchronize/SyncInfoTree:endInput	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   32: return
    // Line number table:
    //   Java source line #185	-> byte code offset #0
    //   Java source line #186	-> byte code offset #4
    //   Java source line #187	-> byte code offset #9
    //   Java source line #188	-> byte code offset #19
    //   Java source line #189	-> byte code offset #20
    //   Java source line #190	-> byte code offset #25
    //   Java source line #189	-> byte code offset #27
    //   Java source line #192	-> byte code offset #32
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	33	0	this	SyncInfoTree
    //   0	33	1	resource	IResource
    //   19	7	2	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   0	19	19	finally
  }
  
  public void clear()
  {
    try
    {
      beginInput();
      super.clear();
      synchronized (this)
      {
        parents.clear();
      }
    }
    finally
    {
      endInput(null);
    }
    endInput(null);
  }
  
  private synchronized boolean addToParents(IResource resource, IResource parent)
  {
    if (parent.getType() == 8) {
      return false;
    }
    boolean addedParent = false;
    if (parent.getType() == 1)
    {
      addedParent = true;
    }
    else
    {
      Set children = (Set)parents.get(parent.getFullPath());
      if (children == null)
      {
        children = new HashSet();
        parents.put(parent.getFullPath(), children);
        
        addedParent = true;
      }
      children.add(resource);
    }
    if ((!addToParents(resource, parent.getParent())) && (addedParent)) {
      internalAddedSubtreeRoot(parent);
    }
    return addedParent;
  }
  
  private synchronized boolean removeFromParents(IResource resource, IResource parent)
  {
    if (parent.getType() == 8) {
      return false;
    }
    boolean removedParent = false;
    if (parent.getType() == 1)
    {
      removedParent = true;
    }
    else
    {
      Set children = (Set)parents.get(parent.getFullPath());
      if (children != null)
      {
        children.remove(resource);
        if (children.isEmpty())
        {
          parents.remove(parent.getFullPath());
          removedParent = true;
        }
      }
    }
    if ((!removeFromParents(resource, parent.getParent())) && (removedParent)) {
      internalRemovedSubtreeRoot(parent);
    }
    return removedParent;
  }
  
  private void internalAddedSubtreeRoot(IResource parent)
  {
    ((SyncInfoTreeChangeEvent)getChangeEvent()).addedSubtreeRoot(parent);
  }
  
  private void internalRemovedSubtreeRoot(IResource parent)
  {
    ((SyncInfoTreeChangeEvent)getChangeEvent()).removedSubtreeRoot(parent);
  }
  
  public void remove(IResource resource, int depth)
  {
    try
    {
      beginInput();
      if (getSyncInfo(resource) != null) {
        remove(resource);
      }
      if ((depth == 0) || (resource.getType() == 1)) {
        return;
      }
      if (depth == 1)
      {
        IResource[] members = members(resource);
        for (int i = 0; i < members.length; i++)
        {
          IResource member = members[i];
          if (getSyncInfo(member) != null) {
            remove(member);
          }
        }
      }
      else if (depth == 2)
      {
        IResource[] toRemove = internalGetOutOfSyncDescendants((IContainer)resource);
        for (int i = 0; i < toRemove.length; i++) {
          remove(toRemove[i]);
        }
      }
    }
    finally
    {
      endInput(null);
    }
    endInput(null);
  }
  
  protected synchronized IResou
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