Program: 74443
Project: 74443
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;
            if (isToBeConverted(parameterHandle.getDataType())) {
              value="String_Node_Str" + JavascriptEvalUtil.transformToJsConstants(value) + "String_Node_Str";
            }
            values.add(value);
          }
          if (isNullValue(varName,(String)varValue,paraName)) {
            return new Object[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)) {
          return values.get(0);
        }
        return values.toArray();
      }
    }
  }
  return null;
}