Program: 76976
Project: 76976
Buggy source:
/** 
 * Constructor.
 * @param servletConfig
 * @param config
 */
private ReportEngineService(ServletConfig servletConfig){
  System.setProperty("String_Node_Str","String_Node_Str");
  if (servletConfig == null) {
    return;
  }
  config=new EngineConfig();
  HTMLEmitterConfig emitterConfig=new HTMLEmitterConfig();
  emitterConfig.setActionHandler(new HTMLActionHandler());
  imageHandler=new HTMLServerImageHandler();
  emitterConfig.setImageHandler(imageHandler);
  config.getEmitterConfigs().put("String_Node_Str",emitterConfig);
  imageDirectory=servletConfig.getServletContext().getInitParameter(ParameterAccessor.INIT_PARAM_IMAGE_DIR);
  if (imageDirectory == null || imageDirectory.trim().length() <= 0 || ParameterAccessor.isRelativePath(imageDirectory)) {
    imageDirectory=ParameterAccessor.getRealPath(servletConfig.getServletContext(),"String_Node_Str");
  }
  imageBaseUrl="String_Node_Str";
  String logDirectory=servletConfig.getServletContext().getInitParameter(ParameterAccessor.INIT_PARAM_LOG_DIR);
  if (logDirectory == null || logDirectory.trim().length() <= 0 || ParameterAccessor.isRelativePath(logDirectory)) {
    logDirectory=ParameterAccessor.getRealPath(servletConfig.getServletContext(),"String_Node_Str");
  }
  String logLevel=servletConfig.getServletContext().getInitParameter(ParameterAccessor.INIT_PARAM_LOG_LEVEL);
  Level level=Level.OFF;
  if ("String_Node_Str".equalsIgnoreCase(logLevel)) {
    level=Level.SEVERE;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(logLevel)) {
    level=Level.WARNING;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(logLevel)) {
    level=Level.INFO;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(logLevel)) {
    level=Level.CONFIG;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(logLevel)) {
    level=Level.FINE;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(logLevel)) {
    level=Level.FINER;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(logLevel)) {
    level=Level.FINEST;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(logLevel)) {
    level=Level.OFF;
  }
  config.setLogConfig(logDirectory,level);
  String scriptLibDir=servletConfig.getServletContext().getInitParameter(ParameterAccessor.INIT_PARAM_SCRIPTLIB_DIR);
  if (scriptLibDir == null || scriptLibDir.trim().length() <= 0 || ParameterAccessor.isRelativePath(scriptLibDir)) {
    scriptLibDir=ParameterAccessor.getRealPath(servletConfig.getServletContext(),"String_Node_Str");
  }
  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());
  System.setProperty(EngineConstants.WEBAPP_CLASSPATH_KEY,scriptlibClassPath);
  config.setEngineHome("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param servletConfig
 * @param config
 */
private ReportEngineService(ServletConfig servletConfig){
  System.setProperty("String_Node_Str","String_Node_Str");
  if (servletConfig == null) {
    return;
  }
  config=new EngineConfig();
  HTMLEmitterConfig emitterConfig=new HTMLEmitterConfig();
  emitterConfig.setActionHandler(new HTMLActionHandler());
  imageHandler=new HTMLServerImageHandler();
  emitterConfig.setImageHandler(imageHandler);
  config.getEmitterConfigs().put("String_Node_Str",emitterConfig);
  imageDirectory=servletConfig.getServletContext().getInitParameter(ParameterAccessor.INIT_PARAM_IMAGE_DIR);
  if (imageDirectory == null || imageDirectory.trim().length() <= 0 || ParameterAccessor.isRelativePath(imageDirectory)) {
    imageDirectory=ParameterAccessor.getRealPath(servletConfig.getServletContext(),"String_Node_Str");
  }
  imageBaseUrl=IBirtConstants.SERVLET_PATH_PREVIEW + "String_Node_Str";
  String logDirectory=servletConfig.getServletContext().getInitParameter(ParameterAccessor.INIT_PARAM_LOG_DIR);
  if (logDirectory == null || logDirectory.trim().length() <= 0 || ParameterAccessor.isRelativePath(logDirectory)) {
    logDirectory=ParameterAccessor.getRealPath(servletConfig.getServletContext(),"String_Node_Str");
  }
  String logLevel=servletConfig.getServletContext().getInitParameter(ParameterAccessor.INIT_PARAM_LOG_LEVEL);
  Level level=Level.OFF;
  if ("String_Node_Str".equalsIgnoreCase(logLevel)) {
    level=Level.SEVERE;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(logLevel)) {
    level=Level.WARNING;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(logLevel)) {
    level=Level.INFO;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(logLevel)) {
    level=Level.CONFIG;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(logLevel)) {
    level=Level.FINE;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(logLevel)) {
    level=Level.FINER;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(logLevel)) {
    level=Level.FINEST;
  }
 else   if ("String_Node_Str".equalsIgnoreCase(logLevel)) {
    level=Level.OFF;
  }
  config.setLogConfig(logDirectory,level);
  String scriptLibDir=servletConfig.getServletContext().getInitParameter(ParameterAccessor.INIT_PARAM_SCRIPTLIB_DIR);
  if (scriptLibDir == null || scriptLibDir.trim().length() <= 0 || ParameterAccessor.isRelativePath(scriptLibDir)) {
    scriptLibDir=ParameterAccessor.getRealPath(servletConfig.getServletContext(),"String_Node_Str");
  }
  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());
  System.setProperty(EngineConstants.WEBAPP_CLASSPATH_KEY,scriptlibClassPath);
  config.setEngineHome("String_Node_Str");
}