Program: 66929
Project: 66929
Buggy source:
/** 
 * Constructor.
 * @param servletContext
 * @param config
 */
private ReportEngineService(ServletContext servletContext){
  System.setProperty("String_Node_Str","String_Node_Str");
  if (servletContext == null) {
    return;
  }
  ParameterAccessor.initParameters(servletContext);
  config=new EngineConfig();
  HTMLRenderOption emitterConfig=new HTMLRenderOption();
  emitterConfig.setActionHandler(new HTMLActionHandler());
  imageHandler=new HTMLServerImageHandler();
  emitterConfig.setImageHandler(imageHandler);
  config.getEmitterConfigs().put("String_Node_Str",emitterConfig);
  String logLevel=ParameterAccessor.logLevel;
  Level level=logLevel != null && logLevel.length() > 0 ? Level.parse(logLevel) : Level.OFF;
  config.setLogConfig(ParameterAccessor.logFolder,level);
  String scriptLibDir=ParameterAccessor.scriptLibDir;
  ArrayList jarFileList=new ArrayList();
  if (scriptLibDir != null) {
    File dir=new File(scriptLibDir);
    getAllJarFiles(dir,jarFileList);
  }
  String scriptlibClassPath="String_Node_Str";
  for (int i=0; i < jarFileList.size(); i++)   scriptlibClassPath+=EngineConstants.PROPERTYSEPARATOR + ((File)jarFileList.get(i)).getAbsolutePath();
  if (scriptlibClassPath.startsWith(EngineConstants.PROPERTYSEPARATOR))   scriptlibClassPath=scriptlibClassPath.substring(EngineConstants.PROPERTYSEPARATOR.length());
  Map appContext=new HashMap();
  appContext.put(EngineConstants.WEBAPP_CLASSPATH_KEY,scriptlibClassPath);
  ClassLoader appClassLoader=BirtUtility.getAppClassLoader();
  if (appClassLoader == null)   appClassLoader=ReportEngineService.class.getClassLoader();
  appContext.put(EngineConstants.APPCONTEXT_CLASSLOADER_KEY,appClassLoader);
  appContext=BirtUtility.getAppContext(appContext);
  config.getAppContext().putAll(appContext);
  config.setEngineHome("String_Node_Str");
  config.setMaxRowsPerQuery(ParameterAccessor.maxRows);
  LoggingUtil.configureLoggers(ParameterAccessor.loggers,level,ParameterAccessor.logFolder);
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param servletContext
 * @param config
 */
private ReportEngineService(ServletContext servletContext){
  System.setProperty("String_Node_Str","String_Node_Str");
  if (servletContext == null) {
    return;
  }
  ParameterAccessor.initParameters(servletContext);
  config=new EngineConfig();
  HTMLRenderOption emitterConfig=new HTMLRenderOption();
  emitterConfig.setActionHandler(new HTMLActionHandler());
  imageHandler=new HTMLServerImageHandler();
  emitterConfig.setImageHandler(imageHandler);
  config.getEmitterConfigs().put("String_Node_Str",emitterConfig);
  String logLevel=ParameterAccessor.logLevel;
  Level level=logLevel != null && logLevel.length() > 0 ? Level.parse(logLevel) : Level.OFF;
  config.setLogConfig(ParameterAccessor.logFolder,level);
  String scriptLibDir=ParameterAccessor.scriptLibDir;
  ArrayList jarFileList=new ArrayList();
  if (scriptLibDir != null) {
    File dir=new File(scriptLibDir);
    getAllJarFiles(dir,jarFileList);
  }
  StringBuffer scriptlibClassPath=new StringBuffer();
  for (int i=0; i < jarFileList.size(); i++) {
    String p=((File)jarFileList.get(i)).getAbsolutePath();
    if (p != null && p.length() > 0) {
      if (scriptlibClassPath.length() > 0) {
        scriptlibClassPath.append(EngineConstants.PROPERTYSEPARATOR);
      }
      scriptlibClassPath.append(p);
    }
  }
  Map appContext=new HashMap();
  appContext.put(EngineConstants.WEBAPP_CLASSPATH_KEY,scriptlibClassPath.toString());
  ClassLoader appClassLoader=BirtUtility.getAppClassLoader();
  if (appClassLoader == null)   appClassLoader=ReportEngineService.class.getClassLoader();
  appContext.put(EngineConstants.APPCONTEXT_CLASSLOADER_KEY,appClassLoader);
  appContext=BirtUtility.getAppContext(appContext);
  config.getAppContext().putAll(appContext);
  config.setEngineHome("String_Node_Str");
  config.setMaxRowsPerQuery(ParameterAccessor.maxRows);
  LoggingUtil.configureLoggers(ParameterAccessor.loggers,level,ParameterAccessor.logFolder);
}