Program: 112265
Project: 112265
Buggy source:
protected void handleRequest(RequestTypeEnum theRequestType,HttpServletRequest theRequest,HttpServletResponse theResponse) throws ServletException, IOException {
  String fhirServerBase=null;
  ServletRequestDetails requestDetails=new ServletRequestDetails();
  requestDetails.setServer(this);
  requestDetails.setRequestType(theRequestType);
  requestDetails.setServletRequest(theRequest);
  requestDetails.setServletResponse(theResponse);
  theRequest.setAttribute(SERVLET_CONTEXT_ATTRIBUTE,getServletContext());
  try {
    String requestFullPath=StringUtils.defaultString(theRequest.getRequestURI());
    String servletPath=StringUtils.defaultString(theRequest.getServletPath());
    StringBuffer requestUrl=theRequest.getRequestURL();
    String servletContextPath=IncomingRequestAddressStrategy.determineServletContextPath(theRequest,this);
    if (ourLog.isTraceEnabled()) {
      ourLog.trace("String_Node_Str",requestFullPath);
      ourLog.trace("String_Node_Str",servletPath);
      ourLog.trace("String_Node_Str",requestUrl);
      ourLog.trace("String_Node_Str",servletContextPath);
    }
    String completeUrl;
    Map<String,String[]> params=null;
    if (StringUtils.isNotBlank(theRequest.getQueryString())) {
      completeUrl=requestUrl + "String_Node_Str" + theRequest.getQueryString();
      if (isIgnoreServerParsedRequestParameters()) {
        String contentType=theRequest.getHeader(Constants.HEADER_CONTENT_TYPE);
        if (theRequestType == RequestTypeEnum.POST && isNotBlank(contentType) && contentType.startsWith(Constants.CT_X_FORM_URLENCODED)) {
          String requestBody=new String(requestDetails.loadRequestContents(),Constants.CHARSET_UTF8);
          params=UrlUtil.parseQueryStrings(theRequest.getQueryString(),requestBody);
        }
 else         if (theRequestType == RequestTypeEnum.GET) {
          params=UrlUtil.parseQueryString(theRequest.getQueryString());
        }
      }
    }
 else {
      completeUrl=requestUrl.toString();
    }
    if (params == null) {
      params=new HashMap<String,String[]>(theRequest.getParameterMap());
    }
    requestDetails.setParameters(params);
    for (    IServerInterceptor next : myInterceptors) {
      boolean continueProcessing=next.incomingRequestPreProcessed(theRequest,theResponse);
      if (!continueProcessing) {
        ourLog.debug("String_Node_Str");
        return;
      }
    }
    String requestPath=getRequestPath(requestFullPath,servletContextPath,servletPath);
    if (requestPath.length() > 0 && requestPath.charAt(0) == '/') {
      requestPath=requestPath.substring(1);
    }
    fhirServerBase=getServerBaseForRequest(theRequest);
    IIdType id;
    populateRequestDetailsFromRequestPath(requestDetails,requestPath);
    if (theRequestType == RequestTypeEnum.PUT) {
      String contentLocation=theRequest.getHeader(Constants.HEADER_CONTENT_LOCATION);
      if (contentLocation != null) {
        id=myFhirContext.getVersion().newIdType();
        id.setValue(contentLocation);
        requestDetails.setId(id);
      }
    }
    String acceptEncoding=theRequest.getHeader(Constants.HEADER_ACCEPT_ENCODING);
    boolean respondGzip=false;
    if (acceptEncoding != null) {
      String[] parts=acceptEncoding.trim().split("String_Node_Str");
      for (      String string : parts) {
        if (string.equals("String_Node_Str")) {
          respondGzip=true;
        }
      }
    }
    requestDetails.setRespondGzip(respondGzip);
    requestDetails.setRequestPath(requestPath);
    requestDetails.setFhirServerBase(fhirServerBase);
    requestDetails.setCompleteUrl(completeUrl);
    BaseMethodBinding<?> resourceMethod=determineResourceMethod(requestDetails,requestPath);
    requestDetails.setRestOperationType(resourceMethod.getRestOperationType());
    for (    IServerInterceptor next : myInterceptors) {
      boolean continueProcessing=next.incomingRequestPostProcessed(requestDetails,theRequest,theResponse);
      if (!continueProcessing) {
        ourLog.debug("String_Node_Str");
        return;
      }
    }
    Closeable outputStreamOrWriter=(Closeable)resourceMethod.invokeServer(this,requestDetails);
    for (int i=getInterceptors().size() - 1; i >= 0; i--) {
      IServerInterceptor next=getInterceptors().get(i);
      next.processingCompletedNormally(requestDetails);
    }
    outputStreamOrWriter.close();
  }
 catch (  NotModifiedException e) {
    for (int i=getInterceptors().size() - 1; i >= 0; i--) {
      IServerInterceptor next=getInterceptors().get(i);
      if (!next.handleException(requestDetails,e,theRequest,theResponse)) {
        ourLog.debug("String_Node_Str");
        return;
      }
    }
    writeExceptionToResponse(theResponse,e);
  }
catch (  AuthenticationException e) {
    for (int i=getInterceptors().size() - 1; i >= 0; i--) {
      IServerInterceptor next=getInterceptors().get(i);
      if (!next.handleException(requestDetails,e,theRequest,theResponse)) {
        ourLog.debug("String_Node_Str");
        return;
      }
    }
    writeExceptionToResponse(theResponse,e);
  }
catch (  Throwable e) {
    BaseServerResponseException exception=null;
    for (int i=getInterceptors().size() - 1; i >= 0; i--) {
      IServerInterceptor next=getInterceptors().get(i);
      exception=next.preProcessOutgoingException(requestDetails,e,theRequest);
      if (exception != null) {
        ourLog.debug("String_Node_Str");
        break;
      }
    }
    if (exception == null) {
      exception=DEFAULT_EXCEPTION_HANDLER.preProcessOutgoingException(requestDetails,e,theRequest);
    }
    for (int i=getInterceptors().size() - 1; i >= 0; i--) {
      IServerInterceptor next=getInterceptors().get(i);
      if (!next.handleException(requestDetails,exception,theRequest,theResponse)) {
        ourLog.debug("String_Node_Str");
        return;
      }
    }
    requestDetails.getParameters().remove(Constants.PARAM_SUMMARY);
    requestDetails.getParameters().remove(Constants.PARAM_ELEMENTS);
    DEFAULT_EXCEPTION_HANDLER.handleException(requestDetails,exception,theRequest,theResponse);
  }
}

