Program: 139362
Project: 139362
Buggy source:
/** 
 * DOC xqliu Comment method "createPatternCheckedTreeSelectionDialog".
 * @param libProject
 * @return
 */
public static CheckedTreeSelectionDialog createPatternCheckedTreeSelectionDialog(IFolder libProject){
  CheckedTreeSelectionDialog dialog=new CheckedTreeSelectionDialog(null,new PatternLabelProvider(),new WorkbenchContentProvider());
  dialog.setInput(libProject);
  dialog.setValidator(new ISelectionStatusValidator(){
    public IStatus validate(    Object[] selection){
      IStatus status=Status.OK_STATUS;
      for (      Object patte : selection) {
        if (patte instanceof IFile) {
          IFile file=(IFile)patte;
          if (FactoriesUtil.PATTERN.equals(file.getFileExtension())) {
            Pattern findPattern=PatternResourceFileHelper.getInstance().findPattern(file);
            boolean validStatus=TaggedValueHelper.getValidStatus(findPattern);
            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.PATTERN.equals(file.getFileExtension())) {
          return true;
        }
      }
 else       if (element instanceof IFolder) {
        IFolder folder=(IFolder)element;
        return ResourceManager.isSubFolder(ResourceManager.getPatternFolder(),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 "createPatternCheckedTreeSelectionDialog".
 * @param libProject
 * @return
 */
public static CheckedTreeSelectionDialog createPatternCheckedTreeSelectionDialog(IFolder libProject){
  CheckedTreeSelectionDialog dialog=new CheckedTreeSelectionDialog(null,new PatternLabelProvider(),new WorkbenchContentProvider());
  dialog.setInput(libProject);
  dialog.setValidator(new ISelectionStatusValidator(){
    public IStatus validate(    Object[] selection){
      IStatus status=Status.OK_STATUS;
      for (      Object patte : selection) {
        if (patte instanceof IFile) {
          IFile file=(IFile)patte;
          if (FactoriesUtil.PATTERN.equals(file.getFileExtension())) {
            Pattern findPattern=PatternResourceFileHelper.getInstance().findPattern(file);
            boolean validStatus=TaggedValueHelper.getValidStatus(findPattern);
            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.PATTERN.equals(file.getFileExtension())) {
          return true;
        }
      }
 else       if (element instanceof IFolder) {
        IFolder folder=(IFolder)element;
        return ResourceService.isSubFolder(ResourceManager.getPatternFolder(),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;
}