Program: 93492
Project: 93492
Buggy source:
/** 
 * @param exchange
 * @param context
 * @throws Exception
 */
@Override public void handleRequest(HttpServerExchange exchange,RequestContext context) throws Exception {
  DBCollection coll=getDatabase().getCollection(context.getDBName(),context.getCollectionName());
  long size=-1;
  if (context.isCount()) {
    size=getDatabase().getCollectionSize(coll,exchange.getQueryParameters().get("String_Node_Str"));
  }
  ArrayList<DBObject> data=null;
  if (context.getPagesize() > 0 && (context.getHalMode() == HAL_MODE.F || context.getHalMode() == HAL_MODE.FULL)) {
    try {
      data=getDatabase().getCollectionData(coll,context.getPage(),context.getPagesize(),context.getSortBy(),context.getFilter(),context.getKeys(),context.getCursorAllocationPolicy());
    }
 catch (    JSONParseException jpe) {
      LOGGER.debug("String_Node_Str",context.getFilter(),jpe);
      ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_BAD_REQUEST,"String_Node_Str",jpe);
      return;
    }
catch (    MongoException me) {
      if (me.getMessage().matches("String_Node_Str")) {
        LOGGER.debug("String_Node_Str",context.getFilter(),me);
        ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_BAD_REQUEST,"String_Node_Str",me);
        return;
      }
 else {
        throw me;
      }
    }
  }
  if (exchange.isComplete()) {
    return;
  }
  if ((context.getPagesize() > 0 && (data == null || data.isEmpty())) && (context.getCollectionProps() == null || context.getCollectionProps().keySet().isEmpty())) {
    ResponseHelper.endExchange(exchange,HttpStatus.SC_NOT_FOUND);
    return;
  }
  try {
    CollectionRepresentationFactory crp=new CollectionRepresentationFactory();
    Representation rep=crp.getRepresentation(exchange,context,data,size);
    exchange.setResponseCode(HttpStatus.SC_OK);
    if (getNext() != null) {
      DBObject responseContent=rep.asDBObject();
      context.setResponseContent(responseContent);
      getNext().handleRequest(exchange,context);
    }
    crp.sendRepresentation(exchange,context,rep);
    exchange.endExchange();
  }
 catch (  IllegalQueryParamenterException ex) {
    ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_BAD_REQUEST,ex.getMessage(),ex);
  }
}

Fixed version (ground truth):
/** 
 * @param exchange
 * @param context
 * @throws Exception
 */
@Override public void handleRequest(HttpServerExchange exchange,RequestContext context) throws Exception {
  DBCollection coll=getDatabase().getCollection(context.getDBName(),context.getCollectionName());
  long size=-1;
  if (context.isCount()) {
    size=getDatabase().getCollectionSize(coll,exchange.getQueryParameters().get("String_Node_Str"));
  }
  ArrayList<DBObject> data=null;
  if (context.getPagesize() > 0) {
    try {
      data=getDatabase().getCollectionData(coll,context.getPage(),context.getPagesize(),context.getSortBy(),context.getFilter(),context.getKeys(),context.getCursorAllocationPolicy());
    }
 catch (    JSONParseException jpe) {
      LOGGER.debug("String_Node_Str",context.getFilter(),jpe);
      ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_BAD_REQUEST,"String_Node_Str",jpe);
      return;
    }
catch (    MongoException me) {
      if (me.getMessage().matches("String_Node_Str")) {
        LOGGER.debug("String_Node_Str",context.getFilter(),me);
        ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_BAD_REQUEST,"String_Node_Str",me);
        return;
      }
 else {
        throw me;
      }
    }
  }
  if (exchange.isComplete()) {
    return;
  }
  if ((context.getPagesize() > 0 && (data == null || data.isEmpty())) && (context.getCollectionProps() == null || context.getCollectionProps().keySet().isEmpty())) {
    ResponseHelper.endExchange(exchange,HttpStatus.SC_NOT_FOUND);
    return;
  }
  try {
    CollectionRepresentationFactory crp=new CollectionRepresentationFactory();
    Representation rep=crp.getRepresentation(exchange,context,data,size);
    exchange.setResponseCode(HttpStatus.SC_OK);
    if (getNext() != null) {
      DBObject responseContent=rep.asDBObject();
      context.setResponseContent(responseContent);
      getNext().handleRequest(exchange,context);
    }
    crp.sendRepresentation(exchange,context,rep);
    exchange.endExchange();
  }
 catch (  IllegalQueryParamenterException ex) {
    ResponseHelper.endExchangeWithMessage(exchange,HttpStatus.SC_BAD_REQUEST,ex.getMessage(),ex);
  }
}