Program: 78197
Project: 78197
Buggy source:
/** 
 * Constructor.
 * @param config
 */
public 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=servletConfig.getServletContext().getRealPath("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=servletConfig.getServletContext().getRealPath("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=servletConfig.getServletContext().getRealPath("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 config
 */
public 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);
  String resourcePath=servletConfig.getServletContext().getInitParameter(ParameterAccessor.INIT_PARAM_BIRT_RESOURCE_PATH);
  if (resourcePath == null || resourcePath.trim().length() <= 0 || ParameterAccessor.isRelativePath(resourcePath)) {
    resourcePath=servletConfig.getServletContext().getRealPath("String_Node_Str");
  }
  File resourceFile=new File(resourcePath);
  boolean isResourceOk=true;
  if (!resourceFile.exists()) {
    isResourceOk=resourceFile.mkdirs();
  }
  if (isResourceOk) {
    config.setProperty(ParameterAccessor.INIT_PARAM_BIRT_RESOURCE_PATH,resourcePath);
  }
  imageDirectory=servletConfig.getServletContext().getInitParameter(ParameterAccessor.INIT_PARAM_IMAGE_DIR);
  if (imageDirectory == null || imageDirectory.trim().length() <= 0 || ParameterAccessor.isRelativePath(imageDirectory)) {
    imageDirectory=servletConfig.getServletContext().getRealPath("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=servletConfig.getServletContext().getRealPath("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=servletConfig.getServletContext().getRealPath("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");
}