Program: 70784
Project: 70784
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(paramName,dataType,format,(String)paramList.get(i),locale,timeZone,isLocale);
          paramList.set(i,paramValueObj);
        }
 catch (        ViewerValidationException e) {
          if (IBirtConstants.SERVLET_PATH_PREVIEW.equalsIgnoreCase(request.getServletPath())) {
            this.exception=e;
            break;
          }
          paramList.set(i,paramList.get(i));
        }
      }
      if (paramObj instanceof List) {
        List list=(List)paramObj;
        if (list.size() == 0 || (list.size() == 1 && list.get(0) == null))         params.put(paramName,null);
 else         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()) {
        if (paramValueObj == null)         params.put(paramName,null);
 else         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,timeZone,isLocale);
          paramList.set(i,paramValueObj);
        }
 catch (        ViewerValidationException e) {
          if (IBirtConstants.SERVLET_PATH_PREVIEW.equalsIgnoreCase(request.getServletPath())) {
            this.exception=e;
            break;
          }
          paramList.set(i,paramList.get(i));
        }
      }
      if (paramObj instanceof List) {
        List list=(List)paramObj;
        if (list.size() == 0 || (list.size() == 1 && list.get(0) == null))         params.put(paramName,null);
 else         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()) {
        if (paramValueObj == null)         params.put(paramName,null);
 else         params.put(paramName,new Object[]{paramValueObj});
      }
 else {
        params.put(paramName,paramValueObj);
      }
    }
  }
  return params;
}