Program: 5076
Project: 5076
Buggy source:
/** 
 * Method to add version in StreamSizeSchedule row key in SchedulerStore.
 * @throws InterruptedException
 * @throws IOException
 * @throws DatasetManagementException
 */
public void upgrade() throws InterruptedException, IOException, DatasetManagementException {
  while (!storeInitialized.get()) {
    TimeUnit.SECONDS.sleep(10);
  }
  if (isUpgradeComplete()) {
    LOG.info("String_Node_Str",NAME);
    return;
  }
  final AtomicInteger maxNumberUpdateRows=new AtomicInteger(1000);
  final AtomicInteger sleepTimeInSecs=new AtomicInteger(60);
  LOG.info("String_Node_Str",NAME);
  while (!isUpgradeComplete()) {
    sleepTimeInSecs.set(60);
    try {
      factory.createExecutor(ImmutableList.of((TransactionAware)table)).execute(new TransactionExecutor.Subroutine(){
        @Override public void apply(){
          if (upgradeVersionKeys(table,maxNumberUpdateRows.get())) {
            table.put(APP_VERSION_UPGRADE_KEY,COLUMN,Bytes.toBytes(ProjectInfo.getVersion().toString()));
          }
        }
      }
);
    }
 catch (    TransactionFailureException e) {
      if (e instanceof TransactionConflictException) {
        LOG.debug("String_Node_Str",e);
        sleepTimeInSecs.set(10);
      }
 else       if (e instanceof TransactionNotInProgressException) {
        int currMaxRows=maxNumberUpdateRows.get();
        if (currMaxRows > 500) {
          maxNumberUpdateRows.decrementAndGet();
        }
 else {
          LOG.warn("String_Node_Str",NAME);
          return;
        }
        sleepTimeInSecs.set(10);
        LOG.debug("String_Node_Str" + "String_Node_Str",maxNumberUpdateRows.get(),e);
      }
 else {
        LOG.error("String_Node_Str",e);
        sleepTimeInSecs.set(60);
      }
    }
    TimeUnit.SECONDS.sleep(sleepTimeInSecs.get());
  }
  LOG.info("String_Node_Str",NAME);
}

Fixed version (ground truth):
/** 
 * Method to add version in StreamSizeSchedule row key in SchedulerStore.
 * @throws InterruptedException
 * @throws IOException
 * @throws DatasetManagementException
 */
public void upgrade() throws InterruptedException, IOException, DatasetManagementException {
  Table metaTable=null;
  while (metaTable == null) {
    try {
      metaTable=tableUtil.getMetaTable();
    }
 catch (    Exception e) {
    }
    TimeUnit.SECONDS.sleep(10);
  }
  if (isUpgradeComplete()) {
    LOG.info("String_Node_Str",NAME);
    return;
  }
  final AtomicInteger maxNumberUpdateRows=new AtomicInteger(1000);
  final AtomicInteger sleepTimeInSecs=new AtomicInteger(60);
  LOG.info("String_Node_Str",NAME);
  while (!isUpgradeComplete()) {
    sleepTimeInSecs.set(60);
    try {
      final Table finalMetaTable=metaTable;
      factory.createExecutor(ImmutableList.of((TransactionAware)finalMetaTable)).execute(new TransactionExecutor.Subroutine(){
        @Override public void apply() throws Exception {
          if (upgradeVersionKeys(finalMetaTable,maxNumberUpdateRows.get())) {
            finalMetaTable.put(APP_VERSION_UPGRADE_KEY,COLUMN,Bytes.toBytes(ProjectInfo.getVersion().toString()));
          }
        }
      }
);
    }
 catch (    TransactionFailureException e) {
      if (e instanceof TransactionConflictException) {
        LOG.debug("String_Node_Str",e);
        sleepTimeInSecs.set(10);
      }
 else       if (e instanceof TransactionNotInProgressException) {
        int currMaxRows=maxNumberUpdateRows.get();
        if (currMaxRows > 500) {
          maxNumberUpdateRows.decrementAndGet();
        }
 else {
          LOG.warn("String_Node_Str",NAME);
          return;
        }
        sleepTimeInSecs.set(10);
        LOG.debug("String_Node_Str" + "String_Node_Str",maxNumberUpdateRows.get(),e);
      }
 else {
        LOG.error("String_Node_Str",e);
        sleepTimeInSecs.set(60);
      }
    }
    TimeUnit.SECONDS.sleep(sleepTimeInSecs.get());
  }
  LOG.info("String_Node_Str",NAME);
}