Program: 10838
Project: 10838
Buggy source:
protected void uploadContent(HttpServletRequest req,HttpServletResponse resp) throws IOException {
  String sessionId=extractSessionId(req);
  RepositoryHttpEndpointImpl elem=repoHttpManager.getHttpRepoItemElem(sessionId);
  if (elem == null) {
    resp.setStatus(HttpServletResponse.SC_NOT_FOUND);
    return;
  }
  elem.stopCurrentTimer();
  elem.fireStartedEventIfFirstTime();
  try (InputStream requestInputStream=req.getInputStream()){
    try (OutputStream repoItemOutputStream=elem.getRepoItemOutputStream()){
      Range range=parseContentRange(req,resp);
      if (range != null) {
        if (range.start > elem.getWrittenBytes()) {
          resp.setStatus(HttpServletResponse.SC_NOT_IMPLEMENTED);
          resp.getOutputStream().println("String_Node_Str" + "String_Node_Str");
        }
 else         if (range.end == elem.getWrittenBytes()) {
          resp.setStatus(SC_OK);
          resp.getOutputStream().println("String_Node_Str" + "String_Node_Str");
        }
 else         if (range.start < elem.getWrittenBytes() && range.end > elem.getWrittenBytes()) {
          Range copyRange=new Range();
          copyRange.start=elem.getWrittenBytes() - range.start;
          copyRange.end=range.end - range.start;
          copyStreamsRange(requestInputStream,repoItemOutputStream,copyRange);
          resp.setStatus(SC_OK);
        }
 else         if (range.start == elem.getWrittenBytes()) {
          IOUtils.copy(requestInputStream,repoItemOutputStream);
          resp.setStatus(SC_OK);
        }
      }
 else {
        boolean isMultipart=ServletFileUpload.isMultipartContent(req);
        if (isMultipart) {
          uploadMultipart(req,resp,repoItemOutputStream);
        }
 else {
          try {
            log.info("String_Node_Str" + req.getContentLength() + "String_Node_Str");
            int bytes=IOUtils.copy(requestInputStream,repoItemOutputStream);
            resp.setStatus(SC_OK);
            log.info("String_Node_Str" + bytes);
          }
 catch (          Exception e) {
            log.warn("String_Node_Str",e);
            elem.fireSessionErrorEvent(e);
            resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
          }
        }
      }
    }
   }
  finally {
    elem.stopInTimeout();
  }
}

Fixed version (ground truth):
protected void uploadContent(HttpServletRequest req,HttpServletResponse resp) throws IOException {
  String sessionId=extractSessionId(req);
  RepositoryHttpEndpointImpl elem=repoHttpManager.getHttpRepoItemElem(sessionId);
  if (elem == null) {
    resp.setStatus(HttpServletResponse.SC_NOT_FOUND);
    return;
  }
  elem.stopCurrentTimer();
  elem.fireStartedEventIfFirstTime();
  try (InputStream requestInputStream=req.getInputStream()){
    OutputStream repoItemOutputStream=elem.getRepoItemOutputStream();
    Range range=parseContentRange(req,resp);
    if (range != null) {
      if (range.start > elem.getWrittenBytes()) {
        resp.setStatus(HttpServletResponse.SC_NOT_IMPLEMENTED);
        resp.getOutputStream().println("String_Node_Str" + "String_Node_Str");
      }
 else       if (range.end == elem.getWrittenBytes()) {
        resp.setStatus(SC_OK);
        resp.getOutputStream().println("String_Node_Str" + "String_Node_Str");
      }
 else       if (range.start < elem.getWrittenBytes() && range.end > elem.getWrittenBytes()) {
        Range copyRange=new Range();
        copyRange.start=elem.getWrittenBytes() - range.start;
        copyRange.end=range.end - range.start;
        copyStreamsRange(requestInputStream,repoItemOutputStream,copyRange);
        resp.setStatus(SC_OK);
      }
 else       if (range.start == elem.getWrittenBytes()) {
        IOUtils.copy(requestInputStream,repoItemOutputStream);
        resp.setStatus(SC_OK);
      }
    }
 else {
      boolean isMultipart=ServletFileUpload.isMultipartContent(req);
      if (isMultipart) {
        uploadMultipart(req,resp,repoItemOutputStream);
      }
 else {
        try {
          log.info("String_Node_Str" + req.getContentLength() + "String_Node_Str");
          int bytes=IOUtils.copy(requestInputStream,repoItemOutputStream);
          resp.setStatus(SC_OK);
          log.info("String_Node_Str" + bytes);
        }
 catch (        Exception e) {
          log.warn("String_Node_Str",e);
          elem.fireSessionErrorEvent(e);
          resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
        }
      }
    }
  }
  finally {
    elem.stopInTimeout();
  }
}