Program: 93521
Project: 93521
Buggy source:
/** 
 * @param exchange
 * @param context
 * @throws Exception
 */
@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;
    }
  }
  if (content.containsField(RepresentationTransformer.RTS_ELEMENT_NAME)) {
    try {
      RepresentationTransformer.getFromJson(content);
    }
 catch (    InvalidMetadataException ex) {
      ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_ACCEPTABLE,"String_Node_Str" + ex.getMessage(),ex);
      return;
    }
  }
  if (content.containsField(SchemaCheckerMetadata.SC_ELEMENT_NAME)) {
    try {
      SchemaCheckerMetadata.getFromJson(content);
    }
 catch (    InvalidMetadataException ex) {
      ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_ACCEPTABLE,"String_Node_Str" + ex.getMessage(),ex);
      return;
    }
  }
  ObjectId etag=RequestHelper.getWriteEtag(exchange);
  if (etag == null) {
    ResponseHelper.endExchange(exchange,HttpStatus.SC_CONFLICT);
    return;
  }
  int httpCode=getDatabase().upsertCollection(context.getDBName(),context.getCollectionName(),content,etag,true,true);
  if (context.getWarnings() != null && !context.getWarnings().isEmpty()) {
    sendWarnings(httpCode,exchange,context);
  }
 else {
    exchange.setResponseCode(httpCode);
  }
  exchange.endExchange();
  LocalCachesSingleton.getInstance().invalidateCollection(context.getDBName(),context.getCollectionName());
}

Fixed version (ground truth):
/** 
 * @param exchange
 * @param context
 * @throws Exception
 */
@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;
    }
  }
  if (content.containsField(RepresentationTransformer.RTS_ELEMENT_NAME)) {
    try {
      RepresentationTransformer.getFromJson(content);
    }
 catch (    InvalidMetadataException ex) {
      ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_ACCEPTABLE,"String_Node_Str" + ex.getMessage(),ex);
      return;
    }
  }
  if (content.containsField(SchemaChecker.SC_ELEMENT_NAME)) {
    try {
      SchemaChecker.getFromJson(content);
    }
 catch (    InvalidMetadataException ex) {
      ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_NOT_ACCEPTABLE,"String_Node_Str" + ex.getMessage(),ex);
      return;
    }
  }
  ObjectId etag=RequestHelper.getWriteEtag(exchange);
  if (etag == null) {
    ResponseHelper.endExchange(exchange,HttpStatus.SC_CONFLICT);
    return;
  }
  int httpCode=getDatabase().upsertCollection(context.getDBName(),context.getCollectionName(),content,etag,true,true);
  if (context.getWarnings() != null && !context.getWarnings().isEmpty()) {
    sendWarnings(httpCode,exchange,context);
  }
 else {
    exchange.setResponseCode(httpCode);
  }
  exchange.endExchange();
  LocalCachesSingleton.getInstance().invalidateCollection(context.getDBName(),context.getCollectionName());
}