Program: 93557
Project: 93557
Buggy source:
/** 
 * @param exchange
 * @param context
 * @throws Exception
 */
@Override public void handleRequest(HttpServerExchange exchange,RequestContext context) throws Exception {
  DBObject content=context.getContent();
  if (content == null) {
    content=new BasicDBObject();
  }
  if (content instanceof BasicDBList) {
    ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_ACCEPTABLE,"String_Node_Str");
    return;
  }
  ObjectId etag=RequestHelper.getWriteEtag(exchange);
  if (content.get("String_Node_Str") != null && content.get("String_Node_Str") instanceof String && RequestContext.isReservedResourceDocument((String)content.get("String_Node_Str"))) {
    ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_FORBIDDEN,"String_Node_Str");
    return;
  }
  Object docId;
  if (content.get("String_Node_Str") == null) {
    if (context.getDocIdType() == DOC_ID_TYPE.OBJECTID || context.getDocIdType() == DOC_ID_TYPE.STRING_OBJECTID) {
      docId=new ObjectId();
    }
 else {
      ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_ACCEPTABLE,"String_Node_Str" + context.getDocIdType().name());
      return;
    }
  }
 else {
    try {
      docId=URLUtils.getId(content.get("String_Node_Str"),context.getDocIdType());
    }
 catch (    UnsupportedDocumentIdException idide) {
      ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_ACCEPTABLE,"String_Node_Str" + context.getDocIdType().name());
      return;
    }
  }
  int httpCode=this.documentDAO.upsertDocumentPost(context.getDBName(),context.getCollectionName(),docId,content,etag);
  exchange.getResponseHeaders().add(HttpString.tryFromString("String_Node_Str"),getReferenceLink(context,exchange.getRequestURL(),docId));
  if (context.getWarnings() != null && !context.getWarnings().isEmpty()) {
    sendWarnings(httpCode,exchange,context);
  }
 else {
    exchange.setResponseCode(httpCode);
  }
  exchange.endExchange();
}

Fixed version (ground truth):
/** 
 * @param exchange
 * @param context
 * @throws Exception
 */
@Override public void handleRequest(HttpServerExchange exchange,RequestContext context) throws Exception {
  DBObject content=context.getContent();
  if (content == null) {
    content=new BasicDBObject();
  }
  if (content instanceof BasicDBList) {
    ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_ACCEPTABLE,"String_Node_Str");
    return;
  }
  ObjectId etag=RequestHelper.getWriteEtag(exchange);
  if (content.get("String_Node_Str") != null && content.get("String_Node_Str") instanceof String && RequestContext.isReservedResourceDocument((String)content.get("String_Node_Str"))) {
    ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_FORBIDDEN,"String_Node_Str");
    return;
  }
  Object docId;
  if (content.get("String_Node_Str") == null) {
    if (context.getDocIdType() == DOC_ID_TYPE.OBJECTID || context.getDocIdType() == DOC_ID_TYPE.STRING_OBJECTID) {
      docId=new ObjectId();
    }
 else {
      ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_ACCEPTABLE,"String_Node_Str" + context.getDocIdType().name());
      return;
    }
  }
 else {
    try {
      URLUtils.checkId(content.get("String_Node_Str"));
      docId=content.get("String_Node_Str");
    }
 catch (    UnsupportedDocumentIdException idide) {
      ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_ACCEPTABLE,"String_Node_Str" + content.get("String_Node_Str").getClass().getSimpleName());
      return;
    }
  }
  int httpCode=this.documentDAO.upsertDocumentPost(context.getDBName(),context.getCollectionName(),docId,content,etag);
  exchange.getResponseHeaders().add(HttpString.tryFromString("String_Node_Str"),getReferenceLink(context,exchange.getRequestURL(),docId));
  if (context.getWarnings() != null && !context.getWarnings().isEmpty()) {
    sendWarnings(httpCode,exchange,context);
  }
 else {
    exchange.setResponseCode(httpCode);
  }
  exchange.endExchange();
}