Program: 77417
Project: 77417
Buggy source:
/** 
 * get parsed parameters.
 * @param design IViewerReportDesignHandle
 * @param parameterList Collection
 * @param request HttpServletRequest
 * @param options InputOptions
 * @return Map
 */
protected Map getParsedParameters(IViewerReportDesignHandle design,Collection parameterList,HttpServletRequest request,InputOptions options) throws ReportServiceException {
  Map params=new HashMap();
  if (parameterList == null || this.parametersAsString == null)   return params;
  for (Iterator iter=parameterList.iterator(); iter.hasNext(); ) {
    ScalarParameterHandle parameter=null;
    Object parameterObj=iter.next();
    if (parameterObj instanceof ScalarParameterHandle) {
      parameter=(ScalarParameterHandle)parameterObj;
    }
    if (parameter == null)     continue;
    String paramName=parameter.getName();
    Object paramValueObj=this.parametersAsString.get(paramName);
    if (paramValueObj != null) {
      try {
        String format=ParameterAccessor.getFormat(request,paramName);
        if (format != null && format.length() > 0) {
          paramValueObj=ParameterValidationUtil.validate(parameter.getDataType(),format,paramValueObj.toString(),locale);
        }
 else {
          try {
            paramValueObj=ParameterValidationUtil.validate(parameter.getDataType(),parameter.getPattern(),paramValueObj.toString(),locale);
          }
 catch (          ValidationValueException e1) {
            paramValueObj=ParameterValidationUtil.validate(parameter.getDataType(),ParameterValidationUtil.DEFAULT_DATETIME_FORMAT,paramValueObj.toString());
          }
        }
        params.put(paramName,paramValueObj);
      }
 catch (      ValidationValueException e) {
        if (ParameterAccessor.SERVLET_PATH_RUN.equalsIgnoreCase(request.getServletPath())) {
          this.exception=e;
          break;
        }
      }
    }
 else {
      params.put(paramName,null);
    }
  }
  return params;
}

Fixed version (ground truth):
/** 
 * get parsed parameters.
 * @param design IViewerReportDesignHandle
 * @param parameterList Collection
 * @param request HttpServletRequest
 * @param options InputOptions
 * @return Map
 */
protected Map getParsedParameters(IViewerReportDesignHandle design,Collection parameterList,HttpServletRequest request,InputOptions options) throws ReportServiceException {
  Map params=new HashMap();
  if (parameterList == null || this.parametersAsString == null)   return params;
  for (Iterator iter=parameterList.iterator(); iter.hasNext(); ) {
    ScalarParameterHandle parameter=null;
    Object parameterObj=iter.next();
    if (parameterObj instanceof ScalarParameterHandle) {
      parameter=(ScalarParameterHandle)parameterObj;
    }
    if (parameter == null)     continue;
    String paramName=parameter.getName();
    Object paramValueObj=this.parametersAsString.get(paramName);
    if (paramValueObj != null) {
      try {
        String format=ParameterAccessor.getFormat(request,paramName);
        if (format == null || format.length() <= 0) {
          format=parameter.getPattern();
        }
        paramValueObj=DataUtil.validate(parameter.getDataType(),format,paramValueObj.toString(),locale);
        params.put(paramName,paramValueObj);
      }
 catch (      ValidationValueException e) {
        if (ParameterAccessor.SERVLET_PATH_RUN.equalsIgnoreCase(request.getServletPath())) {
          this.exception=e;
          break;
        }
      }
    }
 else {
      params.put(paramName,null);
    }
  }
  return params;
}