Program: 56267
Project: 56267
Buggy source:
/** 
 * Creates a new web interface server. The server runs the servlets that implement the logic to upload, list, delete and submit jobs, to compile them and to show the optimizer plan. It serves the asynchronous requests for the plans and all other static resources, like static web pages, stylesheets or javascript files.
 * @param nepheleConfig The configuration for the nephele job manager. All compiled jobs will be sent to the manager described by this configuration.
 * @param port The port to launch the server on.
 * @throws IOException Thrown, if the server setup failed for an I/O related reason.
 */
public WebInterfaceServer(Configuration nepheleConfig,int port) throws IOException {
  Configuration config=GlobalConfiguration.getConfiguration();
  if (nepheleConfig == null) {
    nepheleConfig=config;
  }
  File webDir=new File(config.getString(PactConfigConstants.WEB_ROOT_PATH_KEY,PactConfigConstants.DEFAULT_WEB_ROOT_DIR));
  File tmpDir=new File(config.getString(PactConfigConstants.WEB_TMP_DIR_KEY,PactConfigConstants.DEFAULT_WEB_TMP_DIR));
  File uploadDir=new File(config.getString(PactConfigConstants.WEB_JOB_UPLOAD_DIR_KEY,PactConfigConstants.DEFAULT_WEB_JOB_STORAGE_DIR));
  File planDumpDir=new File(config.getString(PactConfigConstants.WEB_PLAN_DUMP_DIR_KEY,PactConfigConstants.DEFAULT_WEB_PLAN_DUMP_DIR));
  LOG.debug("String_Node_Str" + webDir.getAbsolutePath() + "String_Node_Str");
  LOG.debug("String_Node_Str" + tmpDir.getAbsolutePath() + "String_Node_Str"+ uploadDir.getAbsolutePath()+ "String_Node_Str"+ planDumpDir.getAbsolutePath()+ "String_Node_Str");
  LOG.debug("String_Node_Str" + config.getString(ConfigConstants.JOB_MANAGER_IPC_ADDRESS_KEY,ConfigConstants.DEFAULT_JOB_MANAGER_IPC_ADDRESS) + "String_Node_Str"+ config.getInteger(ConfigConstants.JOB_MANAGER_IPC_PORT_KEY,ConfigConstants.DEFAULT_JOB_MANAGER_IPC_PORT)+ "String_Node_Str");
  server=new Server(port);
  if (!webDir.exists()) {
    throw new FileNotFoundException("String_Node_Str" + webDir.getAbsolutePath());
  }
  checkAndCreateDirectories(tmpDir,true);
  checkAndCreateDirectories(uploadDir,true);
  checkAndCreateDirectories(planDumpDir,true);
  ServletContextHandler servletContext=new ServletContextHandler(ServletContextHandler.SESSIONS);
  servletContext.setContextPath("String_Node_Str");
  servletContext.addServlet(new ServletHolder(new PactJobJSONServlet(uploadDir)),"String_Node_Str");
  servletContext.addServlet(new ServletHolder(new PlanDisplayServlet()),"String_Node_Str");
  servletContext.addServlet(new ServletHolder(new JobsServlet(uploadDir,tmpDir,"String_Node_Str")),"String_Node_Str");
  servletContext.addServlet(new ServletHolder(new JobSubmissionServlet(nepheleConfig,uploadDir,planDumpDir)),"String_Node_Str");
  ResourceHandler pactPlanHandler=new ResourceHandler();
  pactPlanHandler.setDirectoriesListed(false);
  pactPlanHandler.setResourceBase(planDumpDir.getAbsolutePath());
  ContextHandler pactPlanContext=new ContextHandler();
  pactPlanContext.setContextPath("String_Node_Str");
  pactPlanContext.setHandler(pactPlanHandler);
  ResourceHandler resourceHandler=new ResourceHandler();
  resourceHandler.setDirectoriesListed(false);
  resourceHandler.setResourceBase(webDir.getAbsolutePath());
  HandlerList handlers=new HandlerList();
  handlers.addHandler(servletContext);
  handlers.addHandler(pactPlanContext);
  handlers.addHandler(resourceHandler);
  File af=null;
  String authFile=config.getString(PactConfigConstants.WEB_ACCESS_FILE_KEY,PactConfigConstants.DEFAULT_WEB_ACCESS_FILE_PATH);
  if (authFile != null) {
    af=new File(authFile);
    if (!af.exists()) {
      LOG.error("String_Node_Str" + af.getAbsolutePath() + "String_Node_Str");
      af=null;
    }
  }
  if (af != null) {
    HashLoginService loginService=new HashLoginService("String_Node_Str",authFile);
    server.addBean(loginService);
    Constraint constraint=new Constraint();
    constraint.setName(Constraint.__BASIC_AUTH);
    constraint.setAuthenticate(true);
    constraint.setRoles(new String[]{"String_Node_Str"});
    ConstraintMapping mapping=new ConstraintMapping();
    mapping.setPathSpec("String_Node_Str");
    mapping.setConstraint(constraint);
    ConstraintSecurityHandler sh=new ConstraintSecurityHandler();
    sh.addConstraintMapping(mapping);
    sh.setAuthenticator(new BasicAuthenticator());
    sh.setLoginService(loginService);
    sh.setStrict(true);
    sh.setHandler(handlers);
    server.setHandler(sh);
  }
 else {
    server.setHandler(handlers);
  }
}

