Program: 70783
Project: 70783
Buggy source:
/** 
 * parse paramenters from config file.
 * @param request HttpServletRequest
 * @param parameterList Collection
 * @return
 */
protected void parseConfigVars(HttpServletRequest request,Collection parameterList){
  this.configMap=new HashMap();
  if (this.displayTexts == null)   this.displayTexts=new HashMap();
  String reportConfigName=ParameterAccessor.getConfigFileName(this.reportDesignName);
  if (reportConfigName == null)   return;
  File configFile=new File(reportConfigName);
  if (!configFile.exists() || !configFile.isFile()) {
    return;
  }
  SessionHandle sessionHandle=new DesignEngine(null).newSessionHandle(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) {
          String varName=prepareConfigVarName(configVar.getName());
          Object varValue=configVar.getValue();
          if (varName == null || varValue == null)           continue;
          String tempName=varName;
          String paramName=null;
          if (varName.toLowerCase().startsWith(ParameterAccessor.PARAM_ISNULL)) {
            tempName=(String)varValue;
          }
 else           if ((displayTextParam=ParameterAccessor.isDisplayText(varName)) != null) {
            tempName=displayTextParam;
          }
          paramName=getParameterName(tempName,parameterList);
          ParameterDefinition parameter=BirtUtility.findParameterDefinition(parameterList,paramName);
          if (parameter != null) {
            String typeVarName=tempName + "String_Node_Str" + IBirtConstants.PROP_TYPE+ "String_Node_Str";
            ConfigVariable typeVar=handle.findConfigVariable(typeVarName);
            String dataType=ParameterDataTypeConverter.ConvertDataType(parameter.getDataType());
            String cachedDateType=null;
            if (typeVar != null)             cachedDateType=typeVar.getValue();
            if (cachedDateType == null || !cachedDateType.equalsIgnoreCase(dataType))             continue;
            String exprVarName=tempName + "String_Node_Str" + IBirtConstants.PROP_EXPR+ "String_Node_Str";
            ConfigVariable exprVar=handle.findConfigVariable(exprVarName);
            String cachedExpr=null;
            if (exprVar != null)             cachedExpr=exprVar.getValue();
            if (cachedExpr == null)             cachedExpr="String_Node_Str";
            String expr=parameter.getValueExpr();
            if (expr == null)             expr="String_Node_Str";
            if (!cachedExpr.equals(expr))             continue;
            List values=null;
            if (parameter.isMultiValue()) {
              values=(List)this.configMap.get(paramName);
              if (values == null) {
                values=new ArrayList();
                this.configMap.put(paramName,values);
              }
            }
            if (varName.toLowerCase().startsWith(ParameterAccessor.PARAM_ISNULL)) {
              if (parameter.isMultiValue())               values.add(null);
 else               this.configMap.put(paramName,null);
            }
 else             if ((displayTextParam=ParameterAccessor.isDisplayText(varName)) != null) {
              this.displayTexts.put(paramName,varValue);
            }
 else {
              Object varObj=null;
              try {
                varObj=DataUtil.convert(varValue,parameter.getDataType());
              }
 catch (              Exception e) {
                varObj=varValue;
              }
              if (parameter.isMultiValue())               values.add(varObj);
 else               this.configMap.put(paramName,varObj);
            }
          }
        }
      }
      handle.close();
    }
  }
 catch (  Exception e) {
  }
}

Fixed version (ground truth):
/** 
 * parse paramenters from config file.
 * @param request HttpServletRequest
 * @param parameterList Collection
 * @return
 */
protected void parseConfigVars(HttpServletRequest request,Collection parameterList){
  this.configMap=new HashMap();
  if (this.displayTexts == null)   this.displayTexts=new HashMap();
  String reportConfigName=ParameterAccessor.getConfigFileName(this.reportDesignName);
  if (reportConfigName == null)   return;
  File configFile=new File(reportConfigName);
  if (!configFile.exists() || !configFile.isFile()) {
    return;
  }
  SessionHandle sessionHandle=new DesignEngine(null).newSessionHandle(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) {
          String varName=prepareConfigVarName(configVar.getName());
          Object varValue=configVar.getValue();
          if (varName == null || varValue == null)           continue;
          String tempName=varName;
          String paramName=null;
          if (varName.toLowerCase().startsWith(ParameterAccessor.PARAM_ISNULL)) {
            tempName=(String)varValue;
          }
 else           if ((displayTextParam=ParameterAccessor.isDisplayText(varName)) != null) {
            tempName=displayTextParam;
          }
          paramName=getParameterName(tempName,parameterList);
          ParameterDefinition parameter=BirtUtility.findParameterDefinition(parameterList,paramName);
          if (parameter != null) {
            String typeVarName=tempName + "String_Node_Str" + IBirtConstants.PROP_TYPE+ "String_Node_Str";
            ConfigVariable typeVar=handle.findConfigVariable(typeVarName);
            String dataType=ParameterDataTypeConverter.convertDataType(parameter.getDataType());
            String cachedDateType=null;
            if (typeVar != null)             cachedDateType=typeVar.getValue();
            if (cachedDateType == null || !cachedDateType.equalsIgnoreCase(dataType))             continue;
            String exprVarName=tempName + "String_Node_Str" + IBirtConstants.PROP_EXPR+ "String_Node_Str";
            ConfigVariable exprVar=handle.findConfigVariable(exprVarName);
            String cachedExpr=null;
            if (exprVar != null)             cachedExpr=exprVar.getValue();
            if (cachedExpr == null)             cachedExpr="String_Node_Str";
            String expr=parameter.getValueExpr();
            if (expr == null)             expr="String_Node_Str";
            if (!cachedExpr.equals(expr))             continue;
            List values=null;
            if (parameter.isMultiValue()) {
              values=(List)this.configMap.get(paramName);
              if (values == null) {
                values=new ArrayList();
                this.configMap.put(paramName,values);
              }
            }
            if (varName.toLowerCase().startsWith(ParameterAccessor.PARAM_ISNULL)) {
              if (parameter.isMultiValue())               values.add(null);
 else               this.configMap.put(paramName,null);
            }
 else             if ((displayTextParam=ParameterAccessor.isDisplayText(varName)) != null) {
              this.displayTexts.put(paramName,varValue);
            }
 else {
              Object varObj=null;
              try {
                varObj=DataUtil.convert(varValue,parameter.getDataType());
              }
 catch (              Exception e) {
                varObj=varValue;
              }
              if (parameter.isMultiValue())               values.add(varObj);
 else               this.configMap.put(paramName,varObj);
            }
          }
        }
      }
      handle.close();
    }
  }
 catch (  Exception e) {
  }
}