Program: 76943
Project: 76943
Buggy source:
/** 
 * parse paramenters from config file.
 * @param request HttpServletRequest
 * @param parameterList
 * @return
 */
protected void parseConfigVars(HttpServletRequest request,Collection parameterList){
  this.configMap=new HashMap();
  String reportConfigName=ParameterAccessor.getConfigFileName(this.reportDesignName);
  if (reportConfigName == null)   return;
  SessionHandle sessionHandle=DesignEngine.newSession(ULocale.US);
  ReportDesignHandle handle=null;
  try {
    handle=sessionHandle.openDesign(reportConfigName);
    if (handle != null) {
      String displayTextParam=null;
      Iterator configVars=handle.configVariablesIterator();
      while (configVars != null && configVars.hasNext()) {
        ConfigVariableHandle configVar=(ConfigVariableHandle)configVars.next();
        if (configVar != null && configVar.getName() != null) {
          String paramName=configVar.getName();
          String paramValue=configVar.getValue();
          if (paramName.toLowerCase().startsWith(ParameterAccessor.PARAM_ISNULL) && paramValue != null) {
            String nullParamName=getParameterName(paramValue);
            if (nullParamName != null)             this.configMap.put(nullParamName,null);
            continue;
          }
 else           if ((displayTextParam=ParameterAccessor.isDisplayText(paramName)) != null) {
            paramName=getParameterName(displayTextParam);
            if (paramName != null) {
              if (this.displayTexts == null)               this.displayTexts=new HashMap();
              this.displayTexts.put(paramName,paramValue);
            }
            continue;
          }
          paramName=getParameterName(paramName);
          ScalarParameterHandle parameter=(ScalarParameterHandle)findParameter(paramName);
          if (paramValue != null && parameter != null) {
            String typeVarName=configVar.getName() + "String_Node_Str" + IBirtConstants.PROP_TYPE;
            ConfigVariable typeVar=handle.findConfigVariable(typeVarName);
            String dataType=parameter.getDataType();
            String cachedDateType=null;
            if (typeVar != null)             cachedDateType=typeVar.getValue();
            if (cachedDateType == null || !cachedDateType.equalsIgnoreCase(dataType)) {
              continue;
            }
            try {
              if (!DesignChoiceConstants.PARAM_TYPE_STRING.equalsIgnoreCase(dataType) && !DesignChoiceConstants.PARAM_TYPE_DATETIME.equalsIgnoreCase(dataType)) {
                String pattern=parameter.getPattern();
                Object paramValueObj=ParameterValidationUtil.validate(dataType,pattern,paramValue,ULocale.US);
                paramValue=ParameterValidationUtil.getDisplayValue(dataType,pattern,paramValueObj,locale);
              }
            }
 catch (            Exception err) {
              paramValue=configVar.getValue();
            }
            this.configMap.put(paramName,paramValue);
          }
        }
      }
      handle.close();
    }
  }
 catch (  Exception e) {
  }
}

Fixed version (ground truth):
/** 
 * parse paramenters from config file.
 * @param request HttpServletRequest
 * @param parameterList
 * @return
 */
protected void parseConfigVars(HttpServletRequest request,Collection parameterList){
  this.configMap=new HashMap();
  String reportConfigName=ParameterAccessor.getConfigFileName(this.reportDesignName);
  if (reportConfigName == null)   return;
  SessionHandle sessionHandle=DesignEngine.newSession(ULocale.US);
  ReportDesignHandle handle=null;
  try {
    handle=sessionHandle.openDesign(reportConfigName);
    if (handle != null) {
      String displayTextParam=null;
      Iterator configVars=handle.configVariablesIterator();
      while (configVars != null && configVars.hasNext()) {
        ConfigVariableHandle configVar=(ConfigVariableHandle)configVars.next();
        if (configVar != null && configVar.getName() != null) {
          String paramName=configVar.getName();
          Object paramValue=configVar.getValue();
          if (paramName.toLowerCase().startsWith(ParameterAccessor.PARAM_ISNULL) && paramValue != null) {
            String nullParamName=getParameterName((String)paramValue);
            if (nullParamName != null)             this.configMap.put(nullParamName,null);
            continue;
          }
 else           if ((displayTextParam=ParameterAccessor.isDisplayText(paramName)) != null) {
            paramName=getParameterName(displayTextParam);
            if (paramName != null) {
              if (this.displayTexts == null)               this.displayTexts=new HashMap();
              this.displayTexts.put(paramName,paramValue);
            }
            continue;
          }
          paramName=getParameterName(paramName);
          ScalarParameterHandle parameter=(ScalarParameterHandle)findParameter(paramName);
          if (paramValue != null && parameter != null) {
            String typeVarName=configVar.getName() + "String_Node_Str" + IBirtConstants.PROP_TYPE;
            ConfigVariable typeVar=handle.findConfigVariable(typeVarName);
            String dataType=parameter.getDataType();
            String cachedDateType=null;
            if (typeVar != null)             cachedDateType=typeVar.getValue();
            if (cachedDateType == null || !cachedDateType.equalsIgnoreCase(dataType)) {
              continue;
            }
            try {
              if (!DesignChoiceConstants.PARAM_TYPE_STRING.equalsIgnoreCase(dataType)) {
                String pattern=parameter.getPattern();
                Object paramValueObj=ParameterValidationUtil.validate(dataType,pattern,(String)paramValue,ULocale.US);
                if (DesignChoiceConstants.PARAM_TYPE_DATETIME.equalsIgnoreCase(dataType))                 paramValue=paramValueObj;
 else                 paramValue=ParameterValidationUtil.getDisplayValue(dataType,pattern,paramValueObj,locale);
              }
            }
 catch (            Exception err) {
              paramValue=configVar.getValue();
            }
            this.configMap.put(paramName,paramValue);
          }
        }
      }
      handle.close();
    }
  }
 catch (  Exception e) {
  }
}