Fixed version (ground truth):
/** 
 * Creates a new web interface server. The server runs the servlets that implement the logic to upload, list, delete and submit jobs, to compile them and to show the optimizer plan. It serves the asynchronous requests for the plans and all other static resources, like static web pages, stylesheets or javascript files.
 * @param nepheleConfig The configuration for the nephele job manager. All compiled jobs will be sent to the manager described by this configuration.
 * @param port The port to launch the server on.
 * @throws IOException Thrown, if the server setup failed for an I/O related reason.
 */
public WebInterfaceServer(Configuration nepheleConfig,int port) throws IOException {
  Configuration config=GlobalConfiguration.getConfiguration();
  if (nepheleConfig == null) {
    nepheleConfig=config;
  }
  String basePath=nepheleConfig.getString(PactConfigConstants.STRATOSPHERE_BASE_DIR_PATH_KEY,"String_Node_Str");
  File webDir;
  File tmpDir;
  File uploadDir;
  File planDumpDir;
  String webDirPath=config.getString(PactConfigConstants.WEB_ROOT_PATH_KEY,PactConfigConstants.DEFAULT_WEB_ROOT_DIR);
  if (webDirPath.startsWith("String_Node_Str")) {
    webDir=new File(webDirPath);
  }
 else {
    webDir=new File(basePath + "String_Node_Str" + webDirPath);
  }
  String tmpDirPath=config.getString(PactConfigConstants.WEB_TMP_DIR_KEY,PactConfigConstants.DEFAULT_WEB_TMP_DIR);
  if (tmpDirPath.startsWith("String_Node_Str")) {
    tmpDir=new File(tmpDirPath);
  }
 else {
    tmpDir=new File(basePath + "String_Node_Str" + tmpDirPath);
  }
  String uploadDirPath=config.getString(PactConfigConstants.WEB_JOB_UPLOAD_DIR_KEY,PactConfigConstants.DEFAULT_WEB_JOB_STORAGE_DIR);
  if (uploadDirPath.startsWith("String_Node_Str")) {
    uploadDir=new File(uploadDirPath);
  }
 else {
    uploadDir=new File(basePath + "String_Node_Str" + uploadDirPath);
  }
  String planDumpDirPath=config.getString(PactConfigConstants.WEB_PLAN_DUMP_DIR_KEY,PactConfigConstants.DEFAULT_WEB_PLAN_DUMP_DIR);
  if (planDumpDirPath.startsWith("String_Node_Str")) {
    planDumpDir=new File(planDumpDirPath);
  }
 else {
    planDumpDir=new File(basePath + "String_Node_Str" + planDumpDirPath);
  }
  LOG.debug("String_Node_Str" + webDir.getAbsolutePath() + "String_Node_Str");
  LOG.debug("String_Node_Str" + tmpDir.getAbsolutePath() + "String_Node_Str"+ uploadDir.getAbsolutePath()+ "String_Node_Str"+ planDumpDir.getAbsolutePath()+ "String_Node_Str");
  LOG.debug("String_Node_Str" + config.getString(ConfigConstants.JOB_MANAGER_IPC_ADDRESS_KEY,ConfigConstants.DEFAULT_JOB_MANAGER_IPC_ADDRESS) + "String_Node_Str"+ config.getInteger(ConfigConstants.JOB_MANAGER_IPC_PORT_KEY,ConfigConstants.DEFAULT_JOB_MANAGER_IPC_PORT)+ "String_Node_Str");
  server=new Server(port);
  if (!webDir.exists()) {
    throw new FileNotFoundException("String_Node_Str" + webDir.getAbsolutePath());
  }
  checkAndCreateDirectories(tmpDir,true);
  checkAndCreateDirectories(uploadDir,true);
  checkAndCreateDirectories(planDumpDir,true);
  ServletContextHandler servletContext=new ServletContextHandler(ServletContextHandler.SESSIONS);
  servletContext.setContextPath("String_Node_Str");
  servletContext.addServlet(new ServletHolder(new PactJobJSONServlet(uploadDir)),"String_Node_Str");
  servletContext.addServlet(new ServletHolder(new PlanDisplayServlet()),"String_Node_Str");
  servletContext.addServlet(new ServletHolder(new JobsServlet(uploadDir,tmpDir,"String_Node_Str")),"String_Node_Str");
  servletContext.addServlet(new ServletHolder(new JobSubmissionServlet(nepheleConfig,uploadDir,planDumpDir)),"String_Node_Str");
  ResourceHandler pactPlanHandler=new ResourceHandler();
  pactPlanHandler.setDirectoriesListed(false);
  pactPlanHandler.setResourceBase(planDumpDir.getAbsolutePath());
  ContextHandler pactPlanContext=new ContextHandler();
  pactPlanContext.setContextPath("String_Node_Str");
  pactPlanContext.setHandler(pactPlanHandler);
  ResourceHandler resourceHandler=new ResourceHandler();
  resourceHandler.setDirectoriesListed(false);
  resourceHandler.setResourceBase(webDir.getAbsolutePath());
  HandlerList handlers=new HandlerList();
  handlers.addHandler(servletContext);
  handlers.addHandler(pactPlanContext);
  handlers.addHandler(resourceHandler);
  File af=null;
  String authFile=config.getString(PactConfigConstants.WEB_ACCESS_FILE_KEY,PactConfigConstants.DEFAULT_WEB_ACCESS_FILE_PATH);
  if (authFile != null) {
    af=new File(authFile);
    if (!af.exists()) {
      LOG.error("String_Node_Str" + af.getAbsolutePath() + "String_Node_Str");
      af=null;
    }
  }
  if (af != null) {
    HashLoginService loginService=new HashLoginService("String_Node_Str",authFile);
    server.addBean(loginService);
    Constraint constraint=new Constraint();
    constraint.setName(Constraint.__BASIC_AUTH);
    constraint.setAuthenticate(true);
    constraint.setRoles(new String[]{"String_Node_Str"});
    ConstraintMapping mapping=new ConstraintMapping();
    mapping.setPathSpec("String_Node_Str");
    mapping.setConstraint(constraint);
    ConstraintSecurityHandler sh=new ConstraintSecurityHandler();
    sh.addConstraintMapping(mapping);
    sh.setAuthenticator(new BasicAuthenticator());
    sh.setLoginService(loginService);
    sh.setStrict(true);
    sh.setHandler(handlers);
    server.setHandler(sh);
  }
 else {
    server.setHandler(handlers);
  }
}