Program: 4892
Project: 4892
Buggy source:
private Map<TableId,Future<?>> upgradeQueues(final NamespaceMeta namespaceMeta,ExecutorService executor) throws Exception {
  try (HBaseAdmin admin=new HBaseAdmin(hConf)){
    String hbaseNamespace=tableUtil.getHBaseNamespace(namespaceMeta);
    List<TableId> tableIds=tableUtil.listTablesInNamespace(admin,hbaseNamespace);
    List<TableId> stateStoreTableIds=Lists.newArrayList();
    Map<TableId,Future<?>> futures=new HashMap<>();
    for (    final TableId tableId : tableIds) {
      if (isDataTable(tableId)) {
        Runnable runnable=new Runnable(){
          public void run(){
            try {
              LOG.info("String_Node_Str",tableId);
              Properties properties=new Properties();
              HTableDescriptor desc=tableUtil.getHTableDescriptor(admin,tableId);
              if (desc.getValue(HBaseQueueAdmin.PROPERTY_PREFIX_BYTES) == null) {
                properties.setProperty(HBaseQueueAdmin.PROPERTY_PREFIX_BYTES,Integer.toString(SaltedHBaseQueueStrategy.SALT_BYTES));
              }
              upgrade(tableId,properties);
              LOG.info("String_Node_Str",tableId);
            }
 catch (            Exception e) {
              throw new RuntimeException(e);
            }
          }
        }
;
        Future<?> future=executor.submit(runnable);
        futures.put(tableId,future);
      }
 else       if (isStateStoreTable(tableId)) {
        stateStoreTableIds.add(tableId);
      }
    }
    for (    final TableId tableId : stateStoreTableIds) {
      Runnable runnable=new Runnable(){
        public void run(){
          try {
            LOG.info("String_Node_Str",tableId);
            DatasetId stateStoreId=createStateStoreDataset(namespaceMeta.getName());
            DatasetAdmin datasetAdmin=datasetFramework.getAdmin(stateStoreId,null);
            if (datasetAdmin == null) {
              LOG.error("String_Node_Str",stateStoreId);
              return;
            }
            datasetAdmin.upgrade();
            LOG.info("String_Node_Str",tableId);
          }
 catch (          Exception e) {
            new RuntimeException(e);
          }
        }
      }
;
      Future<?> future=executor.submit(runnable);
      futures.put(tableId,future);
    }
    return futures;
  }
 }

Fixed version (ground truth):
private Map<TableId,Future<?>> upgradeQueues(final NamespaceMeta namespaceMeta,ExecutorService executor,final HBaseAdmin admin) throws Exception {
  String hbaseNamespace=tableUtil.getHBaseNamespace(namespaceMeta);
  List<TableId> tableIds=tableUtil.listTablesInNamespace(admin,hbaseNamespace);
  List<TableId> stateStoreTableIds=Lists.newArrayList();
  Map<TableId,Future<?>> futures=new HashMap<>();
  for (  final TableId tableId : tableIds) {
    if (isDataTable(tableId)) {
      Callable<Void> callable=new Callable<Void>(){
        public Void call() throws Exception {
          LOG.info("String_Node_Str",tableId);
          Properties properties=new Properties();
          HTableDescriptor desc=tableUtil.getHTableDescriptor(admin,tableId);
          if (desc.getValue(HBaseQueueAdmin.PROPERTY_PREFIX_BYTES) == null) {
            properties.setProperty(HBaseQueueAdmin.PROPERTY_PREFIX_BYTES,Integer.toString(SaltedHBaseQueueStrategy.SALT_BYTES));
          }
          upgrade(tableId,properties);
          LOG.info("String_Node_Str",tableId);
          return null;
        }
      }
;
      Future<?> future=executor.submit(ImpersonationUtils.createImpersonatingCallable(impersonator,namespaceMeta,callable));
      futures.put(tableId,future);
    }
 else     if (isStateStoreTable(tableId)) {
      stateStoreTableIds.add(tableId);
    }
  }
  for (  final TableId tableId : stateStoreTableIds) {
    Callable<Void> callable=new Callable<Void>(){
      public Void call() throws Exception {
        LOG.info("String_Node_Str",tableId);
        DatasetId stateStoreId=createStateStoreDataset(namespaceMeta.getName());
        DatasetAdmin datasetAdmin=datasetFramework.getAdmin(stateStoreId,null);
        if (datasetAdmin == null) {
          LOG.error("String_Node_Str",stateStoreId);
          return null;
        }
        datasetAdmin.upgrade();
        LOG.info("String_Node_Str",tableId);
        return null;
      }
    }
;
    Future<?> future=executor.submit(ImpersonationUtils.createImpersonatingCallable(impersonator,namespaceMeta,callable));
    futures.put(tableId,future);
  }
  return futures;
}