Program: 30065
Project: 30065
Buggy source:
/** 
 * Handle the specified Throwable encountered while processing the specified Request to produce the specified Response.  Any exceptions that occur during generation of the exception report are logged and swallowed.
 * @param request The request being processed
 * @param response The response being generated
 * @param exception The exception that occurred (which possibly wrapsa root cause exception
 */
protected void throwable(Request request,Response response,Throwable throwable){
  Context context=request.getContext();
  if (context == null)   return;
  Throwable realError=throwable;
  if (realError instanceof ServletException) {
    realError=((ServletException)realError).getRootCause();
    if (realError == null) {
      realError=throwable;
    }
  }
  if (realError instanceof ClientAbortException) {
    if (log.isLoggable(Level.FINE)) {
      log.fine(sm.getString("String_Node_Str",realError.getCause().getMessage()));
    }
    return;
  }
  ErrorPage errorPage=findErrorPage(context,throwable);
  if ((errorPage == null) && (realError != throwable)) {
    errorPage=findErrorPage(context,realError);
  }
  if (errorPage != null) {
    dispatchToErrorPage(request,response,errorPage,throwable,realError,0);
  }
 else   if (context.getDefaultErrorPage() != null) {
    dispatchToErrorPage(request,response,context.getDefaultErrorPage(),throwable,realError,0);
  }
 else {
    ServletResponse sresp=(ServletResponse)response;
    ((HttpServletResponse)sresp).setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
    response.setError();
    status(request,response);
  }
}

Fixed version (ground truth):
/** 
 * Handle the specified Throwable encountered while processing the specified Request to produce the specified Response.  Any exceptions that occur during generation of the exception report are logged and swallowed.
 * @param request The request being processed
 * @param response The response being generated
 * @param throwable The throwable that occurred (which possibly wrapsa root cause exception
 */
protected void throwable(Request request,Response response,Throwable throwable){
  Context context=request.getContext();
  if (context == null)   return;
  Throwable realError=throwable;
  if (realError instanceof ServletException) {
    realError=((ServletException)realError).getRootCause();
    if (realError == null) {
      realError=throwable;
    }
  }
  if (realError instanceof ClientAbortException) {
    if (log.isLoggable(Level.FINE)) {
      log.fine(sm.getString("String_Node_Str",realError.getCause().getMessage()));
    }
    return;
  }
  ErrorPage errorPage=findErrorPage(context,throwable);
  if ((errorPage == null) && (realError != throwable)) {
    errorPage=findErrorPage(context,realError);
  }
  if (errorPage != null) {
    dispatchToErrorPage(request,response,errorPage,throwable,realError,0);
  }
 else   if (context.getDefaultErrorPage() != null) {
    dispatchToErrorPage(request,response,context.getDefaultErrorPage(),throwable,realError,0);
  }
 else {
    ServletResponse sresp=(ServletResponse)response;
    ((HttpServletResponse)sresp).setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
    response.setError();
    status(request,response);
  }
}