Program: 4566
Project: 4566
Buggy source:
/** 
 * Sets up a   {@link DatasetFramework} instance for standalone usage.  NOTE: should NOT be used by applications!!!Note: includeNewDatasets boolean is required because upgrade tool has two mode: 1. Normal CDAP upgrade and 2. Upgrading co processor for tables after hbase upgrade. This parameter specifies whether new system dataset which were added in the current release needs to be added in the dataset framework or not. During Normal CDAP upgrade (1) we don't need these datasets to be added in the ds framework as they will get created during upgrade rather than when cdap starts after upgrade which is what we want. Whereas during Hbase upgrade (2) we want these new tables to be added so that the co processor of these tables can be upgraded when the user runs CDAP's Hbase Upgrade after upgrading to a newer version of Hbase.
 */
private void initializeDSFramework(CConfiguration cConf,DatasetFramework datasetFramework,boolean includeNewDatasets) throws IOException, DatasetManagementException {
  DatasetMetaTableUtil.setupDatasets(datasetFramework);
  ArtifactStore.setupDatasets(datasetFramework);
  if (includeNewDatasets) {
    DefaultOwnerStore.setupDatasets(datasetFramework);
  }
  DefaultMetadataStore.setupDatasets(datasetFramework);
  LineageDataset.setupDatasets(datasetFramework);
  DefaultStore.setupDatasets(datasetFramework);
  DefaultConfigStore.setupDatasets(datasetFramework);
  LoggingStoreTableUtil.setupDatasets(datasetFramework);
  ScheduleStoreTableUtil.setupDatasets(datasetFramework);
  DefaultMetricDatasetFactory factory=new DefaultMetricDatasetFactory(cConf,datasetFramework);
  DefaultMetricDatasetFactory.setupDatasets(factory);
  UsageDataset.setupDatasets(datasetFramework);
}

Fixed version (ground truth):
/** 
 * Sets up a   {@link DatasetFramework} instance for standalone usage.  NOTE: should NOT be used by applications!!!Note: includeNewDatasets boolean is required because upgrade tool has two mode: 1. Normal CDAP upgrade and 2. Upgrading co processor for tables after hbase upgrade. This parameter specifies whether new system dataset which were added in the current release needs to be added in the dataset framework or not. During Normal CDAP upgrade (1) we don't need these datasets to be added in the ds framework as they will get created during upgrade rather than when cdap starts after upgrade which is what we want. Whereas during Hbase upgrade (2) we want these new tables to be added so that the co processor of these tables can be upgraded when the user runs CDAP's Hbase Upgrade after upgrading to a newer version of Hbase.
 */
private void initializeDSFramework(CConfiguration cConf,DatasetFramework datasetFramework,boolean includeNewDatasets) throws IOException, DatasetManagementException {
  DatasetMetaTableUtil.setupDatasets(datasetFramework);
  ArtifactStore.setupDatasets(datasetFramework);
  if (includeNewDatasets) {
  }
  DefaultOwnerStore.setupDatasets(datasetFramework);
  DefaultMetadataStore.setupDatasets(datasetFramework);
  LineageDataset.setupDatasets(datasetFramework);
  DefaultStore.setupDatasets(datasetFramework);
  DefaultConfigStore.setupDatasets(datasetFramework);
  LoggingStoreTableUtil.setupDatasets(datasetFramework);
  ScheduleStoreTableUtil.setupDatasets(datasetFramework);
  DefaultMetricDatasetFactory factory=new DefaultMetricDatasetFactory(cConf,datasetFramework);
  DefaultMetricDatasetFactory.setupDatasets(factory);
  UsageDataset.setupDatasets(datasetFramework);
}