Program: 74869
Project: 74869
Buggy source:
/** 
 * Get parameter values from config file.
 * @return Map
 */
private Map getConfigVars(){
  HashMap configVars=new HashMap();
  String configFileName=getConfigFileName(this.getFileUri());
  if (configFileName == null)   return configVars;
  ReportDesignHandle handle=null;
  try {
    SessionHandle sessionHandle=SessionHandleAdapter.getInstance().getSessionHandle();
    File configFile=new File(configFileName);
    if (configFile != null && configFile.exists() && configFile.isFile()) {
      handle=sessionHandle.openDesign(configFileName);
      if (handle != null) {
        Iterator it=handle.configVariablesIterator();
        while (it != null && it.hasNext()) {
          ConfigVariableHandle configVar=(ConfigVariableHandle)it.next();
          if (configVar != null && configVar.getName() != null) {
            String paramName=getParameterName(configVar.getName());
            ScalarParameterHandle parameter=findParameter(paramName);
            if (parameter != null) {
              String typeVarName=configVar.getName() + "String_Node_Str" + PROP_TYPE;
              ConfigVariable typeVar=handle.findConfigVariable(typeVarName);
              String dataType=null;
              if (typeVar != null)               dataType=typeVar.getValue();
              if (dataType == null || !dataType.equalsIgnoreCase(parameter.getDataType()))               continue;
              String exprVarName=configVar.getName() + "String_Node_Str" + PROP_EXPR;
              ConfigVariable exprVar=handle.findConfigVariable(exprVarName);
              String expr=parameter.getValueExpr();
              String cachedExpr=null;
              if (exprVar != null)               cachedExpr=exprVar.getValue();
              if (cachedExpr == null)               cachedExpr="String_Node_Str";
              if (expr == null)               expr="String_Node_Str";
              if (!cachedExpr.equals(expr))               continue;
            }
            if (paramName != null && paramName.length() > 0) {
              configVars.put(paramName,configVar.getValue());
            }
          }
        }
        handle.close();
      }
    }
  }
 catch (  DesignFileException e) {
    try {
      if (handle != null) {
        handle.close();
      }
    }
 catch (    Exception e1) {
      logger.log(Level.SEVERE,e.getMessage(),e);
    }
  }
  return configVars;
}

Fixed version (ground truth):
/** 
 * Get parameter values from config file.
 * @return Map
 */
private Map getConfigVars(){
  HashMap configVars=new HashMap();
  String configFileName=getConfigFileName(this.getFileUri());
  if (configFileName == null)   return configVars;
  ReportDesignHandle handle=null;
  try {
    SessionHandle sessionHandle=SessionHandleAdapter.getInstance().getSessionHandle();
    File configFile=new File(configFileName);
    if (configFile != null && configFile.exists() && configFile.isFile()) {
      handle=sessionHandle.openDesign(configFileName);
      if (handle != null) {
        Iterator it=handle.configVariablesIterator();
        while (it != null && it.hasNext()) {
          ConfigVariableHandle configVar=(ConfigVariableHandle)it.next();
          if (configVar != null && configVar.getName() != null) {
            String varName=prepareConfigVarName(configVar.getName());
            String paramName=getParameterName(varName);
            ScalarParameterHandle parameter=findParameter(paramName);
            if (parameter != null) {
              String typeVarName=varName + "String_Node_Str" + PROP_TYPE+ "String_Node_Str";
              ConfigVariable typeVar=handle.findConfigVariable(typeVarName);
              String dataType=null;
              if (typeVar != null)               dataType=typeVar.getValue();
              if (dataType == null || !dataType.equalsIgnoreCase(parameter.getDataType()))               continue;
              String exprVarName=varName + "String_Node_Str" + PROP_EXPR+ "String_Node_Str";
              ConfigVariable exprVar=handle.findConfigVariable(exprVarName);
              String expr=parameter.getValueExpr();
              String cachedExpr=null;
              if (exprVar != null)               cachedExpr=exprVar.getValue();
              if (cachedExpr == null)               cachedExpr="String_Node_Str";
              if (expr == null)               expr="String_Node_Str";
              if (!cachedExpr.equals(expr))               continue;
            }
            if (paramName != null && paramName.length() > 0) {
              if (DesignChoiceConstants.SCALAR_PARAM_TYPE_MULTI_VALUE.equalsIgnoreCase(parameter.getParamType())) {
                List values=(List)configVars.get(paramName);
                if (values == null) {
                  values=new ArrayList();
                  configVars.put(paramName,values);
                }
                values.add(configVar.getValue());
              }
 else {
                configVars.put(paramName,configVar.getValue());
              }
            }
          }
        }
        handle.close();
      }
    }
  }
 catch (  DesignFileException e) {
    try {
      if (handle != null) {
        handle.close();
      }
    }
 catch (    Exception e1) {
      logger.log(Level.SEVERE,e.getMessage(),e);
    }
  }
  return configVars;
}