Program: 61674
Project: 61674
Buggy source:
@Override public SortedSet<ContentKey> query(DirectionQuery query){
  int ttlMinutes=HubProperties.getSpokeTtlMinutes();
  DateTime spokeTtlTime=TimeUtil.BIG_BANG;
  if (HubProperties.getProperty("String_Node_Str",true)) {
    spokeTtlTime=query.getChannelStable().minusMinutes(ttlMinutes);
    if (query.getChannelConfig().isLive()) {
      if (query.getStartKey().getTime().isBefore(spokeTtlTime)) {
        query=query.withStartKey(new ContentKey(spokeTtlTime,"String_Node_Str"));
      }
    }
 else {
      spokeTtlTime=query.getChannelStable().minusMinutes(ttlMinutes * 2);
    }
  }
  ActiveTraces.getLocal().add("String_Node_Str",query,spokeTtlTime);
  SortedSet<ContentKey> contentKeys=Collections.emptySortedSet();
  if (query.isNext()) {
    try {
      contentKeys=spokeStore.getNext(query.getChannelName(),query.getCount(),query.getStartKey());
    }
 catch (    InterruptedException e) {
      logger.warn("String_Node_Str" + query,e);
    }
  }
 else {
    ContentKey startKey=query.getStartKey();
    DateTime startTime=startKey.getTime();
    contentKeys=new TreeSet<>();
    while (contentKeys.size() < query.getCount() && startTime.isAfter(spokeTtlTime.minusHours(1)) && startTime.isBefore(query.getChannelStable().plusHours(1))) {
      TimeQuery timeQuery=query.convert(TimeUtil.Unit.HOURS).startTime(startTime).build();
      SortedSet<ContentKey> queryByTime=queryByTime(timeQuery);
      queryByTime.addAll(contentKeys);
      Set<ContentKey> filtered=ContentKeyUtil.filter(queryByTime,query);
      contentKeys.addAll(filtered);
      startTime=startTime.minusHours(1);
    }
  }
  ActiveTraces.getLocal().add("String_Node_Str",contentKeys);
  return contentKeys;
}

Fixed version (ground truth):
@Override public SortedSet<ContentKey> query(DirectionQuery query){
  int ttlMinutes=HubProperties.getSpokeTtlMinutes();
  DateTime spokeTtlTime=TimeUtil.BIG_BANG;
  if (HubProperties.getProperty("String_Node_Str",true)) {
    spokeTtlTime=query.getChannelStable().minusMinutes(ttlMinutes);
    if (query.getChannelConfig().isLive()) {
      if (query.getStartKey().getTime().isBefore(spokeTtlTime)) {
        query=query.withStartKey(new ContentKey(spokeTtlTime,"String_Node_Str"));
      }
    }
 else {
      spokeTtlTime=query.getChannelStable().minusMinutes(ttlMinutes * 2);
    }
  }
  ActiveTraces.getLocal().add("String_Node_Str",query,spokeTtlTime);
  SortedSet<ContentKey> contentKeys=Collections.emptySortedSet();
  if (query.isNext()) {
    try {
      contentKeys=spokeStore.getNext(query.getChannelName(),query.getCount(),query.getStartKey().toUrl());
    }
 catch (    InterruptedException e) {
      logger.warn("String_Node_Str" + query,e);
    }
  }
 else {
    ContentKey startKey=query.getStartKey();
    DateTime startTime=startKey.getTime();
    contentKeys=new TreeSet<>();
    while (contentKeys.size() < query.getCount() && startTime.isAfter(spokeTtlTime.minusHours(1)) && startTime.isBefore(query.getChannelStable().plusHours(1))) {
      TimeQuery timeQuery=query.convert(TimeUtil.Unit.HOURS).startTime(startTime).build();
      SortedSet<ContentKey> queryByTime=queryByTime(timeQuery);
      queryByTime.addAll(contentKeys);
      Set<ContentKey> filtered=ContentKeyUtil.filter(queryByTime,query);
      contentKeys.addAll(filtered);
      startTime=startTime.minusHours(1);
    }
  }
  ActiveTraces.getLocal().add("String_Node_Str",contentKeys);
  return contentKeys;
}