Program: 74784
Project: 74784
Buggy source:
/** 
 * get parsed parameters with default value.
 * @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(); ) {
    ParameterDefinition parameter=(ParameterDefinition)iter.next();
    if (parameter == null)     continue;
    String paramName=parameter.getName();
    Object paramObj=this.parametersAsString.get(paramName);
    if (paramObj != null) {
      String format=ParameterAccessor.getFormat(request,paramName);
      if (format == null || format.length() <= 0) {
        format=parameter.getPattern();
      }
      String dataType=ParameterDataTypeConverter.ConvertDataType(parameter.getDataType());
      boolean isLocale=this.locParams.contains(paramName);
      List paramList=null;
      if (paramObj instanceof List) {
        paramList=(List)paramObj;
      }
 else {
        paramList=new ArrayList();
        paramList.add(paramObj);
      }
      for (int i=0; i < paramList.size(); i++) {
        try {
          Object paramValueObj=DataUtil.validate(dataType,format,(String)paramList.get(i),locale,isLocale);
          paramList.set(i,paramValueObj);
        }
 catch (        ValidationValueException e) {
          if (IBirtConstants.SERVLET_PATH_PREVIEW.equalsIgnoreCase(request.getServletPath())) {
            this.exception=e;
            break;
          }
        }
      }
      if (paramObj instanceof List) {
        params.put(paramName,paramList.toArray());
      }
 else {
        params.put(paramName,paramList.get(0));
      }
    }
 else {
      Object paramValueObj=null;
      if (!this.parametersAsString.containsKey(paramName)) {
        paramValueObj=this.defaultValues.get(paramName);
      }
      if (parameter.isMultiValue()) {
        params.put(paramName,new Object[]{paramValueObj});
      }
 else {
        params.put(paramName,paramValueObj);
      }
    }
  }
  return params;
}

Fixed version (ground truth):
/** 
 * get parsed parameters with default value.
 * @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(); ) {
    ParameterDefinition parameter=(ParameterDefinition)iter.next();
    if (parameter == null)     continue;
    String paramName=parameter.getName();
    Object paramObj=this.parametersAsString.get(paramName);
    if (paramObj != null) {
      String format=ParameterAccessor.getFormat(request,paramName);
      if (format == null || format.length() <= 0) {
        format=parameter.getPattern();
      }
      String dataType=ParameterDataTypeConverter.ConvertDataType(parameter.getDataType());
      boolean isLocale=this.locParams.contains(paramName);
      List paramList=null;
      if (paramObj instanceof List) {
        paramList=(List)paramObj;
      }
 else {
        paramList=new ArrayList();
        paramList.add(paramObj);
      }
      for (int i=0; i < paramList.size(); i++) {
        try {
          Object paramValueObj=DataUtil.validate(paramName,dataType,format,(String)paramList.get(i),locale,isLocale);
          paramList.set(i,paramValueObj);
        }
 catch (        ViewerValidationException e) {
          if (IBirtConstants.SERVLET_PATH_PREVIEW.equalsIgnoreCase(request.getServletPath())) {
            this.exception=e;
            break;
          }
        }
      }
      if (paramObj instanceof List) {
        params.put(paramName,paramList.toArray());
      }
 else {
        params.put(paramName,paramList.get(0));
      }
    }
 else {
      Object paramValueObj=null;
      if (!this.parametersAsString.containsKey(paramName)) {
        paramValueObj=this.defaultValues.get(paramName);
      }
      if (parameter.isMultiValue()) {
        params.put(paramName,new Object[]{paramValueObj});
      }
 else {
        params.put(paramName,paramValueObj);
      }
    }
  }
  return params;
}