Program: 93637
Project: 93637
Buggy source:
@Override public void handleRequest(HttpServerExchange exchange,RequestContext context) throws Exception {
  if (context.getDBName().isEmpty()) {
    ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_ACCEPTABLE,"String_Node_Str");
    return;
  }
  if (context.getCollectionName().isEmpty() || context.getCollectionName().startsWith("String_Node_Str")) {
    ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_ACCEPTABLE,"String_Node_Str");
    return;
  }
  DBObject content=context.getContent();
  if (content == null) {
    ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_ACCEPTABLE,"String_Node_Str");
    return;
  }
  if (content instanceof BasicDBList) {
    ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_ACCEPTABLE,"String_Node_Str");
    return;
  }
  if (content.containsField(Relationship.RELATIONSHIPS_ELEMENT_NAME)) {
    try {
      Relationship.getFromJson(content);
    }
 catch (    InvalidMetadataException ex) {
      ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_ACCEPTABLE,"String_Node_Str" + ex.getMessage(),ex);
      return;
    }
  }
  ObjectId etag=RequestHelper.getUpdateEtag(exchange);
  if (etag == null) {
    ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_CONFLICT,"String_Node_Str" + Headers.ETAG + "String_Node_Str");
    logger.warn("String_Node_Str",Headers.ETAG);
    return;
  }
  int SC=CollectionDAO.upsertCollection(context.getDBName(),context.getCollectionName(),content,etag,true,true);
  if (context.getWarnings() != null && !context.getWarnings().isEmpty()) {
    DocumentRepresentationFactory.sendDocument(exchange.getRequestPath(),exchange,context,new BasicDBObject());
  }
  ResponseHelper.endExchange(exchange,SC);
}

Fixed version (ground truth):
@Override public void handleRequest(HttpServerExchange exchange,RequestContext context) throws Exception {
  if (context.getDBName().isEmpty()) {
    ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_ACCEPTABLE,"String_Node_Str");
    return;
  }
  if (context.getCollectionName().isEmpty() || context.getCollectionName().startsWith("String_Node_Str")) {
    ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_ACCEPTABLE,"String_Node_Str");
    return;
  }
  DBObject content=context.getContent();
  if (content == null) {
    ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_ACCEPTABLE,"String_Node_Str");
    return;
  }
  if (content instanceof BasicDBList) {
    ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_ACCEPTABLE,"String_Node_Str");
    return;
  }
  if (content.containsField(Relationship.RELATIONSHIPS_ELEMENT_NAME)) {
    try {
      Relationship.getFromJson(content);
    }
 catch (    InvalidMetadataException ex) {
      ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_ACCEPTABLE,"String_Node_Str" + ex.getMessage(),ex);
      return;
    }
  }
  ObjectId etag=RequestHelper.getUpdateEtag(exchange);
  if (etag == null) {
    ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_CONFLICT,"String_Node_Str" + Headers.ETAG + "String_Node_Str");
    logger.warn("String_Node_Str",Headers.ETAG);
    return;
  }
  int SC=CollectionDAO.upsertCollection(context.getDBName(),context.getCollectionName(),content,etag,true,true);
  exchange.setResponseCode(SC);
  if (context.getWarnings() != null && !context.getWarnings().isEmpty()) {
    DocumentRepresentationFactory.sendDocument(exchange.getRequestPath(),exchange,context,new BasicDBObject());
  }
  exchange.endExchange();
}