Program: 35971
Project: 35971
Buggy source:
@Override public void processRequest(IMxRuntimeRequest req,IMxRuntimeResponse resp,String _){
  long start=System.currentTimeMillis();
  HttpServletRequest request=req.getHttpServletRequest();
  HttpServletResponse response=resp.getHttpServletResponse();
  String method=request.getMethod();
  URL u;
  try {
    u=new URL(request.getRequestURL().toString());
  }
 catch (  MalformedURLException e1) {
    throw new IllegalStateException(e1);
  }
  String relpath=u.getPath().substring(RestServices.PATH_REST.length() + 1);
  String requestStr=method + "String_Node_Str" + relpath;
  response.setCharacterEncoding(RestServices.UTF8);
  response.setHeader("String_Node_Str","String_Node_Str");
  if (RestServices.LOGPUBLISH.isDebugEnabled())   RestServices.LOGPUBLISH.debug("String_Node_Str" + Utils.getRequestUrl(request));
  RestServiceRequest rsr=new RestServiceRequest(request,response,resp,relpath);
  try {
    ISession existingSession=getSessionFromRequest(req);
    executeHandler(rsr,method,relpath,existingSession);
    if (RestServices.LOGPUBLISH.isDebugEnabled())     RestServices.LOGPUBLISH.debug("String_Node_Str" + requestStr + "String_Node_Str"+ (System.currentTimeMillis() - start)+ "String_Node_Str");
  }
 catch (  RestPublishException rre) {
    RestServices.LOGPUBLISH.warn("String_Node_Str" + requestStr + "String_Node_Str"+ rre.getType()+ "String_Node_Str"+ rre.getMessage());
    serveErrorPage(rsr,rre.getStatusCode(),rre.getType().toString() + "String_Node_Str" + requestStr+ "String_Node_Str"+ rre.getMessage(),rre.getType().toString());
  }
catch (  JSONException je) {
    RestServices.LOGPUBLISH.warn("String_Node_Str" + requestStr + "String_Node_Str"+ je.getMessage());
    serveErrorPage(rsr,HttpStatus.SC_BAD_REQUEST,"String_Node_Str" + je.getMessage(),"String_Node_Str");
  }
catch (  Throwable e) {
    Throwable cause=ExceptionUtils.getRootCause(e);
    if (cause instanceof CustomRestServiceException) {
      CustomRestServiceException rse=(CustomRestServiceException)cause;
      RestServices.LOGPUBLISH.warn(String.format("String_Node_Str",requestStr,rse.getHttpStatus(),rse.getDetail(),rse.getMessage()));
      serveErrorPage(rsr,rse.getHttpStatus(),rse.getMessage(),rse.getDetail());
    }
 else     if (cause instanceof WebserviceException) {
      RestServices.LOGPUBLISH.warn("String_Node_Str" + requestStr + "String_Node_Str"+ cause.getMessage());
      serveErrorPage(rsr,HttpStatus.SC_BAD_REQUEST,cause.getMessage(),((WebserviceException)cause).getFaultCode());
    }
 else {
      RestServices.LOGPUBLISH.error("String_Node_Str" + requestStr + "String_Node_Str"+ e.getMessage(),e);
      serveErrorPage(rsr,HttpStatus.SC_INTERNAL_SERVER_ERROR,"String_Node_Str" + requestStr + "String_Node_Str",null);
    }
  }
 finally {
    rsr.dispose();
  }
}

Fixed version (ground truth):
@Override public void processRequest(IMxRuntimeRequest req,IMxRuntimeResponse resp,String _){
  long start=System.currentTimeMillis();
  HttpServletRequest request=req.getHttpServletRequest();
  HttpServletResponse response=resp.getHttpServletResponse();
  String method=request.getMethod();
  URL u;
  try {
    u=new URL(request.getRequestURL().toString());
  }
 catch (  MalformedURLException e1) {
    throw new IllegalStateException(e1);
  }
  String relpath=u.getPath().substring(RestServices.PATH_REST.length() + 1);
  String requestStr=method + "String_Node_Str" + relpath;
  response.setCharacterEncoding(RestServices.UTF8);
  response.setHeader("String_Node_Str","String_Node_Str");
  if (RestServices.LOGPUBLISH.isDebugEnabled())   RestServices.LOGPUBLISH.debug("String_Node_Str" + Utils.getRequestUrl(request));
  RestServiceRequest rsr=new RestServiceRequest(request,response,resp,relpath);
  try {
    ISession existingSession=getSessionFromRequest(req);
    executeHandler(rsr,method,relpath,existingSession);
    if (RestServices.LOGPUBLISH.isDebugEnabled())     RestServices.LOGPUBLISH.debug("String_Node_Str" + requestStr + "String_Node_Str"+ (System.currentTimeMillis() - start)+ "String_Node_Str");
  }
 catch (  RestPublishException rre) {
    handleRestPublishException(requestStr,rsr,rre);
  }
catch (  JSONException je) {
    handleJsonException(requestStr,rsr,je);
  }
catch (  Throwable e) {
    Throwable cause=ExceptionUtils.getRootCause(e);
    if (cause instanceof RestPublishException)     handleRestPublishException(requestStr,rsr,(RestPublishException)cause);
 else     if (cause instanceof JSONException)     handleJsonException(requestStr,rsr,(JSONException)cause);
    if (cause instanceof CustomRestServiceException) {
      CustomRestServiceException rse=(CustomRestServiceException)cause;
      RestServices.LOGPUBLISH.warn(String.format("String_Node_Str",requestStr,rse.getHttpStatus(),rse.getDetail(),rse.getMessage()));
      serveErrorPage(rsr,rse.getHttpStatus(),rse.getMessage(),rse.getDetail());
    }
 else     if (cause instanceof WebserviceException) {
      RestServices.LOGPUBLISH.warn("String_Node_Str" + requestStr + "String_Node_Str"+ cause.getMessage());
      serveErrorPage(rsr,HttpStatus.SC_BAD_REQUEST,cause.getMessage(),((WebserviceException)cause).getFaultCode());
    }
 else {
      RestServices.LOGPUBLISH.error("String_Node_Str" + requestStr + "String_Node_Str"+ e.getMessage(),e);
      serveErrorPage(rsr,HttpStatus.SC_INTERNAL_SERVER_ERROR,"String_Node_Str" + requestStr + "String_Node_Str",null);
    }
  }
 finally {
    rsr.dispose();
  }
}