Program: 28107
Project: 28107
Buggy source:
/** 
 * Handle the HTTP status code (and corresponding message) generated while processing the specified Request to produce the specified Response.  Any exceptions that occur during generation of the error report are logged and swallowed.
 * @param request The request being processed
 * @param response The response being generated
 */
protected void status(Request request,Response response){
  Context context=request.getContext();
  if (context == null)   return;
  if (!response.isError()) {
    return;
  }
  int statusCode=((HttpResponse)response).getStatus();
  ErrorPage errorPage=context.findErrorPage(statusCode);
  if (errorPage != null) {
    if (errorPage.getLocation() != null) {
      File file=new File(context.getDocBase(),errorPage.getLocation());
      if (!file.exists()) {
        File file2=new File(errorPage.getLocation());
        if (!file2.exists()) {
          log.log(Level.WARNING,LogFacade.ERROR_PAGE_NOT_EXIST,new Object[]{file.getAbsolutePath(),file2.getAbsolutePath()});
        }
      }
    }
    setErrorPageContentType(response,errorPage.getLocation(),context);
    dispatchToErrorPage(request,response,errorPage,null,null,statusCode);
  }
 else   if (statusCode >= 400 && statusCode < 600 && context.getDefaultErrorPage() != null) {
    dispatchToErrorPage(request,response,context.getDefaultErrorPage(),null,null,statusCode);
  }
 else {
    errorPage=((StandardHost)getContainer()).findErrorPage(statusCode);
    if (errorPage != null) {
      if (errorPage.getLocation() != null) {
        File file=new File(context.getDocBase(),errorPage.getLocation());
        if (!file.exists()) {
          File file2=new File(errorPage.getLocation());
          if (!file2.exists()) {
            log.log(Level.WARNING,LogFacade.ERROR_PAGE_NOT_EXIST,new Object[]{file.getAbsolutePath(),file2.getAbsolutePath()});
          }
        }
      }
      try {
        setErrorPageContentType(response,errorPage.getLocation(),context);
        handleHostErrorPage(response,errorPage,statusCode);
      }
 catch (      Exception e) {
        log("String_Node_Str" + errorPage,e);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Handle the HTTP status code (and corresponding message) generated while processing the specified Request to produce the specified Response.  Any exceptions that occur during generation of the error report are logged and swallowed.
 * @param request The request being processed
 * @param response The response being generated
 */
protected void status(Request request,Response response){
  Context context=request.getContext();
  if (context == null)   return;
  if (!response.isError()) {
    return;
  }
  int statusCode=((HttpResponse)response).getStatus();
  ErrorPage errorPage=context.findErrorPage(statusCode);
  if (errorPage != null) {
    if (errorPage.getLocation() != null) {
      File file=new File(context.getDocBase(),errorPage.getLocation());
      if (!file.exists()) {
        File file2=new File(errorPage.getLocation());
        if (!file2.exists()) {
          boolean fileExists=false;
          for (          String mapping : ((StandardHost)getContainer()).findDeployedApp(context.getPath()).findServletMappings()) {
            PathMatcher matcher=FileSystems.getDefault().getPathMatcher("String_Node_Str" + mapping);
            Path errorPagePath=Paths.get(errorPage.getLocation());
            if (matcher.matches(errorPagePath)) {
              fileExists=true;
            }
          }
          if (!fileExists) {
            fileExists=false;
            for (            FilterMap mapping : ((StandardHost)getContainer()).findDeployedApp(context.getPath()).findFilterMaps()) {
              PathMatcher matcher=FileSystems.getDefault().getPathMatcher("String_Node_Str" + mapping.getURLPattern());
              Path errorPagePath=Paths.get(errorPage.getLocation());
              if (matcher.matches(errorPagePath)) {
                fileExists=true;
              }
            }
            if (!fileExists) {
              log.log(Level.WARNING,LogFacade.ERROR_PAGE_NOT_EXIST,new Object[]{file.getAbsolutePath(),file2.getAbsolutePath()});
            }
          }
        }
      }
    }
    setErrorPageContentType(response,errorPage.getLocation(),context);
    dispatchToErrorPage(request,response,errorPage,null,null,statusCode);
  }
 else   if (statusCode >= 400 && statusCode < 600 && context.getDefaultErrorPage() != null) {
    dispatchToErrorPage(request,response,context.getDefaultErrorPage(),null,null,statusCode);
  }
 else {
    errorPage=((StandardHost)getContainer()).findErrorPage(statusCode);
    if (errorPage != null) {
      if (errorPage.getLocation() != null) {
        File file=new File(context.getDocBase(),errorPage.getLocation());
        if (!file.exists()) {
          File file2=new File(errorPage.getLocation());
          if (!file2.exists()) {
            log.log(Level.WARNING,LogFacade.ERROR_PAGE_NOT_EXIST,new Object[]{file.getAbsolutePath(),file2.getAbsolutePath()});
          }
        }
      }
      try {
        setErrorPageContentType(response,errorPage.getLocation(),context);
        handleHostErrorPage(response,errorPage,statusCode);
      }
 catch (      Exception e) {
        log("String_Node_Str" + errorPage,e);
      }
    }
  }
}