Program: 17817
Project: 17817
Buggy source:
private ODataRequest parseRequest(final Scanner scanner,final boolean isChangeSet) throws BatchException {
  ODataRequest request;
  if (scanner.hasNext(REG_EX_REQUEST_LINE)) {
    scanner.next(REG_EX_REQUEST_LINE);
    currentLineNumber++;
    String method=null;
    String uri=null;
    MatchResult result=scanner.match();
    if (result.groupCount() == 2) {
      method=result.group(1);
      uri=result.group(2).trim();
    }
 else {
      currentLineNumber++;
      throw new BatchException(BatchException.INVALID_REQUEST_LINE.addContent(scanner.next()).addContent(currentLineNumber));
    }
    PathInfo pathInfo=parseRequestUri(uri);
    Map<String,String> queryParameters=parseQueryParameters(uri);
    if (isChangeSet) {
      if (!HTTP_CHANGESET_METHODS.contains(method)) {
        throw new BatchException(BatchException.INVALID_CHANGESET_METHOD.addContent(currentLineNumber));
      }
    }
 else     if (!HTTP_BATCH_METHODS.contains(method)) {
      throw new BatchException(BatchException.INVALID_QUERY_OPERATION_METHOD.addContent(currentLineNumber));
    }
    ODataHttpMethod httpMethod=ODataHttpMethod.valueOf(method);
    Map<String,List<String>> headers=parseRequestHeaders(scanner);
    if (currentMimeHeaderContentId != null) {
      List<String> headerList=new ArrayList<String>();
      headerList.add(currentMimeHeaderContentId);
      headers.put(BatchConstants.MIME_HEADER_CONTENT_ID.toLowerCase(Locale.ENGLISH),headerList);
    }
    String contentType=getContentTypeHeader(headers);
    List<String> acceptHeaders=getAcceptHeader(headers);
    List<Locale> acceptLanguages=getAcceptLanguageHeader(headers);
    parseNewLine(scanner);
    InputStream body=new ByteArrayInputStream("String_Node_Str".getBytes());
    if (isChangeSet) {
      body=parseBody(scanner);
    }
    if (contentType != null) {
      request=ODataRequest.method(httpMethod).queryParameters(queryParameters).requestHeaders(headers).pathInfo(pathInfo).acceptableLanguages(acceptLanguages).contentType(contentType).body(body).acceptHeaders(acceptHeaders).build();
    }
 else {
      request=ODataRequest.method(httpMethod).queryParameters(queryParameters).requestHeaders(headers).pathInfo(pathInfo).acceptableLanguages(acceptLanguages).body(body).acceptHeaders(acceptHeaders).build();
    }
  }
 else {
    currentLineNumber++;
    throw new BatchException(BatchException.INVALID_REQUEST_LINE.addContent(scanner.next()).addContent(currentLineNumber));
  }
  return request;
}

Fixed version (ground truth):
private ODataRequest parseRequest(final Scanner scanner,final boolean isChangeSet) throws BatchException {
  try {
    ODataRequest request;
    if (scanner.hasNext(REG_EX_REQUEST_LINE)) {
      scanner.next(REG_EX_REQUEST_LINE);
      currentLineNumber++;
      String method=null;
      String uri=null;
      MatchResult result=scanner.match();
      if (result.groupCount() == 2) {
        method=result.group(1);
        uri=result.group(2).trim();
      }
 else {
        currentLineNumber++;
        throw new BatchException(BatchException.INVALID_REQUEST_LINE.addContent(scanner.next()).addContent(currentLineNumber));
      }
      PathInfo pathInfo=parseRequestUri(uri);
      Map<String,String> queryParameters=parseQueryParameters(uri);
      if (isChangeSet) {
        if (!HTTP_CHANGESET_METHODS.contains(method)) {
          throw new BatchException(BatchException.INVALID_CHANGESET_METHOD.addContent(currentLineNumber));
        }
      }
 else       if (!HTTP_BATCH_METHODS.contains(method)) {
        throw new BatchException(BatchException.INVALID_QUERY_OPERATION_METHOD.addContent(currentLineNumber));
      }
      ODataHttpMethod httpMethod=ODataHttpMethod.valueOf(method);
      Map<String,List<String>> headers=parseRequestHeaders(scanner);
      if (currentMimeHeaderContentId != null) {
        List<String> headerList=new ArrayList<String>();
        headerList.add(currentMimeHeaderContentId);
        headers.put(BatchConstants.MIME_HEADER_CONTENT_ID.toLowerCase(Locale.ENGLISH),headerList);
      }
      String contentType=getContentTypeHeader(headers);
      List<String> acceptHeaders=getAcceptHeader(headers);
      List<Locale> acceptLanguages=getAcceptLanguageHeader(headers);
      parseNewLine(scanner);
      InputStream body;
      body=new ByteArrayInputStream("String_Node_Str".getBytes("String_Node_Str"));
      if (isChangeSet) {
        body=parseBody(scanner);
      }
      if (contentType != null) {
        request=ODataRequest.method(httpMethod).queryParameters(queryParameters).requestHeaders(headers).pathInfo(pathInfo).acceptableLanguages(acceptLanguages).contentType(contentType).body(body).acceptHeaders(acceptHeaders).build();
      }
 else {
        request=ODataRequest.method(httpMethod).queryParameters(queryParameters).requestHeaders(headers).pathInfo(pathInfo).acceptableLanguages(acceptLanguages).body(body).acceptHeaders(acceptHeaders).build();
      }
    }
 else {
      currentLineNumber++;
      throw new BatchException(BatchException.INVALID_REQUEST_LINE.addContent(scanner.next()).addContent(currentLineNumber));
    }
    return request;
  }
 catch (  UnsupportedEncodingException e) {
    throw new ODataRuntimeException(e);
  }
}