Program: 7175
Project: 7175
Buggy source:
/** 
 * Upgrades the   {@link DatasetTypeMDS} table for namespacesNote: We don't write to new TypeMDS table through  {@link DatasetTypeManager} because if the user's custom Datasetshas api/classes changes  {@link DatasetTypeManager#addModule} will fail. So, we directly move the meta typeinformation. User's custom datasets which don't use any such changed api/classes will work out of the box but the one which does will need to be re-deployed.
 * @throws TransactionFailureException
 * @throws InterruptedException
 * @throws IOException
 */
public void upgrade() throws Exception {
  DatasetTypeMDS oldMds=getOldDatasetTypeMDS();
  if (oldMds != null) {
    setupDatasetTypeMDS(oldMds);
    final MDSKey dsModulePrefix=new MDSKey(Bytes.toBytes(DatasetTypeMDS.MODULES_PREFIX));
    try {
      datasetTypeMDS.execute(new TransactionExecutor.Function<UpgradeMDSStores<DatasetTypeMDS>,Void>(){
        @Override public Void apply(        UpgradeMDSStores<DatasetTypeMDS> ctx) throws Exception {
          List<DatasetModuleMeta> mdsKeyDatasetModuleMetaMap=ctx.getOldMds().list(dsModulePrefix,DatasetModuleMeta.class);
          for (          DatasetModuleMeta datasetModuleMeta : mdsKeyDatasetModuleMetaMap) {
            if (!REMOVED_DATASET_MODULES.contains(datasetModuleMeta.getClassName())) {
              upgradeDatasetModuleMeta(datasetModuleMeta,ctx.getNewMds());
            }
          }
          return null;
        }
      }
);
    }
 catch (    Exception e) {
      throw e;
    }
    tableUtil.dropTable(new HBaseAdmin(hConf),TableId.from(oldDatasetId.getNamespaceId(),oldDatasetId.getId()));
  }
 else {
    LOG.info("String_Node_Str",oldDatasetId.getId());
  }
}

Fixed version (ground truth):
/** 
 * Upgrades the   {@link DatasetTypeMDS} table for namespacesNote: We don't write to new TypeMDS table through  {@link DatasetTypeManager} because if the user's custom Datasetshas api/classes changes  {@link DatasetTypeManager#addModule} will fail. So, we directly move the meta typeinformation. User's custom datasets which don't use any such changed api/classes will work out of the box but the one which does will need to be re-deployed.
 * @throws TransactionFailureException
 * @throws InterruptedException
 * @throws IOException
 */
public void upgrade() throws Exception {
  DatasetTypeMDS oldMds=getOldDatasetTypeMDS();
  if (oldMds != null) {
    setupDatasetTypeMDS(oldMds);
    final MDSKey dsModulePrefix=new MDSKey(Bytes.toBytes(DatasetTypeMDS.MODULES_PREFIX));
    try {
      datasetTypeMDS.execute(new TransactionExecutor.Function<UpgradeMDSStores<DatasetTypeMDS>,Void>(){
        @Override public Void apply(        UpgradeMDSStores<DatasetTypeMDS> ctx) throws Exception {
          List<DatasetModuleMeta> mdsKeyDatasetModuleMetaMap=ctx.getOldMds().list(dsModulePrefix,DatasetModuleMeta.class);
          for (          DatasetModuleMeta datasetModuleMeta : mdsKeyDatasetModuleMetaMap) {
            if (!REMOVED_DATASET_MODULES.contains(datasetModuleMeta.getClassName())) {
              upgradeDatasetModuleMeta(datasetModuleMeta,ctx.getNewMds());
            }
          }
          return null;
        }
      }
);
    }
 catch (    Exception e) {
      throw e;
    }
  }
 else {
    LOG.info("String_Node_Str",oldDatasetId.getId());
  }
}