Program: 138831
Project: 138831
Buggy source:
/** 
 * DOC xqliu Comment method "createUdiCheckedTreeSelectionDialog".
 * @param udiProject
 * @return
 */
public static CheckedTreeSelectionDialog createUdiCheckedTreeSelectionDialog(IFolder udiProject){
  CheckedTreeSelectionDialog dialog=new CheckedTreeSelectionDialog(null,new UdiLabelProvider(),new WorkbenchContentProvider());
  dialog.setInput(udiProject);
  dialog.setValidator(new ISelectionStatusValidator(){
    public IStatus validate(    Object[] selection){
      IStatus status=Status.OK_STATUS;
      for (      Object udi : selection) {
        if (udi instanceof IFile) {
          IFile file=(IFile)udi;
          if (FactoriesUtil.DEFINITION.equals(file.getFileExtension())) {
            IndicatorDefinition findUdi=IndicatorResourceFileHelper.getInstance().findIndDefinition(file);
            boolean validStatus=TaggedValueHelper.getValidStatus(findUdi);
            if (!validStatus) {
              status=new Status(IStatus.ERROR,CorePlugin.PLUGIN_ID,DefaultMessagesImpl.getString("String_Node_Str"));
            }
          }
        }
      }
      return status;
    }
  }
);
  dialog.addFilter(new DQFolderFliter(true));
  dialog.addFilter(new ViewerFilter(){
    @Override public boolean select(    Viewer viewer,    Object parentElement,    Object element){
      if (element instanceof IFile) {
        IFile file=(IFile)element;
        if (FactoriesUtil.DEFINITION.equals(file.getFileExtension())) {
          return true;
        }
      }
 else       if (element instanceof IFolder) {
        IFolder folder=(IFolder)element;
        return ResourceService.isSubFolder(ResourceManager.getUDIFolder(),folder);
      }
      return false;
    }
  }
);
  dialog.setContainerMode(true);
  dialog.setTitle(DefaultMessagesImpl.getString("String_Node_Str"));
  dialog.setMessage(DefaultMessagesImpl.getString("String_Node_Str"));
  dialog.setSize(80,30);
  return dialog;
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "createUdiCheckedTreeSelectionDialog".
 * @param udiProject
 * @return
 */
public static CheckedTreeSelectionDialog createUdiCheckedTreeSelectionDialog(IFolder udiProject){
  CheckedTreeSelectionDialog dialog=new CheckedTreeSelectionDialog(null,new UdiLabelProvider(),new WorkbenchContentProvider());
  dialog.addFilter(new RecycleBinFilter());
  dialog.setInput(udiProject);
  dialog.setValidator(new ISelectionStatusValidator(){
    public IStatus validate(    Object[] selection){
      IStatus status=Status.OK_STATUS;
      for (      Object udi : selection) {
        if (udi instanceof IFile) {
          IFile file=(IFile)udi;
          if (FactoriesUtil.DEFINITION.equals(file.getFileExtension())) {
            IndicatorDefinition findUdi=IndicatorResourceFileHelper.getInstance().findIndDefinition(file);
            boolean validStatus=TaggedValueHelper.getValidStatus(findUdi);
            if (!validStatus) {
              status=new Status(IStatus.ERROR,CorePlugin.PLUGIN_ID,DefaultMessagesImpl.getString("String_Node_Str"));
            }
          }
        }
      }
      return status;
    }
  }
);
  dialog.addFilter(new DQFolderFliter(true));
  dialog.addFilter(new ViewerFilter(){
    @Override public boolean select(    Viewer viewer,    Object parentElement,    Object element){
      if (element instanceof IFile) {
        IFile file=(IFile)element;
        if (FactoriesUtil.DEFINITION.equals(file.getFileExtension())) {
          return true;
        }
      }
 else       if (element instanceof IFolder) {
        IFolder folder=(IFolder)element;
        return ResourceService.isSubFolder(ResourceManager.getUDIFolder(),folder);
      }
      return false;
    }
  }
);
  dialog.setContainerMode(true);
  dialog.setTitle(DefaultMessagesImpl.getString("String_Node_Str"));
  dialog.setMessage(DefaultMessagesImpl.getString("String_Node_Str"));
  dialog.setSize(80,30);
  return dialog;
}