Program: 125092
Project: 125092
Buggy source:
@Override protected void addFieldsListeners(){
  nameFilter.addModifyListener(new ModifyListener(){
    @Override public void modifyText(    ModifyEvent e){
      schemaTreeViewer.refresh();
    }
  }
);
  schemaTree.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    final SelectionEvent e){
      if (e.detail == SWT.CHECK) {
        TreeItem treeItem=(TreeItem)e.item;
        IHDFSNode node=(IHDFSNode)treeItem.getData();
        boolean promptNeeded=treeItem.getChecked();
        EHadoopFileTypes type=node.getType();
        if (type != EHadoopFileTypes.FILE) {
          treeItem.setGrayed(true);
        }
        if (type == EHadoopFileTypes.FILE) {
          if (promptNeeded) {
            MetadataTable existTable=HDFSSchemaUtil.getTableByName(getConnection(),treeItem.getText(0));
            if (existTable != null) {
              refreshExistItem(existTable,treeItem);
            }
 else {
              treeItem.setText(3,EMPTY_STRING);
              treeItem.setText(4,Messages.getString("String_Node_Str"));
              countPending++;
              parentWizardPage.setPageComplete(false);
              refreshTable(treeItem,-1);
            }
          }
 else {
            clearTreeItem(treeItem);
            if (treeItem.getText() != null && treeItem.getText().equals(Messages.getString("String_Node_Str"))) {
              countPending--;
            }
          }
        }
 else         if (type == EHadoopFileTypes.FOLDER) {
          fetchAllChildren(node);
          for (          TreeItem tItem : treeItem.getItems()) {
            updateItem(tItem,promptNeeded,true);
          }
        }
      }
    }
  }
);
}

Fixed version (ground truth):
@Override protected void addFieldsListeners(){
  nameFilter.addModifyListener(new ModifyListener(){
    @Override public void modifyText(    ModifyEvent e){
      schemaTreeViewer.refresh();
    }
  }
);
  schemaTree.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    final SelectionEvent e){
      if (e.detail == SWT.CHECK) {
        TreeItem treeItem=(TreeItem)e.item;
        IHDFSNode node=(IHDFSNode)treeItem.getData();
        boolean promptNeeded=treeItem.getChecked();
        EHadoopFileTypes type=node.getType();
        if (type != EHadoopFileTypes.FILE) {
          treeItem.setGrayed(true);
        }
        if (type == EHadoopFileTypes.FILE) {
          if (promptNeeded) {
            MetadataTable existTable=HDFSSchemaUtil.getTableByName(getConnection(),treeItem.getText(0));
            if (existTable != null) {
              refreshExistItem(existTable,treeItem);
            }
 else {
              treeItem.setText(3,EMPTY_STRING);
              treeItem.setText(4,Messages.getString("String_Node_Str"));
              parentWizardPage.setPageComplete(false);
              refreshTable(treeItem,-1);
            }
          }
 else {
            clearTreeItem(treeItem);
            if (treeItem.getText() != null && treeItem.getText().equals(Messages.getString("String_Node_Str"))) {
            }
          }
        }
 else         if (type == EHadoopFileTypes.FOLDER) {
          fetchAllChildren(node);
          for (          TreeItem tItem : treeItem.getItems()) {
            updateItem(tItem,promptNeeded,true);
          }
        }
      }
    }
  }
);
}