Program: 76944
Project: 76944
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) {
      if (paramValueObj instanceof Date) {
        params.put(paramName,paramValueObj);
        continue;
      }
      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;
}

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) {
      if (paramValueObj instanceof Date) {
        params.put(paramName,paramValueObj);
        continue;
      }
      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_PREVIEW.equalsIgnoreCase(request.getServletPath())) {
          this.exception=e;
          break;
        }
      }
    }
 else {
      params.put(paramName,null);
    }
  }
  return params;
}