Program: 120703
Project: 120703
Buggy source:
/** 
 * DOC qwei Comment method "exportDependenciesSelected".
 */
private void exportDependenciesSelected(){
  final Collection<Item> selectedItems=getSelectedItems();
  IRunnableWithProgress runnable=new IRunnableWithProgress(){
    public void run(    IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
      monitor.beginTask("String_Node_Str",100);
      monitor.setCanceled(false);
      final List<IRepositoryViewObject> repositoryObjects=new ArrayList<IRepositoryViewObject>();
      ProcessUtils.clearFakeProcesses();
      Display.getDefault().syncExec(new Runnable(){
        public void run(){
          for (          Item item : selectedItems) {
            RepositoryNodeUtilities.checkItemDependencies(item,repositoryObjects);
          }
        }
      }
);
      monitor.worked(60);
      Display.getDefault().syncExec(new Runnable(){
        public void run(){
          if (exportDependencies.getSelection()) {
            for (            IRepositoryViewObject repositoryObject : repositoryObjects) {
              RepositoryNode repositoryNode=RepositoryNodeUtilities.getRepositoryNode(repositoryObject,false);
              if (repositoryNode != null && !repositoryNodes.contains(repositoryNode)) {
                repositoryNodes.add(repositoryNode);
                checkedNodes.add(repositoryNode);
              }
            }
          }
 else {
            for (            IRepositoryViewObject repositoryObject : repositoryObjects) {
              RepositoryNode repositoryNode=RepositoryNodeUtilities.getRepositoryNode(repositoryObject,false);
              if (repositoryNode != null && repositoryNodes.contains(repositoryNode)) {
                repositoryNodes.remove(repositoryNode);
                checkedNodes.remove(repositoryNode);
              }
            }
          }
        }
      }
);
      monitor.worked(90);
      Display.getDefault().syncExec(new Runnable(){
        public void run(){
          CheckboxTreeViewer exportItemsTreeViewer=getItemsTreeViewer();
          Set<RepositoryNode> nodes=new HashSet<RepositoryNode>();
          nodes.addAll(repositoryNodes);
          nodes.addAll(checkedNodes);
          exportItemsTreeViewer.setCheckedElements(nodes.toArray());
        }
      }
);
      ProcessUtils.clearFakeProcesses();
      monitor.done();
    }
  }
;
  final ProgressMonitorJobsDialog dialog=new ProgressMonitorJobsDialog(getShell());
  try {
    dialog.run(true,false,runnable);
  }
 catch (  InvocationTargetException e) {
  }
catch (  InterruptedException e) {
  }
}

Fixed version (ground truth):
/** 
 * DOC qwei Comment method "exportDependenciesSelected".
 */
private void exportDependenciesSelected(){
  final Collection<Item> selectedItems=getSelectedItems();
  IRunnableWithProgress runnable=new IRunnableWithProgress(){
    @Override public void run(    IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
      monitor.beginTask("String_Node_Str",100);
      monitor.setCanceled(false);
      final List<IRepositoryViewObject> repositoryObjects=new ArrayList<IRepositoryViewObject>();
      ProcessUtils.clearFakeProcesses();
      Display.getDefault().syncExec(new Runnable(){
        @Override public void run(){
          for (          Item item : selectedItems) {
            RepositoryNodeUtilities.checkItemDependencies(item,repositoryObjects);
          }
        }
      }
);
      monitor.worked(60);
      Display.getDefault().syncExec(new Runnable(){
        @Override public void run(){
          if (exportDependencies.getSelection()) {
            for (            IRepositoryViewObject repositoryObject : repositoryObjects) {
              RepositoryNode repositoryNode=RepositoryNodeUtilities.getRepositoryNode(repositoryObject,false);
              if (repositoryNode != null && !repositoryNodes.contains(repositoryNode)) {
                repositoryNodes.add(repositoryNode);
                checkedNodes.add(repositoryNode);
              }
            }
          }
 else {
            for (            IRepositoryViewObject repositoryObject : repositoryObjects) {
              RepositoryNode repositoryNode=RepositoryNodeUtilities.getRepositoryNode(repositoryObject,false);
              if (repositoryNode != null && repositoryNodes.contains(repositoryNode)) {
                repositoryNodes.remove(repositoryNode);
                checkedNodes.remove(repositoryNode);
              }
            }
          }
        }
      }
);
      monitor.worked(90);
      Display.getDefault().syncExec(new Runnable(){
        @Override public void run(){
          CheckboxTreeViewer exportItemsTreeViewer=getItemsTreeViewer();
          Set<RepositoryNode> nodes=new HashSet<RepositoryNode>();
          nodes.addAll(repositoryNodes);
          nodes.addAll(checkedNodes);
          exportItemsTreeViewer.setCheckedElements(nodes.toArray());
        }
      }
);
      ProcessUtils.clearFakeProcesses();
      monitor.done();
    }
  }
;
  final ProgressMonitorJobsDialog dialog=new ProgressMonitorJobsDialog(getShell());
  try {
    dialog.run(true,false,runnable);
  }
 catch (  InvocationTargetException e) {
  }
catch (  InterruptedException e) {
  }
}