Program: 73214
Project: 73214
Buggy source:
/** 
 * Get the parameter value from .rptconfig file if it does exist
 * @return Object[] the parameter value
 */
private Object getParamValue(ScalarParameterHandle paramHandle){
  String designFileName=designModule.getFileName();
  String reportConfigName=designFileName.substring(0,designFileName.length() - "String_Node_Str".length()) + "String_Node_Str";
  File file=new File(reportConfigName);
  if (file.exists()) {
    String paraName=paramHandle.getName();
    ScalarParameterHandle parameterHandle=(ScalarParameterHandle)designModule.findParameter(paraName);
    paraName=paraName + "String_Node_Str" + parameterHandle.getID();
    SessionHandle sessionHandle=new DesignEngine(null).newSessionHandle(ULocale.US);
    ReportDesignHandle rdHandle=null;
    try {
      rdHandle=sessionHandle.openDesign(reportConfigName);
    }
 catch (    DesignFileException e) {
      return null;
    }
    if (rdHandle != null) {
      List values=new ArrayList();
      Iterator configVars=rdHandle.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;
          }
          if (varName.equals(paraName)) {
            String value=(String)varValue;
            values.add(value);
          }
          if (isNullValue(varName,(String)varValue,paraName)) {
            if (!parameterHandle.getParamType().equals(DesignChoiceConstants.SCALAR_PARAM_TYPE_MULTI_VALUE)) {
              return null;
            }
            return new Object[0];
          }
        }
      }
      if (values.size() > 0) {
        if (parameterHandle.getParamType().equals(DesignChoiceConstants.SCALAR_PARAM_TYPE_SIMPLE)) {
          return values.get(0);
        }
        return values.toArray();
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Get the parameter value from .rptconfig file if it does exist
 * @return Object[] the parameter value
 */
private Object getParamValue(ScalarParameterHandle paramHandle){
  String designFileName=designModule.getFileName();
  String reportConfigName=designFileName.substring(0,designFileName.length() - "String_Node_Str".length()) + "String_Node_Str";
  File file=new File(reportConfigName);
  if (file.exists()) {
    String paraName=paramHandle.getName();
    ScalarParameterHandle parameterHandle=(ScalarParameterHandle)designModule.findParameter(paraName);
    paraName=paraName + "String_Node_Str" + parameterHandle.getID();
    SessionHandle sessionHandle=new DesignEngine(null).newSessionHandle(ULocale.US);
    ReportDesignHandle rdHandle=null;
    try {
      rdHandle=sessionHandle.openDesign(reportConfigName);
    }
 catch (    DesignFileException e) {
      return null;
    }
    if (rdHandle != null) {
      List values=new ArrayList();
      Iterator configVars=rdHandle.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;
          }
          if (varName.equals(paraName)) {
            String value=(String)varValue;
            values.add(value);
          }
          if (isNullValue(varName,(String)varValue,paraName)) {
            if (!parameterHandle.getParamType().equals(DesignChoiceConstants.SCALAR_PARAM_TYPE_MULTI_VALUE)) {
              return null;
            }
            return new Object[0];
          }
        }
      }
      if (values.size() > 0) {
        if (parameterHandle.getParamType().equals(DesignChoiceConstants.SCALAR_PARAM_TYPE_SIMPLE)) {
          try {
            return DataTypeUtil.convert(values.get(0),DataAdapterUtil.modelDataTypeToCoreDataType(parameterHandle.getDataType()));
          }
 catch (          BirtException e) {
            return null;
          }
        }
        try {
          Object[] reValues=new Object[values.size()];
          for (int i=0; i < reValues.length; i++) {
            reValues[i]=DataTypeUtil.convert(values.get(i),DataAdapterUtil.modelDataTypeToCoreDataType(parameterHandle.getDataType()));
          }
          return reValues;
        }
 catch (        BirtException e) {
          return null;
        }
      }
    }
  }
  return null;
}