Program: 137566
Project: 137566
Buggy source:
/** 
 * DOC xqliu Comment method "showAddDQRuleDialog".
 * @param treeItem
 * @param tableIndicator
 */
private void showAddDQRuleDialog(final TreeItem treeItem,final TableIndicator tableIndicator){
  IndicatorCheckedTreeSelectionDialog dialog=new IndicatorCheckedTreeSelectionDialog(null,new DQRuleLabelProvider(),new WorkbenchContentProvider());
  dialog.setInput(ResourceManager.getLibrariesFolder());
  dialog.setValidator(new ISelectionStatusValidator(){
    public IStatus validate(    Object[] selection){
      IStatus status=Status.OK_STATUS;
      for (      Object whereRule : selection) {
        if (whereRule instanceof IFile) {
          IFile file=(IFile)whereRule;
          if (FactoriesUtil.DQRULE.equals(file.getFileExtension())) {
            WhereRule findWhereRule=DQRuleResourceFileHelper.getInstance().findWhereRule(file);
            boolean validStatus=TaggedValueHelper.getValidStatus(findWhereRule);
            if (!validStatus) {
              status=new Status(IStatus.ERROR,CorePlugin.PLUGIN_ID,DefaultMessagesImpl.getString("String_Node_Str"));
            }
          }
        }
      }
      return status;
    }
  }
);
  dialog.addFilter(AnalysisExecutorHelper.createRuleFilter());
  dialog.setContainerMode(true);
  dialog.setTitle(DefaultMessagesImpl.getString("String_Node_Str"));
  dialog.setMessage(DefaultMessagesImpl.getString("String_Node_Str"));
  dialog.setSize(80,30);
  dialog.create();
  IFolder whereRuleFolder=ResourceManager.getRulesFolder();
  Object[] ownedWhereRuleFiles=getOwnedWhereRuleFiles(tableIndicator,whereRuleFolder);
  dialog.setCheckedElements(ownedWhereRuleFiles);
  if (dialog.open() == Window.OK) {
    removeUncheckedWhereRuleIndicator(ownedWhereRuleFiles,dialog.getResult(),tableIndicator,whereRuleFolder);
    Object[] results=clearAddedResult(ownedWhereRuleFiles,dialog.getResult());
    for (    Object obj : results) {
      if (obj instanceof IFile) {
        IFile file=(IFile)obj;
        TableIndicatorUnit addIndicatorUnit=DQRuleUtilities.createIndicatorUnit(file,tableIndicator,getAnalysis());
        if (addIndicatorUnit != null) {
          createOneUnit(treeItem,addIndicatorUnit);
          setDirty(true);
        }
 else {
          WhereRule whereRule=DQRuleResourceFileHelper.getInstance().findWhereRule(file);
          MessageUI.openError(DefaultMessagesImpl.getString("String_Node_Str",whereRule.getName()));
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "showAddDQRuleDialog".
 * @param treeItem
 * @param tableIndicator
 */
private void showAddDQRuleDialog(final TreeItem treeItem,final TableIndicator tableIndicator){
  IndicatorCheckedTreeSelectionDialog dialog=new IndicatorCheckedTreeSelectionDialog(null,new DQRuleLabelProvider(),new WorkbenchContentProvider());
  dialog.setInput(ResourceManager.getLibrariesFolder());
  dialog.setValidator(new ISelectionStatusValidator(){
    public IStatus validate(    Object[] selection){
      IStatus status=Status.OK_STATUS;
      for (      Object whereRule : selection) {
        if (whereRule instanceof IFile) {
          IFile file=(IFile)whereRule;
          if (FactoriesUtil.DQRULE.equals(file.getFileExtension())) {
            WhereRule findWhereRule=DQRuleResourceFileHelper.getInstance().findWhereRule(file);
            boolean validStatus=TaggedValueHelper.getValidStatus(findWhereRule);
            if (!validStatus) {
              status=new Status(IStatus.ERROR,CorePlugin.PLUGIN_ID,DefaultMessagesImpl.getString("String_Node_Str"));
            }
          }
        }
      }
      return status;
    }
  }
);
  dialog.addFilter(AnalysisUtils.createRuleFilter());
  dialog.setContainerMode(true);
  dialog.setTitle(DefaultMessagesImpl.getString("String_Node_Str"));
  dialog.setMessage(DefaultMessagesImpl.getString("String_Node_Str"));
  dialog.setSize(80,30);
  dialog.create();
  IFolder whereRuleFolder=ResourceManager.getRulesFolder();
  Object[] ownedWhereRuleFiles=getOwnedWhereRuleFiles(tableIndicator,whereRuleFolder);
  dialog.setCheckedElements(ownedWhereRuleFiles);
  if (dialog.open() == Window.OK) {
    removeUncheckedWhereRuleIndicator(ownedWhereRuleFiles,dialog.getResult(),tableIndicator,whereRuleFolder);
    Object[] results=clearAddedResult(ownedWhereRuleFiles,dialog.getResult());
    for (    Object obj : results) {
      if (obj instanceof IFile) {
        IFile file=(IFile)obj;
        TableIndicatorUnit addIndicatorUnit=DQRuleUtilities.createIndicatorUnit(file,tableIndicator,getAnalysis());
        if (addIndicatorUnit != null) {
          createOneUnit(treeItem,addIndicatorUnit);
          setDirty(true);
        }
 else {
          WhereRule whereRule=DQRuleResourceFileHelper.getInstance().findWhereRule(file);
          MessageUI.openError(DefaultMessagesImpl.getString("String_Node_Str",whereRule.getName()));
        }
      }
    }
  }
}