Program: 166417
Project: 166417
Buggy source:
/** 
 * @param request
 * @param sortFields
 * @return
 */
public SearchCriteria extractCommonCriterias(HttpServletRequest request,List<SortField> sortFields){
  SearchCriteria searchCriteria=new SearchCriteria();
  int startIndex=restErrorUtil.parseInt(request.getParameter("String_Node_Str"),0,"String_Node_Str",MessageEnums.INVALID_INPUT_DATA,null,"String_Node_Str");
  searchCriteria.setStartIndex(startIndex);
  int pageSize=restErrorUtil.parseInt(request.getParameter("String_Node_Str"),configUtil.getDefaultMaxRows(),"String_Node_Str",MessageEnums.INVALID_INPUT_DATA,null,"String_Node_Str");
  searchCriteria.setMaxRows(pageSize);
  searchCriteria.setGetCount(restErrorUtil.parseBoolean(request.getParameter("String_Node_Str"),true));
  searchCriteria.setOwnerId(restErrorUtil.parseLong(request.getParameter("String_Node_Str"),null));
  searchCriteria.setGetChildren(restErrorUtil.parseBoolean(request.getParameter("String_Node_Str"),false));
  String sortBy=restErrorUtil.validateString(request.getParameter("String_Node_Str"),StringUtil.VALIDATION_ALPHA,"String_Node_Str",MessageEnums.INVALID_INPUT_DATA,null,"String_Node_Str");
  boolean sortSet=false;
  if (!stringUtil.isEmpty(sortBy)) {
    for (    SortField sortField : sortFields) {
      if (sortField.getParamName().equalsIgnoreCase(sortBy)) {
        searchCriteria.setSortBy(sortField.getParamName());
        String sortType=restErrorUtil.validateString(request.getParameter("String_Node_Str"),StringUtil.VALIDATION_ALPHA,"String_Node_Str",MessageEnums.INVALID_INPUT_DATA,null,"String_Node_Str");
        searchCriteria.setSortType(sortType);
        sortSet=true;
        break;
      }
    }
  }
  if (!sortSet && !stringUtil.isEmpty(sortBy)) {
    logger.info("String_Node_Str" + sortBy,new Throwable());
  }
  return searchCriteria;
}

Fixed version (ground truth):
/** 
 * @param request
 * @param sortFields
 * @return
 */
public SearchCriteria extractCommonCriterias(HttpServletRequest request,List<SortField> sortFields){
  SearchCriteria searchCriteria=new SearchCriteria();
  int startIndex=restErrorUtil.parseInt(request.getParameter("String_Node_Str"),0,"String_Node_Str",MessageEnums.INVALID_INPUT_DATA,null,"String_Node_Str");
  startIndex=startIndex < 0 ? 0 : startIndex;
  searchCriteria.setStartIndex(startIndex);
  int pageSize=restErrorUtil.parseInt(request.getParameter("String_Node_Str"),configUtil.getDefaultMaxRows(),"String_Node_Str",MessageEnums.INVALID_INPUT_DATA,null,"String_Node_Str");
  searchCriteria.setMaxRows(pageSize);
  searchCriteria.setGetCount(restErrorUtil.parseBoolean(request.getParameter("String_Node_Str"),true));
  searchCriteria.setOwnerId(restErrorUtil.parseLong(request.getParameter("String_Node_Str"),null));
  searchCriteria.setGetChildren(restErrorUtil.parseBoolean(request.getParameter("String_Node_Str"),false));
  String sortBy=restErrorUtil.validateString(request.getParameter("String_Node_Str"),StringUtil.VALIDATION_ALPHA,"String_Node_Str",MessageEnums.INVALID_INPUT_DATA,null,"String_Node_Str");
  boolean sortSet=false;
  if (!stringUtil.isEmpty(sortBy)) {
    for (    SortField sortField : sortFields) {
      if (sortField.getParamName().equalsIgnoreCase(sortBy)) {
        searchCriteria.setSortBy(sortField.getParamName());
        String sortType=restErrorUtil.validateString(request.getParameter("String_Node_Str"),StringUtil.VALIDATION_ALPHA,"String_Node_Str",MessageEnums.INVALID_INPUT_DATA,null,"String_Node_Str");
        searchCriteria.setSortType(sortType);
        sortSet=true;
        break;
      }
    }
  }
  if (!sortSet && !stringUtil.isEmpty(sortBy)) {
    logger.info("String_Node_Str" + sortBy,new Throwable());
  }
  return searchCriteria;
}