Program: 93673
Project: 93673
Buggy source:
static public void sendCollection(HttpServerExchange exchange,RequestContext context,List<DBObject> embeddedData,long size) throws IllegalQueryParamenterException {
  String requestPath=URLUtilis.removeTrailingSlashes(URLUtilis.getRequestPath(exchange));
  Representation rep=new Representation(requestPath);
  if (context.getType() == RequestContext.TYPE.COLLECTION) {
    DBObject collProps=context.getCollectionProps();
    if (collProps != null) {
      addData(rep,collProps);
    }
 else {
      DBObject dbProps=context.getDbProps();
      if (dbProps != null) {
        addData(rep,dbProps);
      }
    }
  }
  if (size > 0) {
    float _size=size + 0f;
    float _pagesize=context.getPagesize() + 0f;
    rep.addProperty("String_Node_Str",size);
    rep.addProperty("String_Node_Str",Math.max(1,Math.round(Math.nextUp(_size / _pagesize))));
  }
  if (embeddedData != null) {
    long count=embeddedData.stream().filter((props) -> props.keySet().stream().anyMatch((k) -> k.equals("String_Node_Str") || k.equals("String_Node_Str"))).count();
    rep.addProperty("String_Node_Str","String_Node_Str" + count);
    if (!embeddedData.isEmpty()) {
      for (      DBObject d : embeddedData) {
        Object _id=d.get("String_Node_Str");
        if (_id != null && (_id instanceof String || _id instanceof ObjectId)) {
          Representation nrep=DocumentRepresentationFactory.getDocument(requestPath + "String_Node_Str" + _id.toString(),exchange,context,d);
          rep.addRepresentation("String_Node_Str",nrep);
        }
 else {
          logger.error("String_Node_Str",d);
        }
      }
    }
  }
  if (context.getType() != RequestContext.TYPE.COLLECTION_INDEXES) {
    TreeMap<String,String> links;
    links=getPaginationLinks(exchange,context,size);
    if (links != null) {
      for (      String k : links.keySet()) {
        rep.addLink(new Link(k,links.get(k)));
      }
    }
  }
  if (context.getType() == RequestContext.TYPE.COLLECTION) {
    rep.addLink(new Link("String_Node_Str",URLUtilis.removeTrailingSlashes(URLUtilis.getRequestPath(exchange)) + "String_Node_Str"));
  }
  exchange.getResponseHeaders().put(Headers.CONTENT_TYPE,HAL_JSON_MEDIA_TYPE);
  exchange.getResponseSender().send(rep.toString());
}

Fixed version (ground truth):
static public void sendCollection(HttpServerExchange exchange,RequestContext context,List<DBObject> embeddedData,long size) throws IllegalQueryParamenterException {
  String requestPath=URLUtilis.removeTrailingSlashes(URLUtilis.getRequestPath(exchange));
  String queryString=(exchange.getQueryString() == null || exchange.getQueryString().isEmpty()) ? "String_Node_Str" : "String_Node_Str" + exchange.getQueryString();
  Representation rep=new Representation(requestPath + queryString);
  if (context.getType() == RequestContext.TYPE.COLLECTION) {
    DBObject collProps=context.getCollectionProps();
    if (collProps != null) {
      addData(rep,collProps);
    }
 else {
      DBObject dbProps=context.getDbProps();
      if (dbProps != null) {
        addData(rep,dbProps);
      }
    }
  }
  if (size > 0) {
    float _size=size + 0f;
    float _pagesize=context.getPagesize() + 0f;
    rep.addProperty("String_Node_Str",size);
    rep.addProperty("String_Node_Str",Math.max(1,Math.round(Math.nextUp(_size / _pagesize))));
  }
  if (embeddedData != null) {
    long count=embeddedData.stream().filter((props) -> props.keySet().stream().anyMatch((k) -> k.equals("String_Node_Str") || k.equals("String_Node_Str"))).count();
    rep.addProperty("String_Node_Str","String_Node_Str" + count);
    if (!embeddedData.isEmpty()) {
      for (      DBObject d : embeddedData) {
        Object _id=d.get("String_Node_Str");
        if (_id != null && (_id instanceof String || _id instanceof ObjectId)) {
          Representation nrep=DocumentRepresentationFactory.getDocument(requestPath + "String_Node_Str" + _id.toString(),exchange,context,d);
          rep.addRepresentation("String_Node_Str",nrep);
        }
 else {
          logger.error("String_Node_Str",d);
        }
      }
    }
  }
  if (context.getType() != RequestContext.TYPE.COLLECTION_INDEXES) {
    TreeMap<String,String> links;
    links=getPaginationLinks(exchange,context,size);
    if (links != null) {
      links.keySet().stream().forEach((k) -> {
        rep.addLink(new Link(k,links.get(k)));
      }
);
    }
  }
  if (context.getType() == RequestContext.TYPE.COLLECTION) {
    rep.addLink(new Link("String_Node_Str",URLUtilis.removeTrailingSlashes(URLUtilis.getRequestPath(exchange)) + "String_Node_Str"));
  }
  exchange.getResponseHeaders().put(Headers.CONTENT_TYPE,HAL_JSON_MEDIA_TYPE);
  exchange.getResponseSender().send(rep.toString());
}