Program: 112291
Project: 112291
Buggy source:
protected void handleRequest(RequestTypeEnum theRequestType,HttpServletRequest theRequest,HttpServletResponse theResponse) throws ServletException, IOException {
  for (  IServerInterceptor next : myInterceptors) {
    boolean continueProcessing=next.incomingRequestPreProcessed(theRequest,theResponse);
    if (!continueProcessing) {
      ourLog.debug("String_Node_Str");
      return;
    }
  }
  String fhirServerBase=null;
  boolean requestIsBrowser=requestIsBrowser(theRequest);
  RequestDetails requestDetails=new RequestDetails();
  requestDetails.setServer(this);
  requestDetails.setRequestType(theRequestType);
  requestDetails.setServletRequest(theRequest);
  requestDetails.setServletResponse(theResponse);
  try {
    String resourceName=null;
    String requestFullPath=StringUtils.defaultString(theRequest.getRequestURI());
    String servletPath=StringUtils.defaultString(theRequest.getServletPath());
    StringBuffer requestUrl=theRequest.getRequestURL();
    String servletContextPath="String_Node_Str";
    if (getServletContext() != null) {
      servletContextPath=StringUtils.defaultString(getServletContext().getContextPath());
    }
    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);
    }
    IdDt id=null;
    String operation=null;
    String compartment=null;
    String requestPath=getRequestPath(requestFullPath,servletContextPath,servletPath);
    if (requestPath.length() > 0 && requestPath.charAt(0) == '/') {
      requestPath=requestPath.substring(1);
    }
    fhirServerBase=getServerBaseForRequest(theRequest);
    String completeUrl=StringUtils.isNotBlank(theRequest.getQueryString()) ? requestUrl + "String_Node_Str" + theRequest.getQueryString() : requestUrl.toString();
    Map<String,String[]> params=new HashMap<String,String[]>(theRequest.getParameterMap());
    requestDetails.setParameters(params);
    StringTokenizer tok=new StringTokenizer(requestPath,"String_Node_Str");
    if (tok.hasMoreTokens()) {
      resourceName=tok.nextToken();
      if (partIsOperation(resourceName)) {
        operation=resourceName;
        resourceName=null;
      }
    }
    requestDetails.setResourceName(resourceName);
    ResourceBinding resourceBinding=null;
    BaseMethodBinding<?> resourceMethod=null;
    if (Constants.URL_TOKEN_METADATA.equals(resourceName) || theRequestType == RequestTypeEnum.OPTIONS) {
      resourceMethod=myServerConformanceMethod;
    }
 else     if (resourceName == null) {
      resourceBinding=myServerBinding;
    }
 else {
      resourceBinding=myResourceNameToBinding.get(resourceName);
      if (resourceBinding == null) {
        throw new InvalidRequestException("String_Node_Str" + resourceName + "String_Node_Str"+ myResourceNameToBinding.keySet());
      }
    }
    if (tok.hasMoreTokens()) {
      String nextString=tok.nextToken();
      if (partIsOperation(nextString)) {
        operation=nextString;
      }
 else {
        id=new IdDt(resourceName,UrlUtil.unescape(nextString));
      }
    }
    if (tok.hasMoreTokens()) {
      String nextString=tok.nextToken();
      if (nextString.equals(Constants.PARAM_HISTORY)) {
        if (tok.hasMoreTokens()) {
          String versionString=tok.nextToken();
          if (id == null) {
            throw new InvalidRequestException("String_Node_Str" + requestPath);
          }
          id=new IdDt(resourceName,id.getIdPart(),UrlUtil.unescape(versionString));
        }
 else {
          operation=Constants.PARAM_HISTORY;
        }
      }
 else       if (partIsOperation(nextString)) {
        if (operation != null) {
          throw new InvalidRequestException("String_Node_Str" + requestPath);
        }
        operation=nextString;
      }
 else {
        compartment=nextString;
      }
    }
    String secondaryOperation=null;
    while (tok.hasMoreTokens()) {
      String nextString=tok.nextToken();
      if (operation == null) {
        operation=nextString;
      }
 else       if (secondaryOperation == null) {
        secondaryOperation=nextString;
      }
 else {
        throw new InvalidRequestException("String_Node_Str" + nextString + "String_Node_Str"+ requestPath);
      }
    }
    if (theRequestType == RequestTypeEnum.PUT) {
      String contentLocation=theRequest.getHeader(Constants.HEADER_CONTENT_LOCATION);
      if (contentLocation != null) {
        id=new IdDt(contentLocation);
      }
    }
    requestDetails.setId(id);
    requestDetails.setOperation(operation);
    requestDetails.setSecondaryOperation(secondaryOperation);
    requestDetails.setCompartmentName(compartment);
    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);
    String pagingAction=theRequest.getParameter(Constants.PARAM_PAGINGACTION);
    if (getPagingProvider() != null && isNotBlank(pagingAction)) {
      requestDetails.setOtherOperationType(OtherOperationTypeEnum.GET_PAGE);
      if (theRequestType != RequestTypeEnum.GET) {
        throw new InvalidRequestException(getFhirContext().getLocalizer().getMessage(RestfulServer.class,"String_Node_Str"));
      }
      handlePagingRequest(requestDetails,theResponse,pagingAction);
      return;
    }
    if (resourceMethod == null) {
      if (resourceBinding != null) {
        resourceMethod=resourceBinding.getMethod(requestDetails);
      }
    }
    if (resourceMethod == null) {
      if (isBlank(requestPath)) {
        throw new InvalidRequestException(myFhirContext.getLocalizer().getMessage(RestfulServer.class,"String_Node_Str"));
      }
 else {
        throw new InvalidRequestException(myFhirContext.getLocalizer().getMessage(RestfulServer.class,"String_Node_Str",theRequestType.name(),requestPath,params.keySet()));
      }
    }
    requestDetails.setResourceOperationType(resourceMethod.getResourceOperationType());
    requestDetails.setSystemOperationType(resourceMethod.getSystemOperationType());
    requestDetails.setOtherOperationType(resourceMethod.getOtherOperationType());
    for (    IServerInterceptor next : myInterceptors) {
      boolean continueProcessing=next.incomingRequestPostProcessed(requestDetails,theRequest,theResponse);
      if (!continueProcessing) {
        ourLog.debug("String_Node_Str");
        return;
      }
    }
    resourceMethod.invokeServer(this,requestDetails);
  }
 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;
      }
    }
    if (requestIsBrowser) {
      theResponse.setHeader("String_Node_Str","String_Node_Str");
    }
    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,exception,theRequest);
      if (exception != null) {
        ourLog.debug("String_Node_Str");
        break;
      }
    }
    if (exception == null) {
      exception=new ExceptionHandlingInterceptor().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;
      }
    }
    new ExceptionHandlingInterceptor().handleException(requestDetails,exception,theRequest,theResponse);
  }
}