Fixed version (ground truth):
protected void handleRequest(RequestTypeEnum theRequestType,HttpServletRequest theRequest,HttpServletResponse theResponse) throws ServletException, IOException {
  String fhirServerBase=null;
  ServletRequestDetails requestDetails=new ServletRequestDetails();
  requestDetails.setServer(this);
  requestDetails.setRequestType(theRequestType);
  requestDetails.setServletRequest(theRequest);
  requestDetails.setServletResponse(theResponse);
  theRequest.setAttribute(SERVLET_CONTEXT_ATTRIBUTE,getServletContext());
  try {
    String requestFullPath=StringUtils.defaultString(theRequest.getRequestURI());
    String servletPath=StringUtils.defaultString(theRequest.getServletPath());
    StringBuffer requestUrl=theRequest.getRequestURL();
    String servletContextPath=IncomingRequestAddressStrategy.determineServletContextPath(theRequest,this);
    if (ourLog.isTraceEnabled()) {
      ourLog.trace("String_Node_Str",requestFullPath);
      ourLog.trace("String_Node_Str",servletPath);
      ourLog.trace("String_Node_Str",requestUrl);
      ourLog.trace("String_Node_Str",servletContextPath);
    }
    String completeUrl;
    Map<String,String[]> params=null;
    if (StringUtils.isNotBlank(theRequest.getQueryString())) {
      completeUrl=requestUrl + "String_Node_Str" + theRequest.getQueryString();
      if (isIgnoreServerParsedRequestParameters()) {
        String contentType=theRequest.getHeader(Constants.HEADER_CONTENT_TYPE);
        if (theRequestType == RequestTypeEnum.POST && isNotBlank(contentType) && contentType.startsWith(Constants.CT_X_FORM_URLENCODED)) {
          String requestBody=new String(requestDetails.loadRequestContents(),Constants.CHARSET_UTF8);
          params=UrlUtil.parseQueryStrings(theRequest.getQueryString(),requestBody);
        }
 else         if (theRequestType == RequestTypeEnum.GET) {
          params=UrlUtil.parseQueryString(theRequest.getQueryString());
        }
      }
    }
 else {
      completeUrl=requestUrl.toString();
    }
    if (params == null) {
      params=new HashMap<String,String[]>(theRequest.getParameterMap());
    }
    requestDetails.setParameters(params);
    for (    IServerInterceptor next : myInterceptors) {
      boolean continueProcessing=next.incomingRequestPreProcessed(theRequest,theResponse);
      if (!continueProcessing) {
        ourLog.debug("String_Node_Str");
        return;
      }
    }
    String requestPath=getRequestPath(requestFullPath,servletContextPath,servletPath);
    if (requestPath.length() > 0 && requestPath.charAt(0) == '/') {
      requestPath=requestPath.substring(1);
    }
    fhirServerBase=getServerBaseForRequest(theRequest);
    IIdType id;
    populateRequestDetailsFromRequestPath(requestDetails,requestPath);
    if (theRequestType == RequestTypeEnum.PUT) {
      String contentLocation=theRequest.getHeader(Constants.HEADER_CONTENT_LOCATION);
      if (contentLocation != null) {
        id=myFhirContext.getVersion().newIdType();
        id.setValue(contentLocation);
        requestDetails.setId(id);
      }
    }
    String acceptEncoding=theRequest.getHeader(Constants.HEADER_ACCEPT_ENCODING);
    boolean respondGzip=false;
    if (acceptEncoding != null) {
      String[] parts=acceptEncoding.trim().split("String_Node_Str");
      for (      String string : parts) {
        if (string.equals("String_Node_Str")) {
          respondGzip=true;
        }
      }
    }
    requestDetails.setRespondGzip(respondGzip);
    requestDetails.setRequestPath(requestPath);
    requestDetails.setFhirServerBase(fhirServerBase);
    requestDetails.setCompleteUrl(completeUrl);
    BaseMethodBinding<?> resourceMethod=determineResourceMethod(requestDetails,requestPath);
    requestDetails.setRestOperationType(resourceMethod.getRestOperationType());
    for (    IServerInterceptor next : myInterceptors) {
      boolean continueProcessing=next.incomingRequestPostProcessed(requestDetails,theRequest,theResponse);
      if (!continueProcessing) {
        ourLog.debug("String_Node_Str");
        return;
      }
    }
    Closeable outputStreamOrWriter=(Closeable)resourceMethod.invokeServer(this,requestDetails);
    for (int i=getInterceptors().size() - 1; i >= 0; i--) {
      IServerInterceptor next=getInterceptors().get(i);
      next.processingCompletedNormally(requestDetails);
    }
    if (outputStreamOrWriter != null) {
      outputStreamOrWriter.close();
    }
  }
 catch (  NotModifiedException e) {
    for (int i=getInterceptors().size() - 1; i >= 0; i--) {
      IServerInterceptor next=getInterceptors().get(i);
      if (!next.handleException(requestDetails,e,theRequest,theResponse)) {
        ourLog.debug("String_Node_Str");
        return;
      }
    }
    writeExceptionToResponse(theResponse,e);
  }
catch (  AuthenticationException e) {
    for (int i=getInterceptors().size() - 1; i >= 0; i--) {
      IServerInterceptor next=getInterceptors().get(i);
      if (!next.handleException(requestDetails,e,theRequest,theResponse)) {
        ourLog.debug("String_Node_Str");
        return;
      }
    }
    writeExceptionToResponse(theResponse,e);
  }
catch (  Throwable e) {
    BaseServerResponseException exception=null;
    for (int i=getInterceptors().size() - 1; i >= 0; i--) {
      IServerInterceptor next=getInterceptors().get(i);
      exception=next.preProcessOutgoingException(requestDetails,e,theRequest);
      if (exception != null) {
        ourLog.debug("String_Node_Str");
        break;
      }
    }
    if (exception == null) {
      exception=DEFAULT_EXCEPTION_HANDLER.preProcessOutgoingException(requestDetails,e,theRequest);
    }
    for (int i=getInterceptors().size() - 1; i >= 0; i--) {
      IServerInterceptor next=getInterceptors().get(i);
      if (!next.handleException(requestDetails,exception,theRequest,theResponse)) {
        ourLog.debug("String_Node_Str");
        return;
      }
    }
    requestDetails.getParameters().remove(Constants.PARAM_SUMMARY);
    requestDetails.getParameters().remove(Constants.PARAM_ELEMENTS);
    DEFAULT_EXCEPTION_HANDLER.handleException(requestDetails,exception,theRequest,theResponse);
  }
}