Program: 129658
Project: 129658
Buggy source:
/** 
 * addButtonControls.
 */
@Override protected void addUtilsButtonListeners(){
  checkConnectionButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    final SelectionEvent e){
      count=0;
      checkConnection(true);
    }
  }
);
  selectAllTablesButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    final SelectionEvent e){
      updateStatus(IStatus.ERROR,null);
      for (      TreeItem catalogItem : tree.getItems()) {
        int type=((TableNode)catalogItem.getData()).getType();
        if (type == TableNode.CATALOG) {
          for (          TreeItem schemaItem : catalogItem.getItems()) {
            if (schemaItem.getData() != null) {
              int t=((TableNode)schemaItem.getData()).getType();
              if (t == TableNode.SCHEMA) {
                for (                TreeItem tableItem : schemaItem.getItems()) {
                  updateItem(tableItem,true,false);
                }
                schemaItem.setChecked(true);
              }
 else               if (t == TableNode.TABLE) {
                updateItem(schemaItem,true,false);
              }
            }
          }
          catalogItem.setChecked(true);
          catalogItem.setGrayed(true);
        }
 else         if (type == TableNode.SCHEMA) {
          for (          TreeItem tableItem : catalogItem.getItems()) {
            updateItem(tableItem,true,false);
          }
          catalogItem.setChecked(true);
          catalogItem.setGrayed(true);
        }
 else         if (type == TableNode.TABLE) {
          updateItem(catalogItem,true,false);
        }
      }
      if (forTemplate) {
        parentWizardPage.setPageComplete(true);
      }
    }
  }
);
  selectNoneTablesButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    final SelectionEvent e){
      count=0;
      countSuccess=0;
      countPending=0;
      for (      TreeItem catalogItem : tree.getItems()) {
        int type=((TableNode)catalogItem.getData()).getType();
        if (type == TableNode.CATALOG) {
          for (          TreeItem schemaItem : catalogItem.getItems()) {
            if (schemaItem.getData() != null) {
              int t=((TableNode)schemaItem.getData()).getType();
              if (t == TableNode.SCHEMA) {
                for (                TreeItem tableItem : schemaItem.getItems()) {
                  updateItem(tableItem,false,false);
                }
                schemaItem.setChecked(false);
              }
 else               if (t == TableNode.TABLE) {
                updateItem(schemaItem,false,false);
              }
            }
          }
          catalogItem.setChecked(false);
        }
 else         if (type == TableNode.SCHEMA) {
          for (          TreeItem tableItem : catalogItem.getItems()) {
            updateItem(tableItem,false,false);
          }
          catalogItem.setChecked(false);
        }
 else         if (type == TableNode.TABLE) {
          updateItem(catalogItem,false,false);
        }
      }
      if (forTemplate) {
        parentWizardPage.setPageComplete(false);
      }
    }
  }
);
  addTableListener();
}

Fixed version (ground truth):
/** 
 * addButtonControls.
 */
@Override protected void addUtilsButtonListeners(){
  checkConnectionButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    final SelectionEvent e){
      count=0;
      checkConnection(true);
    }
  }
);
  selectAllTablesButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    final SelectionEvent e){
      try {
        parentWizardPage.getWizard().getContainer().run(true,true,new IRunnableWithProgress(){
          @Override public void run(          final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
            PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable(){
              @Override public void run(){
                monitor.beginTask("String_Node_Str",tree.getItems().length);
                int length=tree.getItems().length;
                updateStatus(IStatus.ERROR,null);
                for (int i=0; i < length; i++) {
                  monitor.worked(i + 1);
                  TreeItem catalogItem=tree.getItem(i);
                  int type=((TableNode)catalogItem.getData()).getType();
                  if (type == TableNode.CATALOG) {
                    for (                    TreeItem schemaItem : catalogItem.getItems()) {
                      if (schemaItem.getData() != null) {
                        int t=((TableNode)schemaItem.getData()).getType();
                        if (t == TableNode.SCHEMA) {
                          for (                          TreeItem tableItem : schemaItem.getItems()) {
                            updateItem(tableItem,true,false);
                          }
                          schemaItem.setChecked(true);
                        }
 else                         if (t == TableNode.TABLE) {
                          updateItem(schemaItem,true,false);
                        }
                      }
                    }
                    catalogItem.setChecked(true);
                    catalogItem.setGrayed(true);
                  }
 else                   if (type == TableNode.SCHEMA) {
                    for (                    TreeItem tableItem : catalogItem.getItems()) {
                      updateItem(tableItem,true,false);
                    }
                    catalogItem.setChecked(true);
                    catalogItem.setGrayed(true);
                  }
 else                   if (type == TableNode.TABLE) {
                    updateItem(catalogItem,true,false);
                  }
                }
                if (forTemplate) {
                  parentWizardPage.setPageComplete(true);
                }
                monitor.done();
              }
            }
);
          }
        }
);
      }
 catch (      InvocationTargetException e1) {
        ExceptionHandler.process(e1);
      }
catch (      InterruptedException e1) {
        ExceptionHandler.process(e1);
      }
    }
  }
);
  selectNoneTablesButton.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    final SelectionEvent e){
      count=0;
      countSuccess=0;
      countPending=0;
      for (      TreeItem catalogItem : tree.getItems()) {
        int type=((TableNode)catalogItem.getData()).getType();
        if (type == TableNode.CATALOG) {
          for (          TreeItem schemaItem : catalogItem.getItems()) {
            if (schemaItem.getData() != null) {
              int t=((TableNode)schemaItem.getData()).getType();
              if (t == TableNode.SCHEMA) {
                for (                TreeItem tableItem : schemaItem.getItems()) {
                  updateItem(tableItem,false,false);
                }
                schemaItem.setChecked(false);
              }
 else               if (t == TableNode.TABLE) {
                updateItem(schemaItem,false,false);
              }
            }
          }
          catalogItem.setChecked(false);
        }
 else         if (type == TableNode.SCHEMA) {
          for (          TreeItem tableItem : catalogItem.getItems()) {
            updateItem(tableItem,false,false);
          }
          catalogItem.setChecked(false);
        }
 else         if (type == TableNode.TABLE) {
          updateItem(catalogItem,false,false);
        }
      }
      if (forTemplate) {
        parentWizardPage.setPageComplete(false);
      }
    }
  }
);
  addTableListener();
}