Fixed version (ground truth):
protected void handleRequest(RequestTypeEnum theRequestType,HttpServletRequest theRequest,HttpServletResponse theResponse) throws ServletException, IOException {
  for (  IServerInterceptor next : myInterceptors) {
    boolean continueProcessing=next.incomingRequestPreProcessed(theRequest,theResponse);
    if (!continueProcessing) {
      ourLog.debug("String_Node_Str");
      return;
    }
  }
  String fhirServerBase=null;
  boolean requestIsBrowser=requestIsBrowser(theRequest);
  RequestDetails requestDetails=new RequestDetails();
  requestDetails.setServer(this);
  requestDetails.setRequestType(theRequestType);
  requestDetails.setServletRequest(theRequest);
  requestDetails.setServletResponse(theResponse);
  try {
    String resourceName=null;
    String requestFullPath=StringUtils.defaultString(theRequest.getRequestURI());
    String servletPath=StringUtils.defaultString(theRequest.getServletPath());
    StringBuffer requestUrl=theRequest.getRequestURL();
    String servletContextPath="String_Node_Str";
    if (getServletContext() != null) {
      servletContextPath=StringUtils.defaultString(getServletContext().getContextPath());
    }
    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);
    }
    IdDt id=null;
    String operation=null;
    String compartment=null;
    String requestPath=getRequestPath(requestFullPath,servletContextPath,servletPath);
    if (requestPath.length() > 0 && requestPath.charAt(0) == '/') {
      requestPath=requestPath.substring(1);
    }
    fhirServerBase=getServerBaseForRequest(theRequest);
    String completeUrl=StringUtils.isNotBlank(theRequest.getQueryString()) ? requestUrl + "String_Node_Str" + theRequest.getQueryString() : requestUrl.toString();
    Map<String,String[]> params=new HashMap<String,String[]>(theRequest.getParameterMap());
    requestDetails.setParameters(params);
    StringTokenizer tok=new StringTokenizer(requestPath,"String_Node_Str");
    if (tok.hasMoreTokens()) {
      resourceName=tok.nextToken();
      if (partIsOperation(resourceName)) {
        operation=resourceName;
        resourceName=null;
      }
    }
    requestDetails.setResourceName(resourceName);
    ResourceBinding resourceBinding=null;
    BaseMethodBinding<?> resourceMethod=null;
    if (Constants.URL_TOKEN_METADATA.equals(resourceName) || theRequestType == RequestTypeEnum.OPTIONS) {
      resourceMethod=myServerConformanceMethod;
    }
 else     if (resourceName == null) {
      resourceBinding=myServerBinding;
    }
 else {
      resourceBinding=myResourceNameToBinding.get(resourceName);
      if (resourceBinding == null) {
        throw new InvalidRequestException("String_Node_Str" + resourceName + "String_Node_Str"+ myResourceNameToBinding.keySet());
      }
    }
    if (tok.hasMoreTokens()) {
      String nextString=tok.nextToken();
      if (partIsOperation(nextString)) {
        operation=nextString;
      }
 else {
        id=new IdDt(resourceName,UrlUtil.unescape(nextString));
      }
    }
    if (tok.hasMoreTokens()) {
      String nextString=tok.nextToken();
      if (nextString.equals(Constants.PARAM_HISTORY)) {
        if (tok.hasMoreTokens()) {
          String versionString=tok.nextToken();
          if (id == null) {
            throw new InvalidRequestException("String_Node_Str" + requestPath);
          }
          id=new IdDt(resourceName,id.getIdPart(),UrlUtil.unescape(versionString));
        }
 else {
          operation=Constants.PARAM_HISTORY;
        }
      }
 else       if (partIsOperation(nextString)) {
        if (operation != null) {
          throw new InvalidRequestException("String_Node_Str" + requestPath);
        }
        operation=nextString;
      }
 else {
        compartment=nextString;
      }
    }
    String secondaryOperation=null;
    while (tok.hasMoreTokens()) {
      String nextString=tok.nextToken();
      if (operation == null) {
        operation=nextString;
      }
 else       if (secondaryOperation == null) {
        secondaryOperation=nextString;
      }
 else {
        throw new InvalidRequestException("String_Node_Str" + nextString + "String_Node_Str"+ requestPath);
      }
    }
    if (theRequestType == RequestTypeEnum.PUT) {
      String contentLocation=theRequest.getHeader(Constants.HEADER_CONTENT_LOCATION);
      if (contentLocation != null) {
        id=new IdDt(contentLocation);
      }
    }
    requestDetails.setId(id);
    requestDetails.setOperation(operation);
    requestDetails.setSecondaryOperation(secondaryOperation);
    requestDetails.setCompartmentName(compartment);
    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);
    String pagingAction=theRequest.getParameter(Constants.PARAM_PAGINGACTION);
    if (getPagingProvider() != null && isNotBlank(pagingAction)) {
      requestDetails.setOtherOperationType(OtherOperationTypeEnum.GET_PAGE);
      if (theRequestType != RequestTypeEnum.GET) {
        throw new InvalidRequestException(getFhirContext().getLocalizer().getMessage(RestfulServer.class,"String_Node_Str"));
      }
      handlePagingRequest(requestDetails,theResponse,pagingAction);
      return;
    }
    if (resourceMethod == null) {
      if (resourceBinding != null) {
        resourceMethod=resourceBinding.getMethod(requestDetails);
      }
    }
    if (resourceMethod == null) {
      if (isBlank(requestPath)) {
        throw new InvalidRequestException(myFhirContext.getLocalizer().getMessage(RestfulServer.class,"String_Node_Str"));
      }
 else {
        throw new InvalidRequestException(myFhirContext.getLocalizer().getMessage(RestfulServer.class,"String_Node_Str",theRequestType.name(),requestPath,params.keySet()));
      }
    }
    requestDetails.setResourceOperationType(resourceMethod.getResourceOperationType());
    requestDetails.setSystemOperationType(resourceMethod.getSystemOperationType());
    requestDetails.setOtherOperationType(resourceMethod.getOtherOperationType());
    for (    IServerInterceptor next : myInterceptors) {
      boolean continueProcessing=next.incomingRequestPostProcessed(requestDetails,theRequest,theResponse);
      if (!continueProcessing) {
        ourLog.debug("String_Node_Str");
        return;
      }
    }
    resourceMethod.invokeServer(this,requestDetails);
  }
 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;
      }
    }
    if (requestIsBrowser) {
      theResponse.setHeader("String_Node_Str","String_Node_Str");
    }
    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=new ExceptionHandlingInterceptor().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;
      }
    }
    new ExceptionHandlingInterceptor().handleException(requestDetails,exception,theRequest,theResponse);
  }
}