Program: 129656
Project: 129656
Buggy source:
/** 
 * refreshTable. This Methos execute the CreateTable in a Thread task.
 * @param tableItem
 * @param size
 */
private void refreshTable(final TreeItem treeItem,final int size){
  if (threadExecutor == null) {
    return;
  }
  if (!threadExecutor.isThreadRunning(treeItem) && !useProvider()) {
    TableNode node=(TableNode)treeItem.getData();
    if (node.getType() == TableNode.TABLE) {
      if (managerConnection.check(getIMetadataConnection(),true)) {
        RetrieveColumnRunnable runnable=new RetrieveColumnRunnable(treeItem);
        String value=node.getValue();
        if (!(isExistingNames(value))) {
          threadExecutor.execute(runnable);
        }
      }
    }
  }
 else   if (useProvider() && !threadExecutor.isThreadRunning(treeItem)) {
    TableNode node=(TableNode)treeItem.getData();
    if (node.getType() == provider.getRunnableAccessNodeType()) {
      RetrieveColumnRunnable runnable=new RetrieveColumnRunnable(treeItem){
        @Override public void run(){
          if (isCanceled()) {
            return;
          }
          checkConnectionIsDone=true;
          Display.getDefault().syncExec(new Runnable(){
            public void run(){
              provider.executeInRunnable(metadataconnection,(TableNode)treeItem.getData(),getConnection());
              if (isCanceled()) {
                return;
              }
              updateUIInThreadIfThread();
            }
          }
);
        }
        @Override public void updateUIInThreadIfThread(){
          if (treeItem.isDisposed()) {
            return;
          }
          if (checkConnectionIsDone) {
            treeItem.setText(3,Messages.getString("String_Node_Str"));
            countSuccess++;
          }
 else {
            updateStatus(IStatus.WARNING,Messages.getString("String_Node_Str"));
            new ErrorDialogWidthDetailArea(getShell(),PID,Messages.getString("String_Node_Str"),managerConnection.getMessageException());
          }
          count++;
          updateStatus(IStatus.OK,null);
          parentWizardPage.setPageComplete(threadExecutor.getQueue().isEmpty() && (threadExecutor.getActiveCount() == 0 || countSuccess == countPending));
        }
      }
;
      String value=node.getValue();
      if (!(isExistingNames(value))) {
        threadExecutor.execute(runnable);
      }
    }
  }
 else {
    RetrieveColumnRunnable runnable=threadExecutor.getRunnable(treeItem);
    runnable.setCanceled(false);
  }
}

Fixed version (ground truth):
/** 
 * refreshTable. This Methos execute the CreateTable in a Thread task.
 * @param tableItem
 * @param size
 */
private void refreshTable(final TreeItem treeItem,final int size){
  if (threadExecutor == null) {
    return;
  }
  if (!threadExecutor.isThreadRunning(treeItem) && !useProvider()) {
    TableNode node=(TableNode)treeItem.getData();
    if (node.getType() == TableNode.TABLE) {
      if (managerConnection.check(getIMetadataConnection(),true)) {
        RetrieveColumnRunnable runnable=new RetrieveColumnRunnable(treeItem);
        String value=node.getValue();
        if (!(isExistingNames(value))) {
          threadExecutor.execute(runnable);
        }
      }
    }
  }
 else   if (useProvider() && !threadExecutor.isThreadRunning(treeItem)) {
    TableNode node=(TableNode)treeItem.getData();
    if (node.getType() == provider.getRunnableAccessNodeType()) {
      RetrieveColumnRunnable runnable=new RetrieveColumnRunnable(treeItem){
        @Override public void run(){
          if (isCanceled()) {
            return;
          }
          checkConnectionIsDone=true;
          Display.getDefault().syncExec(new Runnable(){
            public void run(){
              provider.executeInRunnable(metadataconnection,treeItem.getData(),getConnection());
              if (isCanceled()) {
                return;
              }
              updateUIInThreadIfThread();
            }
          }
);
        }
        @Override public void updateUIInThreadIfThread(){
          if (treeItem.isDisposed()) {
            return;
          }
          if (checkConnectionIsDone) {
            treeItem.setText(3,Messages.getString("String_Node_Str"));
            countSuccess++;
          }
 else {
            updateStatus(IStatus.WARNING,Messages.getString("String_Node_Str"));
            new ErrorDialogWidthDetailArea(getShell(),PID,Messages.getString("String_Node_Str"),managerConnection.getMessageException());
          }
          count++;
          updateStatus(IStatus.OK,null);
          parentWizardPage.setPageComplete(threadExecutor.getQueue().isEmpty() && (threadExecutor.getActiveCount() == 0 || countSuccess == countPending));
        }
      }
;
      String value=node.getValue();
      if (!(isExistingNames(value))) {
        threadExecutor.execute(runnable);
      }
    }
  }
 else {
    RetrieveColumnRunnable runnable=threadExecutor.getRunnable(treeItem);
    runnable.setCanceled(false);
  }
}