Program: 162749
Project: 162749
Buggy source:
private void makeContext(Tomcat tomcat,Path noSuchBaseDir) throws IOException {
  Path contextPath=noSuchBaseDir.resolve("String_Node_Str");
  Files.createDirectories(contextPath);
  context=tomcat.addContext(contextPathURIBase,contextPath.toAbsolutePath().toString());
  context.setWebappVersion("String_Node_Str");
  context.setName("String_Node_Str");
  context.addWelcomeFile("String_Node_Str");
  addErrorPages(context);
  context.addParameter(OryxApplication.class.getName() + "String_Node_Str",appResourcesPackages);
  String serializedConfig=ConfigUtils.serialize(config);
  context.addParameter(ConfigUtils.class.getName() + "String_Node_Str",serializedConfig);
  Wrapper wrapper=Tomcat.addServlet(context,"String_Node_Str","String_Node_Str");
  wrapper.addInitParameter("String_Node_Str",OryxApplication.class.getName());
  wrapper.addMapping("String_Node_Str");
  wrapper.setLoadOnStartup(1);
  if (!doNotInitTopics) {
    context.addApplicationListener(ModelManagerListener.class.getName());
  }
  boolean needHTTPS=keystoreFile != null;
  boolean needAuthentication=userName != null;
  if (needHTTPS || needAuthentication) {
    SecurityCollection securityCollection=new SecurityCollection();
    securityCollection.addPattern("String_Node_Str");
    SecurityConstraint securityConstraint=new SecurityConstraint();
    securityConstraint.addCollection(securityCollection);
    if (needHTTPS) {
      securityConstraint.setUserConstraint("String_Node_Str");
    }
    if (needAuthentication) {
      LoginConfig loginConfig=new LoginConfig();
      loginConfig.setAuthMethod("String_Node_Str");
      loginConfig.setRealmName(InMemoryRealm.NAME);
      context.setLoginConfig(loginConfig);
      securityConstraint.addAuthRole(InMemoryRealm.AUTH_ROLE);
      context.addSecurityRole(InMemoryRealm.AUTH_ROLE);
      DigestAuthenticator authenticator=new DigestAuthenticator();
      authenticator.setNonceValidity(10 * 1000L);
      authenticator.setNonceCacheSize(20000);
      context.getPipeline().addValve(authenticator);
    }
    context.addConstraint(securityConstraint);
  }
  context.setCookies(false);
}

Fixed version (ground truth):
private void makeContext(Tomcat tomcat,Path noSuchBaseDir) throws IOException {
  Path contextPath=noSuchBaseDir.resolve("String_Node_Str");
  Files.createDirectories(contextPath);
  context=tomcat.addContext(contextPathURIBase,contextPath.toAbsolutePath().toString());
  context.setWebappVersion("String_Node_Str");
  context.setName("String_Node_Str");
  context.addWelcomeFile("String_Node_Str");
  addErrorPages(context);
  context.addParameter(OryxApplication.class.getName() + "String_Node_Str",appResourcesPackages);
  String serializedConfig=ConfigUtils.serialize(config);
  context.addParameter(ConfigUtils.class.getName() + "String_Node_Str",serializedConfig);
  Wrapper wrapper=Tomcat.addServlet(context,"String_Node_Str","String_Node_Str");
  wrapper.addInitParameter("String_Node_Str",OryxApplication.class.getName());
  wrapper.addMapping("String_Node_Str");
  wrapper.setLoadOnStartup(1);
  wrapper.setMultipartConfigElement(new MultipartConfigElement("String_Node_Str"));
  if (!doNotInitTopics) {
    context.addApplicationListener(ModelManagerListener.class.getName());
  }
  boolean needHTTPS=keystoreFile != null;
  boolean needAuthentication=userName != null;
  if (needHTTPS || needAuthentication) {
    SecurityCollection securityCollection=new SecurityCollection();
    securityCollection.addPattern("String_Node_Str");
    SecurityConstraint securityConstraint=new SecurityConstraint();
    securityConstraint.addCollection(securityCollection);
    if (needHTTPS) {
      securityConstraint.setUserConstraint("String_Node_Str");
    }
    if (needAuthentication) {
      LoginConfig loginConfig=new LoginConfig();
      loginConfig.setAuthMethod("String_Node_Str");
      loginConfig.setRealmName(InMemoryRealm.NAME);
      context.setLoginConfig(loginConfig);
      securityConstraint.addAuthRole(InMemoryRealm.AUTH_ROLE);
      context.addSecurityRole(InMemoryRealm.AUTH_ROLE);
      DigestAuthenticator authenticator=new DigestAuthenticator();
      authenticator.setNonceValidity(10 * 1000L);
      authenticator.setNonceCacheSize(20000);
      context.getPipeline().addValve(authenticator);
    }
    context.addConstraint(securityConstraint);
  }
  context.setCookies(false);
}