Program: 112327
Project: 112327
Buggy source:
protected void handleRequest(SearchMethodBinding.RequestType theRequestType,HttpServletRequest theRequest,HttpServletResponse theResponse) throws ServletException, IOException {
}

Fixed version (ground truth):
protected void handleRequest(SearchMethodBinding.RequestType 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=null;
  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=requestFullPath.substring(escapedLength(servletContextPath) + escapedLength(servletPath));
    if (requestPath.length() > 0 && requestPath.charAt(0) == '/') {
      requestPath=requestPath.substring(1);
    }
    fhirServerBase=myServerAddressStrategy.determineServerBase(getServletContext(),theRequest);
    if (fhirServerBase.endsWith("String_Node_Str")) {
      fhirServerBase=fhirServerBase.substring(0,fhirServerBase.length() - 1);
    }
    String completeUrl=StringUtils.isNotBlank(theRequest.getQueryString()) ? requestUrl + "String_Node_Str" + theRequest.getQueryString() : requestUrl.toString();
    Map<String,String[]> params=new HashMap<String,String[]>(theRequest.getParameterMap());
    StringTokenizer tok=new StringTokenizer(requestPath,"String_Node_Str");
    if (tok.hasMoreTokens()) {
      resourceName=tok.nextToken();
      if (resourceName.startsWith("String_Node_Str")) {
        operation=resourceName;
        resourceName=null;
      }
    }
    ResourceBinding resourceBinding=null;
    BaseMethodBinding<?> resourceMethod=null;
    if ("String_Node_Str".equals(resourceName) || theRequestType == RequestType.OPTIONS) {
      resourceMethod=myServerConformanceMethod;
    }
 else     if (resourceName == null) {
      resourceBinding=myNullResourceBinding;
    }
 else {
      resourceBinding=myResourceNameToProvider.get(resourceName);
      if (resourceBinding == null) {
        throw new InvalidRequestException("String_Node_Str" + resourceName + "String_Node_Str"+ myResourceNameToProvider.keySet());
      }
    }
    if (tok.hasMoreTokens()) {
      String nextString=tok.nextToken();
      if (nextString.startsWith("String_Node_Str")) {
        operation=nextString;
      }
 else {
        id=new IdDt(resourceName,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 + "String_Node_Str" + id.getIdPart()+ "String_Node_Str"+ versionString);
        }
 else {
          operation=Constants.PARAM_HISTORY;
        }
      }
 else       if (nextString.startsWith("String_Node_Str")) {
        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 == RequestType.PUT) {
      String contentLocation=theRequest.getHeader(Constants.HEADER_CONTENT_LOCATION);
      if (contentLocation != null) {
        id=new IdDt(contentLocation);
      }
    }
    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;
        }
      }
    }
    Request r=new Request();
    r.setResourceName(resourceName);
    r.setId(id);
    r.setOperation(operation);
    r.setSecondaryOperation(secondaryOperation);
    r.setParameters(params);
    r.setRequestType(theRequestType);
    r.setFhirServerBase(fhirServerBase);
    r.setCompleteUrl(completeUrl);
    r.setServletRequest(theRequest);
    r.setServletResponse(theResponse);
    r.setRespondGzip(respondGzip);
    r.setCompartmentName(compartment);
    String pagingAction=theRequest.getParameter(Constants.PARAM_PAGINGACTION);
    if (getPagingProvider() != null && isNotBlank(pagingAction)) {
      r.setOtherOperationType(OtherOperationTypeEnum.GET_PAGE);
      handlePagingRequest(r,theResponse,pagingAction);
      return;
    }
    if (resourceMethod == null && resourceBinding != null) {
      resourceMethod=resourceBinding.getMethod(r);
    }
    if (resourceMethod == null) {
      StringBuilder b=new StringBuilder();
      b.append("String_Node_Str");
      b.append(theRequestType.name());
      b.append("String_Node_Str");
      b.append(requestPath);
      b.append("String_Node_Str");
      b.append("String_Node_Str");
      b.append(params.keySet());
      throw new InvalidRequestException(b.toString());
    }
    requestDetails=r;
    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,r);
  }
 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");
    }
    theResponse.setStatus(e.getStatusCode());
    addHeadersToResponse(theResponse);
    theResponse.setContentType("String_Node_Str");
    theResponse.setCharacterEncoding("String_Node_Str");
    theResponse.getWriter().write(e.getMessage());
  }
catch (  Throwable 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;
      }
    }
    BaseOperationOutcome oo=null;
    int statusCode=Constants.STATUS_HTTP_500_INTERNAL_ERROR;
    if (e instanceof BaseServerResponseException) {
      oo=((BaseServerResponseException)e).getOperationOutcome();
      statusCode=((BaseServerResponseException)e).getStatusCode();
    }
    if (oo == null) {
      try {
        oo=(BaseOperationOutcome)myFhirContext.getResourceDefinition("String_Node_Str").getImplementingClass().newInstance();
      }
 catch (      Exception e1) {
        ourLog.error("String_Node_Str",e1);
        throw new ServletException("String_Node_Str",e1);
      }
      BaseIssue issue=oo.addIssue();
      issue.getSeverityElement().setValue("String_Node_Str");
      if (e instanceof InternalErrorException) {
        ourLog.error("String_Node_Str",e);
        issue.getDetailsElement().setValue(e.toString() + "String_Node_Str" + ExceptionUtils.getStackTrace(e));
      }
 else       if (e instanceof BaseServerResponseException) {
        ourLog.warn("String_Node_Str",e.toString());
        BaseServerResponseException baseServerResponseException=(BaseServerResponseException)e;
        statusCode=baseServerResponseException.getStatusCode();
        issue.getDetailsElement().setValue(e.getMessage());
        if (baseServerResponseException.getAdditionalMessages() != null) {
          for (          String next : baseServerResponseException.getAdditionalMessages()) {
            BaseIssue issue2=oo.addIssue();
            issue2.getSeverityElement().setValue("String_Node_Str");
            issue2.setDetails(next);
          }
        }
      }
 else {
        ourLog.error("String_Node_Str" + e.toString(),e);
        issue.getDetailsElement().setValue(e.toString() + "String_Node_Str" + ExceptionUtils.getStackTrace(e));
        statusCode=Constants.STATUS_HTTP_500_INTERNAL_ERROR;
      }
    }
    streamResponseAsResource(this,theResponse,oo,determineResponseEncoding(theRequest),true,requestIsBrowser,NarrativeModeEnum.NORMAL,statusCode,false,fhirServerBase);
    theResponse.setStatus(statusCode);
    addHeadersToResponse(theResponse);
    theResponse.setContentType("String_Node_Str");
    theResponse.setCharacterEncoding("String_Node_Str");
    theResponse.getWriter().append(e.getMessage());
    theResponse.getWriter().close();
  }
}