Program: 119486
Project: 119486
Buggy source:
/** 
 * amaumont Comment method "createLinks".
 */
public void createLinks(){
  removeAllLinks();
  getBackgroundRefresher().refreshBackground();
  ProgressDialog progressDialog=new ProgressDialog(getSource().getShell(),1000){
    private IProgressMonitor monitorWrap;
    @Override public void run(    IProgressMonitor monitor){
      TreeItem root=xmlViewer.getTree().getItem(0);
      List<HL7TreeNode> mappableNodes=new ArrayList<HL7TreeNode>();
      if (getManager().getHl7Component().isHL7Output()) {
        if (getManager() instanceof HL7OutputManager) {
          mappableNodes=((HL7OutputManager)getManager()).getTreeData("String_Node_Str");
          createLoopLinks(mappableNodes);
          xmlViewer.refresh();
          getBackgroundRefresher().refreshBackground();
        }
      }
 else {
        List<TreeItem> allItems=TreeUtils.collectAllItems(root);
        monitorWrap=SubMonitor.convert(monitor);
        String taskName=Messages.getString("String_Node_Str");
        int totalWork=allItems.size();
        monitorWrap.beginTask(taskName,totalWork);
        for (int i=0; i < totalWork; i++) {
          if (monitorWrap.isCanceled()) {
            return;
          }
          TreeItem treeItem=allItems.get(i);
          HL7TreeNode node=(HL7TreeNode)treeItem.getData();
          if (node.getColumn() == null) {
            continue;
          }
          createLoopLinks(node.getColumn().getLabel(),treeItem,monitorWrap,i == totalWork - 1);
          monitorWrap.worked(1);
        }
        monitorWrap.done();
      }
    }
  }
;
  try {
    progressDialog.executeProcess();
  }
 catch (  InvocationTargetException e) {
    e.printStackTrace();
    ExceptionHandler.process(e);
  }
catch (  InterruptedException e) {
    ExceptionHandler.process(e);
  }
}

Fixed version (ground truth):
/** 
 * amaumont Comment method "createLinks".
 */
public void createLinks(){
  removeAllLinks();
  getBackgroundRefresher().refreshBackground();
  ProgressDialog progressDialog=new ProgressDialog(getSource().getShell(),1000){
    private IProgressMonitor monitorWrap;
    @Override public void run(    IProgressMonitor monitor){
      TreeItem root=xmlViewer.getTree().getItem(0);
      List<HL7TreeNode> mappableNodes=new ArrayList<HL7TreeNode>();
      if (getManager().getHl7Component().isHL7Output()) {
        if (getManager() instanceof HL7OutputManager) {
          mappableNodes=((HL7OutputManager)getManager()).getTreeData("String_Node_Str");
          createLoopLinks(mappableNodes);
          xmlViewer.refresh();
          getBackgroundRefresher().refreshBackground();
        }
      }
 else {
        List<TreeItem> allItems=TreeUtils.collectAllItems(root);
        monitorWrap=new EventLoopProgressMonitor(monitor);
        String taskName=Messages.getString("String_Node_Str");
        int totalWork=allItems.size();
        monitorWrap.beginTask(taskName,totalWork);
        for (int i=0; i < totalWork; i++) {
          if (monitorWrap.isCanceled()) {
            return;
          }
          TreeItem treeItem=allItems.get(i);
          HL7TreeNode node=(HL7TreeNode)treeItem.getData();
          if (node.getColumn() == null) {
            continue;
          }
          createLoopLinks(node.getColumn().getLabel(),treeItem,monitorWrap,i == totalWork - 1);
          monitorWrap.worked(1);
        }
        monitorWrap.done();
      }
    }
  }
;
  try {
    progressDialog.executeProcess();
  }
 catch (  InvocationTargetException e) {
    e.printStackTrace();
    ExceptionHandler.process(e);
  }
catch (  InterruptedException e) {
    ExceptionHandler.process(e);
  }
}