Program: 8020
Project: 8020
Buggy source:
private long getMinGroupEvictEntry(QueueConsumer consumer,ReadPointer readPointer) throws OperationException {
  final byte[][] rowKeys=new byte[consumer.getGroupSize()][];
  for (int consumerId=0; consumerId < consumer.getGroupSize(); ++consumerId) {
    rowKeys[consumerId]=makeRowKey(CONSUMER_META_PREFIX,consumer.getGroupId(),consumerId);
  }
  OperationResult<Map<byte[],Map<byte[],byte[]>>> stateBytes=table.get(rowKeys,new byte[][]{CONSUMER_READ_POINTER},readPointer);
  if (stateBytes.isEmpty()) {
    if (LOG.isTraceEnabled()) {
      logTrace(String.format("String_Node_Str",consumer.getGroupId()));
    }
    return INVALID_ENTRY_ID;
  }
  long minGroupEvictEntry=FIRST_QUEUE_ENTRY_ID - 1;
  for (int consumerId=0; consumerId < consumer.getGroupSize(); ++consumerId) {
    Map<byte[],byte[]> readPointerMap=stateBytes.getValue().get(makeRowKey(CONSUMER_META_PREFIX,consumer.getGroupId(),consumerId));
    if (readPointer == null) {
      if (LOG.isTraceEnabled()) {
        logTrace(String.format("String_Node_Str",consumerId,consumer.getGroupId()));
        return INVALID_ENTRY_ID;
      }
    }
    byte[] evictEntryBytes=readPointerMap.get(CONSUMER_READ_POINTER);
    if (evictEntryBytes == null) {
      if (LOG.isTraceEnabled()) {
        logTrace(String.format("String_Node_Str",consumerId,consumer.getGroupId()));
        return INVALID_ENTRY_ID;
      }
    }
    long evictEntry=Bytes.toLong(evictEntryBytes) - 1;
    if (minGroupEvictEntry > evictEntry) {
      minGroupEvictEntry=evictEntry;
    }
  }
  return minGroupEvictEntry;
}

Fixed version (ground truth):
private long getMinGroupEvictEntry(QueueConsumer consumer,ReadPointer readPointer) throws OperationException {
  final byte[][] rowKeys=new byte[consumer.getGroupSize()][];
  for (int consumerId=0; consumerId < consumer.getGroupSize(); ++consumerId) {
    rowKeys[consumerId]=makeRowKey(CONSUMER_META_PREFIX,consumer.getGroupId(),consumerId);
  }
  OperationResult<Map<byte[],Map<byte[],byte[]>>> stateBytes=table.get(rowKeys,new byte[][]{CONSUMER_READ_POINTER,ACTIVE_ENTRY},readPointer);
  if (stateBytes.isEmpty()) {
    if (LOG.isTraceEnabled()) {
      logTrace(String.format("String_Node_Str",consumer.getGroupId()));
    }
    return INVALID_ENTRY_ID;
  }
  long minGroupEvictEntry=Long.MAX_VALUE;
  for (int consumerId=0; consumerId < consumer.getGroupSize(); ++consumerId) {
    Map<byte[],byte[]> readPointerMap=stateBytes.getValue().get(makeRowKey(CONSUMER_META_PREFIX,consumer.getGroupId(),consumerId));
    if (readPointerMap == null) {
      if (LOG.isTraceEnabled()) {
        logTrace(String.format("String_Node_Str",consumerId,consumer.getGroupId()));
      }
      return INVALID_ENTRY_ID;
    }
    final byte[] activeEntryBytes=readPointerMap.get(ACTIVE_ENTRY);
    if (activeEntryBytes == null) {
      if (LOG.isTraceEnabled()) {
        logTrace(String.format("String_Node_Str",consumerId,consumer.getGroupId()));
      }
      return INVALID_ENTRY_ID;
    }
    long evictEntry;
    final long activeEntry=Bytes.toLong(activeEntryBytes);
    if (activeEntry != INVALID_ENTRY_ID) {
      evictEntry=activeEntry - 1;
    }
 else {
      byte[] consumerReadPointerBytes=readPointerMap.get(CONSUMER_READ_POINTER);
      if (consumerReadPointerBytes == null) {
        if (LOG.isTraceEnabled()) {
          logTrace(String.format("String_Node_Str",consumerId,consumer.getGroupId()));
        }
        return INVALID_ENTRY_ID;
      }
      evictEntry=Bytes.toLong(consumerReadPointerBytes) - 1;
    }
    if (minGroupEvictEntry > evictEntry) {
      minGroupEvictEntry=evictEntry;
    }
  }
  return minGroupEvictEntry == Long.MAX_VALUE ? INVALID_ENTRY_ID : minGroupEvictEntry;
}