nus-yam/ex-repair huggingface dataset:
Program: 7163
Project: 7163
Buggy source:
@Test public void testCleanupGeneration() throws Exception {
  String streamName="String_Node_Str";
  Id.Stream streamId=Id.Stream.from(Constants.DEFAULT_NAMESPACE,streamName);
  StreamAdmin streamAdmin=getStreamAdmin();
  streamAdmin.create(streamId);
  StreamConfig streamConfig=streamAdmin.getConfig(streamId);
  StreamFileJanitor janitor=new StreamFileJanitor(getCConfiguration(),getStreamAdmin(),getLocationFactory());
  for (int i=0; i < 5; i++) {
    FileWriter<StreamEvent> writer=createWriter(streamId);
    writer.append(StreamFileTestUtils.createEvent(System.currentTimeMillis(),"String_Node_Str"));
    writer.close();
    janitor.clean(streamConfig,System.currentTimeMillis());
    verifyGeneration(streamConfig,i);
    streamAdmin.truncate(streamId);
  }
  int generation=StreamUtils.getGeneration(streamConfig);
  Assert.assertEquals(5,generation);
  janitor.clean(streamConfig,System.currentTimeMillis());
  for (  Location location : streamConfig.getLocation().list()) {
    if (location.isDirectory()) {
      Assert.assertEquals(generation,Integer.parseInt(location.getName()));
    }
  }
}

Fixed version (ground truth):
@Test public void testCleanupGeneration() throws Exception {
  String streamName="String_Node_Str";
  Id.Stream streamId=Id.Stream.from(Constants.DEFAULT_NAMESPACE,streamName);
  StreamAdmin streamAdmin=getStreamAdmin();
  streamAdmin.create(streamId);
  StreamConfig streamConfig=streamAdmin.getConfig(streamId);
  StreamFileJanitor janitor=new StreamFileJanitor(getCConfiguration(),getStreamAdmin(),getLocationFactory());
  for (int i=0; i < 5; i++) {
    FileWriter<StreamEvent> writer=createWriter(streamId);
    writer.append(StreamFileTestUtils.createEvent(System.currentTimeMillis(),"String_Node_Str"));
    writer.close();
    janitor.clean(streamConfig.getLocation(),streamConfig.getTTL(),System.currentTimeMillis());
    verifyGeneration(streamConfig,i);
    streamAdmin.truncate(streamId);
  }
  int generation=StreamUtils.getGeneration(streamConfig);
  Assert.assertEquals(5,generation);
  janitor.clean(streamConfig.getLocation(),streamConfig.getTTL(),System.currentTimeMillis());
  for (  Location location : streamConfig.getLocation().list()) {
    if (location.isDirectory()) {
      Assert.assertEquals(generation,Integer.parseInt(location.getName()));
    }
  }
}
Program: 7164
Project: 7164
Buggy source:
@Test public void testCleanupTTL() throws Exception {
  String streamName="String_Node_Str";
  Id.Stream streamId=Id.Stream.from(Constants.DEFAULT_NAMESPACE,streamName);
  StreamAdmin streamAdmin=getStreamAdmin();
  StreamFileJanitor janitor=new StreamFileJanitor(getCConfiguration(),getStreamAdmin(),getLocationFactory());
  Properties properties=new Properties();
  properties.setProperty(Constants.Stream.PARTITION_DURATION,"String_Node_Str");
  properties.setProperty(Constants.Stream.TTL,"String_Node_Str");
  streamAdmin.create(streamId,properties);
  streamAdmin.truncate(streamId);
  StreamConfig config=streamAdmin.getConfig(streamId);
  FileWriter<StreamEvent> writer=createWriter(streamId);
  for (int i=0; i < 10; i++) {
    writer.append(StreamFileTestUtils.createEvent(i * 1000,"String_Node_Str" + i));
  }
  writer.close();
  Location generationLocation=StreamUtils.createGenerationLocation(config.getLocation(),1);
  Assert.assertEquals(5,generationLocation.list().size());
  janitor.clean(config,10000);
  Assert.assertEquals(3,generationLocation.list().size());
  janitor.clean(config,16000);
  Assert.assertTrue(generationLocation.list().isEmpty());
}

Fixed version (ground truth):
@Test public void testCleanupTTL() throws Exception {
  String streamName="String_Node_Str";
  Id.Stream streamId=Id.Stream.from(Constants.DEFAULT_NAMESPACE,streamName);
  StreamAdmin streamAdmin=getStreamAdmin();
  StreamFileJanitor janitor=new StreamFileJanitor(getCConfiguration(),getStreamAdmin(),getLocationFactory());
  Properties properties=new Properties();
  properties.setProperty(Constants.Stream.PARTITION_DURATION,"String_Node_Str");
  properties.setProperty(Constants.Stream.TTL,"String_Node_Str");
  streamAdmin.create(streamId,properties);
  streamAdmin.truncate(streamId);
  StreamConfig config=streamAdmin.getConfig(streamId);
  FileWriter<StreamEvent> writer=createWriter(streamId);
  for (int i=0; i < 10; i++) {
    writer.append(StreamFileTestUtils.createEvent(i * 1000,"String_Node_Str" + i));
  }
  writer.close();
  Location generationLocation=StreamUtils.createGenerationLocation(config.getLocation(),1);
  Assert.assertEquals(5,generationLocation.list().size());
  janitor.clean(config.getLocation(),config.getTTL(),10000);
  Assert.assertEquals(3,generationLocation.list().size());
  janitor.clean(config.getLocation(),config.getTTL(),16000);
  Assert.assertTrue(generationLocation.list().isEmpty());
}
Program: 7165
Project: 7165
Buggy source:
@Test public void testFetchSize() throws Exception {
  final String streamName="String_Node_Str";
  Id.Stream streamId=Id.Stream.from(Constants.DEFAULT_NAMESPACE,streamName);
  final int nbEvents=100;
  StreamAdmin streamAdmin=new TestStreamAdmin(locationFactory,Long.MAX_VALUE,1000);
  streamAdmin.create(streamId);
  StreamConfig config=streamAdmin.getConfig(streamId);
  try {
    StreamUtils.fetchStreamFilesSize(config);
    Assert.fail("String_Node_Str");
  }
 catch (  IOException e) {
  }
  Location partitionLocation=StreamUtils.createPartitionLocation(config.getLocation(),0,Long.MAX_VALUE);
  Location dataLocation=StreamUtils.createStreamLocation(partitionLocation,"String_Node_Str",0,StreamFileType.EVENT);
  Location idxLocation=StreamUtils.createStreamLocation(partitionLocation,"String_Node_Str",0,StreamFileType.INDEX);
  StreamDataFileWriter writer=new StreamDataFileWriter(Locations.newOutputSupplier(dataLocation),Locations.newOutputSupplier(idxLocation),10000L);
  for (int i=0; i < nbEvents; i++) {
    writer.append(StreamFileTestUtils.createEvent(i,"String_Node_Str"));
  }
  writer.close();
  long size=streamAdmin.fetchStreamSize(config);
  Assert.assertTrue(size > 0);
  Assert.assertEquals(dataLocation.length(),size);
}

Fixed version (ground truth):
@Test public void testFetchSize() throws Exception {
  final String streamName="String_Node_Str";
  Id.Stream streamId=Id.Stream.from(Constants.DEFAULT_NAMESPACE,streamName);
  final int nbEvents=100;
  StreamAdmin streamAdmin=new TestStreamAdmin(locationFactory,Long.MAX_VALUE,1000);
  streamAdmin.create(streamId);
  StreamConfig config=streamAdmin.getConfig(streamId);
  try {
    StreamUtils.fetchStreamFilesSize(StreamUtils.createGenerationLocation(config.getLocation(),StreamUtils.getGeneration(config)));
    Assert.fail("String_Node_Str");
  }
 catch (  IOException e) {
  }
  Location partitionLocation=StreamUtils.createPartitionLocation(config.getLocation(),0,Long.MAX_VALUE);
  Location dataLocation=StreamUtils.createStreamLocation(partitionLocation,"String_Node_Str",0,StreamFileType.EVENT);
  Location idxLocation=StreamUtils.createStreamLocation(partitionLocation,"String_Node_Str",0,StreamFileType.INDEX);
  StreamDataFileWriter writer=new StreamDataFileWriter(Locations.newOutputSupplier(dataLocation),Locations.newOutputSupplier(idxLocation),10000L);
  for (int i=0; i < nbEvents; i++) {
    writer.append(StreamFileTestUtils.createEvent(i,"String_Node_Str"));
  }
  writer.close();
  long size=StreamUtils.fetchStreamFilesSize(StreamUtils.createGenerationLocation(config.getLocation(),StreamUtils.getGeneration(config)));
  Assert.assertTrue(size > 0);
  Assert.assertEquals(dataLocation.length(),size);
}
Program: 7166
Project: 7166
Buggy source:
@Test public void testDropAllInNamespace() throws Exception {
  StreamAdmin streamAdmin=getStreamAdmin();
  Id.Stream otherStream=Id.Stream.from(OTHER_NAMESPACE,"String_Node_Str");
  List<Id.Stream> fooStreams=Lists.newArrayList();
  for (int i=0; i < 4; i++) {
    fooStreams.add(Id.Stream.from(FOO_NAMESPACE,"String_Node_Str" + i));
  }
  List<Id.Stream> allStreams=Lists.newArrayList();
  allStreams.addAll(fooStreams);
  allStreams.add(otherStream);
  for (  Id.Stream stream : allStreams) {
    streamAdmin.create(stream);
    writeEvent(stream);
    Assert.assertNotEquals(0,getStreamSize(stream));
  }
  streamAdmin.dropAllInNamespace(Id.Namespace.from(FOO_NAMESPACE));
  for (  Id.Stream defaultStream : fooStreams) {
    Assert.assertEquals(0,getStreamSize(defaultStream));
  }
  Assert.assertNotEquals(0,getStreamSize(otherStream));
  streamAdmin.truncate(otherStream);
  Assert.assertEquals(0,getStreamSize(otherStream));
}

Fixed version (ground truth):
@Test public void testDropAllInNamespace() throws Exception {
  StreamAdmin streamAdmin=getStreamAdmin();
  Id.Stream otherStream=Id.Stream.from(OTHER_NAMESPACE,"String_Node_Str");
  List<Id.Stream> fooStreams=Lists.newArrayList();
  for (int i=0; i < 4; i++) {
    fooStreams.add(Id.Stream.from(FOO_NAMESPACE,"String_Node_Str" + i));
  }
  List<Id.Stream> allStreams=Lists.newArrayList();
  allStreams.addAll(fooStreams);
  allStreams.add(otherStream);
  for (  Id.Stream stream : allStreams) {
    streamAdmin.create(stream);
    writeEvent(stream);
    Assert.assertNotEquals(0,getStreamSize(stream));
  }
  streamAdmin.dropAllInNamespace(Id.Namespace.from(FOO_NAMESPACE));
  for (  Id.Stream defaultStream : fooStreams) {
    Assert.assertFalse(streamAdmin.exists(defaultStream));
  }
  Assert.assertNotEquals(0,getStreamSize(otherStream));
  streamAdmin.truncate(otherStream);
  Assert.assertEquals(0,getStreamSize(otherStream));
}
Program: 7167
Project: 7167
Buggy source:
private long getStreamSize(Id.Stream streamId) throws IOException {
  StreamAdmin streamAdmin=getStreamAdmin();
  StreamConfig config=streamAdmin.getConfig(streamId);
  return streamAdmin.fetchStreamSize(config);
}

Fixed version (ground truth):
private long getStreamSize(Id.Stream streamId) throws IOException {
  StreamAdmin streamAdmin=getStreamAdmin();
  StreamConfig config=streamAdmin.getConfig(streamId);
  Location generationLocation=StreamUtils.createGenerationLocation(config.getLocation(),StreamUtils.getGeneration(config));
  return StreamUtils.fetchStreamFilesSize(generationLocation);
}
Program: 7169
Project: 7169
Buggy source:
@AfterClass public static void finish() throws Exception {
  txManager.stopAndWait();
  testHBase.stopHBase();
}

Fixed version (ground truth):
@AfterClass public static void finish() throws Exception {
  streamCoordinatorClient.stopAndWait();
  txManager.stopAndWait();
  testHBase.stopHBase();
}
Program: 7170
Project: 7170
Buggy source:
@Override public void updateProperties(Id.Stream streamId,Callable<CoordinatorStreamProperties> action) throws Exception {
  Lock lock=getLock(streamId);
  lock.lock();
  try {
    final CoordinatorStreamProperties properties=action.call();
    propertyStore.update(streamId.toId(),new SyncPropertyUpdater<CoordinatorStreamProperties>(){
      @Override protected CoordinatorStreamProperties compute(      @Nullable CoordinatorStreamProperties oldProperties){
        if (oldProperties == null) {
          return properties;
        }
        return new CoordinatorStreamProperties(firstNotNull(properties.getTTL(),oldProperties.getTTL()),firstNotNull(properties.getFormat(),oldProperties.getFormat()),firstNotNull(properties.getNotificationThresholdMB(),oldProperties.getNotificationThresholdMB()),firstNotNull(properties.getGeneration(),oldProperties.getGeneration()));
      }
    }
).get();
  }
  finally {
    lock.unlock();
  }
}

Fixed version (ground truth):
/** 
 * Updates stream properties in the property store.
 */
private ListenableFuture<CoordinatorStreamProperties> updateProperties(Id.Stream streamId,final CoordinatorStreamProperties properties){
  return propertyStore.update(streamId.toId(),new SyncPropertyUpdater<CoordinatorStreamProperties>(){
    @Override protected CoordinatorStreamProperties compute(    @Nullable CoordinatorStreamProperties oldProperties){
      if (oldProperties == null) {
        return properties;
      }
      return new CoordinatorStreamProperties(firstNotNull(properties.getTTL(),oldProperties.getTTL()),firstNotNull(properties.getFormat(),oldProperties.getFormat()),firstNotNull(properties.getNotificationThresholdMB(),oldProperties.getNotificationThresholdMB()),firstNotNull(properties.getGeneration(),oldProperties.getGeneration()));
    }
  }
);
}
Program: 7171
Project: 7171
Buggy source:
@Nullable @Override public ResourceRequirement apply(@Nullable ResourceRequirement existingRequirement){
  LOG.debug("String_Node_Str",streamId);
  Set<ResourceRequirement.Partition> partitions;
  if (existingRequirement != null) {
    partitions=existingRequirement.getPartitions();
  }
 else {
    partitions=ImmutableSet.of();
  }
  ResourceRequirement.Partition newPartition=new ResourceRequirement.Partition(streamId.toId(),1);
  if (partitions.contains(newPartition)) {
    return null;
  }
  ResourceRequirement.Builder builder=ResourceRequirement.builder(Constants.Service.STREAMS);
  builder.addPartition(newPartition);
  for (  ResourceRequirement.Partition partition : partitions) {
    builder.addPartition(partition);
  }
  return builder.build();
}

Fixed version (ground truth):
@Nullable @Override public ResourceRequirement apply(@Nullable ResourceRequirement existingRequirement){
  LOG.debug("String_Node_Str",streamId);
  if (existingRequirement == null) {
    return null;
  }
  Set<ResourceRequirement.Partition> partitions=existingRequirement.getPartitions();
  ResourceRequirement.Builder builder=ResourceRequirement.builder(Constants.Service.STREAMS);
  for (  ResourceRequirement.Partition partition : partitions) {
    if (!partition.getName().equals(streamId.toId())) {
      builder.addPartition(partition);
    }
  }
  return builder.build();
}
Program: 7173
Project: 7173
Buggy source:
@Override public void dropAllInNamespace(Id.Namespace namespace) throws Exception {
  List<Location> locations;
  try {
    locations=getStreamsHomeLocation(namespace).list();
  }
 catch (  FileNotFoundException e) {
    locations=ImmutableList.of();
  }
  for (  final Location streamLocation : locations) {
    doTruncate(streamLocation);
  }
  stateStoreFactory.dropAllInNamespace(namespace);
}

Fixed version (ground truth):
@Override public void dropAllInNamespace(Id.Namespace namespace) throws Exception {
  List<Location> locations;
  try {
    locations=getStreamsHomeLocation(namespace).list();
  }
 catch (  FileNotFoundException e) {
    locations=ImmutableList.of();
  }
  for (  final Location streamLocation : locations) {
    doTruncate(streamLocation);
    alterExploreStream(StreamUtils.getStreamIdFromLocation(streamLocation),false);
  }
  stateStoreFactory.dropAllInNamespace(namespace);
}
Program: 7174
Project: 7174
Buggy source:
@Inject private DatasetTypeMDSUpgrader(TransactionExecutorFactory executorFactory,DatasetFramework dsFramework,LocationFactory locationFactory,Configuration hConf,HBaseTableUtil tableUtil){
  this.executorFactory=executorFactory;
  this.dsFramework=dsFramework;
  this.locationFactory=locationFactory;
  this.hConf=hConf;
  this.tableUtil=tableUtil;
}

Fixed version (ground truth):
@Inject private DatasetTypeMDSUpgrader(TransactionExecutorFactory executorFactory,DatasetFramework dsFramework,LocationFactory locationFactory){
  this.executorFactory=executorFactory;
  this.dsFramework=dsFramework;
  this.locationFactory=locationFactory;
}
Program: 7176
Project: 7176
Buggy source:
@Inject private MDSUpgrader(LocationFactory locationFactory,TransactionExecutorFactory executorFactory,final DatasetFramework dsFramework,CConfiguration cConf,@Named("String_Node_Str") final Store store){
  super(locationFactory);
  this.cConf=cConf;
  this.store=store;
  this.appMDS=Transactional.of(executorFactory,new Supplier<AppMDS>(){
    @Override public AppMDS get(){
      try {
        Table table=DatasetsUtil.getOrCreateDataset(dsFramework,Id.DatasetInstance.from(Constants.DEFAULT_NAMESPACE_ID,Joiner.on("String_Node_Str").join(Constants.SYSTEM_NAMESPACE,DefaultStore.APP_META_TABLE)),"String_Node_Str",DatasetProperties.EMPTY,DatasetDefinition.NO_ARGUMENTS,null);
        return new AppMDS(new AppMetadataStoreDataset(table));
      }
 catch (      Exception e) {
        LOG.error("String_Node_Str",Joiner.on("String_Node_Str").join(Constants.SYSTEM_NAMESPACE,DefaultStore.APP_META_TABLE),e);
        throw Throwables.propagate(e);
      }
    }
  }
);
  appStreams=Sets.newHashSet();
}

Fixed version (ground truth):
@Inject private MDSUpgrader(LocationFactory locationFactory,TransactionExecutorFactory executorFactory,final DatasetFramework dsFramework,CConfiguration cConf,@Named("String_Node_Str") final Store store){
  super(locationFactory);
  this.cConf=cConf;
  this.store=store;
  final String appMetaTableName=Joiner.on("String_Node_Str").join(Constants.SYSTEM_NAMESPACE,DefaultStore.APP_META_TABLE);
  this.appMDS=Transactional.of(executorFactory,new Supplier<AppMDS>(){
    @Override public AppMDS get(){
      try {
        Table table=DatasetsUtil.getOrCreateDataset(dsFramework,Id.DatasetInstance.from(Constants.DEFAULT_NAMESPACE_ID,appMetaTableName),"String_Node_Str",DatasetProperties.EMPTY,DatasetDefinition.NO_ARGUMENTS,null);
        return new AppMDS(new AppMetadataStoreDataset(table));
      }
 catch (      Exception e) {
        LOG.error("String_Node_Str",appMetaTableName,e);
        throw Throwables.propagate(e);
      }
    }
  }
);
  this.appStreams=Sets.newHashSet();
  this.appMetaTableId=TableId.from(Constants.DEFAULT_NAMESPACE_ID,appMetaTableName);
}
Program: 7177
Project: 7177
Buggy source:
@Override public AppMDS get(){
  try {
    Table table=DatasetsUtil.getOrCreateDataset(dsFramework,Id.DatasetInstance.from(Constants.DEFAULT_NAMESPACE_ID,Joiner.on("String_Node_Str").join(Constants.SYSTEM_NAMESPACE,DefaultStore.APP_META_TABLE)),"String_Node_Str",DatasetProperties.EMPTY,DatasetDefinition.NO_ARGUMENTS,null);
    return new AppMDS(new AppMetadataStoreDataset(table));
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",Joiner.on("String_Node_Str").join(Constants.SYSTEM_NAMESPACE,DefaultStore.APP_META_TABLE),e);
    throw Throwables.propagate(e);
  }
}

Fixed version (ground truth):
@Override public AppMDS get(){
  try {
    Table table=DatasetsUtil.getOrCreateDataset(dsFramework,Id.DatasetInstance.from(Constants.DEFAULT_NAMESPACE_ID,appMetaTableName),"String_Node_Str",DatasetProperties.EMPTY,DatasetDefinition.NO_ARGUMENTS,null);
    return new AppMDS(new AppMetadataStoreDataset(table));
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",appMetaTableName,e);
    throw Throwables.propagate(e);
  }
}
Program: 7178
Project: 7178
Buggy source:
/** 
 * Creates the   {@link Constants#SYSTEM_NAMESPACE} in hbase and {@link Constants#DEFAULT_NAMESPACE} namespace and alsoadds it to the store
 */
private void createNamespaces(){
  LOG.info("String_Node_Str",Constants.SYSTEM_NAMESPACE_ID);
  try {
    HBaseAdmin admin=new HBaseAdmin(hConf);
    hBaseTableUtil.createNamespaceIfNotExists(admin,Constants.SYSTEM_NAMESPACE_ID);
  }
 catch (  MasterNotRunningException e) {
    Throwables.propagate(e);
  }
catch (  ZooKeeperConnectionException e) {
    Throwables.propagate(e);
  }
catch (  IOException e) {
    Throwables.propagate(e);
  }
  LOG.info("String_Node_Str",Constants.DEFAULT_NAMESPACE);
  getStore().createNamespace(new NamespaceMeta.Builder().setName(Constants.DEFAULT_NAMESPACE).setDescription(Constants.DEFAULT_NAMESPACE).build());
}

Fixed version (ground truth):
/** 
 * Creates the   {@link Constants#SYSTEM_NAMESPACE} in hbase and {@link Constants#DEFAULT_NAMESPACE} namespace and alsoadds it to the store
 */
private void createNamespaces(){
  LOG.info("String_Node_Str",Constants.SYSTEM_NAMESPACE_ID);
  try {
    HBaseAdmin admin=new HBaseAdmin(hConf);
    hBaseTableUtil.createNamespaceIfNotExists(admin,Constants.SYSTEM_NAMESPACE_ID);
  }
 catch (  MasterNotRunningException e) {
    Throwables.propagate(e);
  }
catch (  ZooKeeperConnectionException e) {
    Throwables.propagate(e);
  }
catch (  IOException e) {
    Throwables.propagate(e);
  }
  LOG.info("String_Node_Str",Constants.DEFAULT_NAMESPACE);
  getStore().createNamespace(Constants.DEFAULT_NAMESPACE_META);
}
Program: 7179
Project: 7179
Buggy source:
public UpgradeTool() throws Exception {
  cConf=CConfiguration.create();
  hConf=HBaseConfiguration.create();
  this.injector=init();
  txService=injector.getInstance(TransactionService.class);
  zkClientService=injector.getInstance(ZKClientService.class);
  hBaseTableUtil=injector.getInstance(HBaseTableUtil.class);
  Runtime.getRuntime().addShutdownHook(new Thread(){
    @Override public void run(){
      try {
        UpgradeTool.this.stop();
      }
 catch (      Throwable e) {
        LOG.error("String_Node_Str",e);
      }
    }
  }
);
}

Fixed version (ground truth):
public UpgradeTool() throws Exception {
  this.cConf=CConfiguration.create();
  this.hConf=HBaseConfiguration.create();
  this.injector=init();
  this.txService=injector.getInstance(TransactionService.class);
  this.zkClientService=injector.getInstance(ZKClientService.class);
  this.hBaseTableUtil=injector.getInstance(HBaseTableUtil.class);
  Runtime.getRuntime().addShutdownHook(new Thread(){
    @Override public void run(){
      try {
        UpgradeTool.this.stop();
      }
 catch (      Throwable e) {
        LOG.error("String_Node_Str",e);
      }
    }
  }
);
}
Program: 7180
Project: 7180
Buggy source:
private void performUpgrade() throws Exception {
  LOG.info("String_Node_Str");
  DatasetUpgrader dsUpgrade=injector.getInstance(DatasetUpgrader.class);
  dsUpgrade.upgrade();
  LOG.info("String_Node_Str");
  MDSUpgrader mdsUpgrader=injector.getInstance(MDSUpgrader.class);
  mdsUpgrader.upgrade();
  LOG.info("String_Node_Str");
  ArchiveUpgrader archiveUpgrader=injector.getInstance(ArchiveUpgrader.class);
  archiveUpgrader.upgrade();
  LOG.info("String_Node_Str");
  getFileMetaDataManager().upgrade();
  LOG.info("String_Node_Str");
  StreamStateStoreUpgrader streamStateStoreUpgrader=injector.getInstance(StreamStateStoreUpgrader.class);
  streamStateStoreUpgrader.upgrade();
  LOG.info("String_Node_Str");
  QueueConfigUpgrader queueConfigUpgrader=injector.getInstance(QueueConfigUpgrader.class);
  queueConfigUpgrader.upgrade();
}

Fixed version (ground truth):
private void performUpgrade() throws Exception {
  LOG.info("String_Node_Str");
  HBaseAdmin hBaseAdmin=new HBaseAdmin(hConf);
  DatasetUpgrader dsUpgrade=injector.getInstance(DatasetUpgrader.class);
  dsUpgrade.upgrade();
  hBaseTableUtil.dropTable(hBaseAdmin,dsUpgrade.getDatasetInstanceMDSUpgrader().getOldDatasetInstanceTableId());
  hBaseTableUtil.dropTable(hBaseAdmin,dsUpgrade.getDatasetTypeMDSUpgrader().getOldDatasetTypeTableId());
  LOG.info("String_Node_Str");
  MDSUpgrader mdsUpgrader=injector.getInstance(MDSUpgrader.class);
  mdsUpgrader.upgrade();
  hBaseTableUtil.dropTable(hBaseAdmin,mdsUpgrader.getOldAppMetaTableId());
  LOG.info("String_Node_Str");
  ArchiveUpgrader archiveUpgrader=injector.getInstance(ArchiveUpgrader.class);
  archiveUpgrader.upgrade();
  LOG.info("String_Node_Str");
  getFileMetaDataManager().upgrade();
  hBaseTableUtil.dropTable(hBaseAdmin,getFileMetaDataManager().getOldLogMetaTableId());
  LOG.info("String_Node_Str");
  StreamStateStoreUpgrader streamStateStoreUpgrader=injector.getInstance(StreamStateStoreUpgrader.class);
  streamStateStoreUpgrader.upgrade();
  LOG.info("String_Node_Str");
  QueueConfigUpgrader queueConfigUpgrader=injector.getInstance(QueueConfigUpgrader.class);
  queueConfigUpgrader.upgrade();
}
Program: 7181
Project: 7181
Buggy source:
@Inject public FileMetaDataManager(final LogSaverTableUtil tableUtil,TransactionExecutorFactory txExecutorFactory,LocationFactory locationFactory,DatasetFramework dsFramework,CConfiguration cConf){
  this.dsFramework=dsFramework;
  this.txExecutorFactory=txExecutorFactory;
  this.mds=Transactional.of(txExecutorFactory,new Supplier<DatasetContext<Table>>(){
    @Override public DatasetContext<Table> get(){
      try {
        return DatasetContext.of(tableUtil.getMetaTable());
      }
 catch (      Exception e) {
        throw Throwables.propagate(e);
      }
    }
  }
);
  this.locationFactory=locationFactory;
  this.logBaseDir=cConf.get(LoggingConfiguration.LOG_BASE_DIR);
}

Fixed version (ground truth):
@Inject public FileMetaDataManager(final LogSaverTableUtil tableUtil,TransactionExecutorFactory txExecutorFactory,LocationFactory locationFactory,DatasetFramework dsFramework,CConfiguration cConf){
  this.dsFramework=dsFramework;
  this.txExecutorFactory=txExecutorFactory;
  this.mds=Transactional.of(txExecutorFactory,new Supplier<DatasetContext<Table>>(){
    @Override public DatasetContext<Table> get(){
      try {
        return DatasetContext.of(tableUtil.getMetaTable());
      }
 catch (      Exception e) {
        throw Throwables.propagate(e);
      }
    }
  }
);
  this.locationFactory=locationFactory;
  this.logBaseDir=cConf.get(LoggingConfiguration.LOG_BASE_DIR);
  this.metaTableName=tableUtil.getMetaTableName();
}
Program: 7182
Project: 7182
Buggy source:
private Stream(final Namespace namespace,final String streamName){
  Preconditions.checkNotNull(namespace,"String_Node_Str");
  Preconditions.checkNotNull(streamName,"String_Node_Str");
  Preconditions.checkArgument(isId(streamName),String.format("String_Node_Str" + "String_Node_Str",streamName));
  this.namespace=namespace;
  this.streamName=streamName;
}

Fixed version (ground truth):
private Stream(final Namespace namespace,final String streamName){
  Preconditions.checkNotNull(namespace,"String_Node_Str");
  Preconditions.checkNotNull(streamName,"String_Node_Str");
  Preconditions.checkArgument(isId(streamName),"String_Node_Str" + "String_Node_Str",streamName);
  this.namespace=namespace;
  this.streamName=streamName;
}
Program: 7183
Project: 7183
Buggy source:
@Inject private DatasetInstanceMDSUpgrader(final TransactionExecutorFactory executorFactory,@Named("String_Node_Str") final DatasetFramework dsFramework){
  this.datasetInstanceMds=Transactional.of(executorFactory,new Supplier<UpgradeMDSStores<DatasetInstanceMDS>>(){
    @Override public UpgradeMDSStores<DatasetInstanceMDS> get(){
      String dsName=Joiner.on("String_Node_Str").join(Constants.SYSTEM_NAMESPACE,DatasetMetaTableUtil.INSTANCE_TABLE_NAME);
      Id.DatasetInstance datasetId=Id.DatasetInstance.from(Constants.DEFAULT_NAMESPACE_ID,dsName);
      DatasetInstanceMDS oldMds;
      DatasetInstanceMDS newMds;
      try {
        oldMds=DatasetsUtil.getOrCreateDataset(dsFramework,datasetId,DatasetInstanceMDS.class.getName(),DatasetProperties.EMPTY,DatasetDefinition.NO_ARGUMENTS,null);
      }
 catch (      Exception e) {
        LOG.error("String_Node_Str",datasetId,e);
        throw Throwables.propagate(e);
      }
      try {
        newMds=new DatasetMetaTableUtil(dsFramework).getInstanceMetaTable();
      }
 catch (      Exception e) {
        LOG.error("String_Node_Str");
        throw Throwables.propagate(e);
      }
      return new UpgradeMDSStores<DatasetInstanceMDS>(oldMds,newMds);
    }
  }
);
}

Fixed version (ground truth):
@Inject private DatasetInstanceMDSUpgrader(final TransactionExecutorFactory executorFactory,final DatasetFramework dsFramework){
  this.datasetInstanceMds=Transactional.of(executorFactory,new Supplier<UpgradeMDSStores<DatasetInstanceMDS>>(){
    @Override public UpgradeMDSStores<DatasetInstanceMDS> get(){
      String dsName=Joiner.on("String_Node_Str").join(Constants.SYSTEM_NAMESPACE,DatasetMetaTableUtil.INSTANCE_TABLE_NAME);
      Id.DatasetInstance datasetId=Id.DatasetInstance.from(Constants.DEFAULT_NAMESPACE_ID,dsName);
      DatasetInstanceMDS oldMds;
      DatasetInstanceMDS newMds;
      try {
        oldMds=DatasetsUtil.getOrCreateDataset(dsFramework,datasetId,DatasetInstanceMDS.class.getName(),DatasetProperties.EMPTY,DatasetDefinition.NO_ARGUMENTS,null);
      }
 catch (      Exception e) {
        LOG.error("String_Node_Str",datasetId,e);
        throw Throwables.propagate(e);
      }
      try {
        newMds=new DatasetMetaTableUtil(dsFramework).getInstanceMetaTable();
      }
 catch (      Exception e) {
        LOG.error("String_Node_Str");
        throw Throwables.propagate(e);
      }
      return new UpgradeMDSStores<DatasetInstanceMDS>(oldMds,newMds);
    }
  }
);
}
Program: 7184
Project: 7184
Buggy source:
@Inject private DatasetTypeMDSUpgrader(final TransactionExecutorFactory executorFactory,@Named("String_Node_Str") final DatasetFramework dsFramework,LocationFactory locationFactory,Configuration hConf,HBaseTableUtil tableUtil){
  this.executorFactory=executorFactory;
  this.dsFramework=dsFramework;
  this.locationFactory=locationFactory;
  this.hConf=hConf;
  this.tableUtil=tableUtil;
}

Fixed version (ground truth):
@Inject private DatasetTypeMDSUpgrader(TransactionExecutorFactory executorFactory,DatasetFramework dsFramework,LocationFactory locationFactory,Configuration hConf,HBaseTableUtil tableUtil){
  this.executorFactory=executorFactory;
  this.dsFramework=dsFramework;
  this.locationFactory=locationFactory;
  this.hConf=hConf;
  this.tableUtil=tableUtil;
}
Program: 7185
Project: 7185
Buggy source:
@Inject private DatasetUpgrader(CConfiguration cConf,Configuration hConf,LocationFactory locationFactory,QueueAdmin queueAdmin,HBaseTableUtil hBaseTableUtil,@Named("String_Node_Str") final DatasetFramework dsFramework,DatasetInstanceMDSUpgrader datasetInstanceMDSUpgrader,DatasetTypeMDSUpgrader datasetTypeMDSUpgrader){
  super(locationFactory);
  this.cConf=cConf;
  this.hConf=hConf;
  this.locationFactory=locationFactory;
  this.queueAdmin=queueAdmin;
  this.hBaseTableUtil=hBaseTableUtil;
  this.dsFramework=dsFramework;
  this.datasetInstanceMDSUpgrader=datasetInstanceMDSUpgrader;
  this.datasetTypeMDSUpgrader=datasetTypeMDSUpgrader;
  this.userTablePrefix=Pattern.compile(String.format("String_Node_Str",cConf.get(Constants.Dataset.TABLE_PREFIX)));
}

Fixed version (ground truth):
@Inject private DatasetUpgrader(CConfiguration cConf,Configuration hConf,LocationFactory locationFactory,QueueAdmin queueAdmin,HBaseTableUtil hBaseTableUtil,DatasetFramework dsFramework,DatasetInstanceMDSUpgrader datasetInstanceMDSUpgrader,DatasetTypeMDSUpgrader datasetTypeMDSUpgrader){
  super(locationFactory);
  this.cConf=cConf;
  this.hConf=hConf;
  this.locationFactory=locationFactory;
  this.queueAdmin=queueAdmin;
  this.hBaseTableUtil=hBaseTableUtil;
  this.dsFramework=dsFramework;
  this.datasetInstanceMDSUpgrader=datasetInstanceMDSUpgrader;
  this.datasetTypeMDSUpgrader=datasetTypeMDSUpgrader;
  this.userTablePrefix=Pattern.compile(String.format("String_Node_Str",cConf.get(Constants.Dataset.TABLE_PREFIX)));
}
Program: 7186
Project: 7186
Buggy source:
@Inject private MDSUpgrader(LocationFactory locationFactory,TransactionExecutorFactory executorFactory,@Named("String_Node_Str") final DatasetFramework dsFramework,CConfiguration cConf,@Named("String_Node_Str") final Store store){
  super(locationFactory);
  this.cConf=cConf;
  this.store=store;
  this.appMDS=Transactional.of(executorFactory,new Supplier<AppMDS>(){
    @Override public AppMDS get(){
      try {
        Table table=DatasetsUtil.getOrCreateDataset(dsFramework,Id.DatasetInstance.from(Constants.DEFAULT_NAMESPACE_ID,Joiner.on("String_Node_Str").join(Constants.SYSTEM_NAMESPACE,DefaultStore.APP_META_TABLE)),"String_Node_Str",DatasetProperties.EMPTY,DatasetDefinition.NO_ARGUMENTS,null);
        return new AppMDS(new AppMetadataStoreDataset(table));
      }
 catch (      Exception e) {
        LOG.error("String_Node_Str",Joiner.on("String_Node_Str").join(Constants.SYSTEM_NAMESPACE,DefaultStore.APP_META_TABLE),e);
        throw Throwables.propagate(e);
      }
    }
  }
);
  appStreams=Sets.newHashSet();
}

Fixed version (ground truth):
@Inject private MDSUpgrader(LocationFactory locationFactory,TransactionExecutorFactory executorFactory,final DatasetFramework dsFramework,CConfiguration cConf,@Named("String_Node_Str") final Store store){
  super(locationFactory);
  this.cConf=cConf;
  this.store=store;
  this.appMDS=Transactional.of(executorFactory,new Supplier<AppMDS>(){
    @Override public AppMDS get(){
      try {
        Table table=DatasetsUtil.getOrCreateDataset(dsFramework,Id.DatasetInstance.from(Constants.DEFAULT_NAMESPACE_ID,Joiner.on("String_Node_Str").join(Constants.SYSTEM_NAMESPACE,DefaultStore.APP_META_TABLE)),"String_Node_Str",DatasetProperties.EMPTY,DatasetDefinition.NO_ARGUMENTS,null);
        return new AppMDS(new AppMetadataStoreDataset(table));
      }
 catch (      Exception e) {
        LOG.error("String_Node_Str",Joiner.on("String_Node_Str").join(Constants.SYSTEM_NAMESPACE,DefaultStore.APP_META_TABLE),e);
        throw Throwables.propagate(e);
      }
    }
  }
);
  appStreams=Sets.newHashSet();
}
Program: 7187
Project: 7187
Buggy source:
/** 
 * Sets up a   {@link DatasetFramework} instance for standalone usage.  NOTE: should NOT be used by applications!!!
 */
private DatasetFramework createRegisteredDatasetFramework(CConfiguration cConf,DatasetDefinitionRegistryFactory registryFactory) throws DatasetManagementException, IOException {
  DatasetFramework datasetFramework=new InMemoryDatasetFramework(registryFactory,cConf);
  addModules(datasetFramework);
  DatasetMetaTableUtil.setupDatasets(datasetFramework);
  DefaultStore.setupDatasets(datasetFramework);
  DefaultConfigStore.setupDatasets(datasetFramework);
  LogSaverTableUtil.setupDatasets(datasetFramework);
  ScheduleStoreTableUtil.setupDatasets(datasetFramework);
  DefaultMetricDatasetFactory factory=new DefaultMetricDatasetFactory(cConf,datasetFramework);
  DefaultMetricDatasetFactory.setupDatasets(factory);
  return datasetFramework;
}

Fixed version (ground truth):
/** 
 * Sets up a   {@link DatasetFramework} instance for standalone usage.  NOTE: should NOT be used by applications!!!
 */
private DatasetFramework createRegisteredDatasetFramework(CConfiguration cConf,DatasetDefinitionRegistryFactory registryFactory,Map<String,DatasetModule> defaultModules) throws DatasetManagementException, IOException {
  DatasetFramework datasetFramework=new InMemoryDatasetFramework(registryFactory,defaultModules,cConf);
  DatasetMetaTableUtil.setupDatasets(datasetFramework);
  DefaultStore.setupDatasets(datasetFramework);
  DefaultConfigStore.setupDatasets(datasetFramework);
  LogSaverTableUtil.setupDatasets(datasetFramework);
  ScheduleStoreTableUtil.setupDatasets(datasetFramework);
  DefaultMetricDatasetFactory factory=new DefaultMetricDatasetFactory(cConf,datasetFramework);
  DefaultMetricDatasetFactory.setupDatasets(factory);
  return datasetFramework;
}
Program: 7189
Project: 7189
Buggy source:
@Provides @Singleton @Named("String_Node_Str") public DatasetFramework getDSFramework(CConfiguration cConf,DatasetDefinitionRegistryFactory registryFactory) throws IOException, DatasetManagementException {
  return createRegisteredDatasetFramework(cConf,registryFactory);
}

Fixed version (ground truth):
@Provides @Singleton public DatasetFramework getDSFramework(CConfiguration cConf,DatasetDefinitionRegistryFactory registryFactory,@Named("String_Node_Str") Map<String,DatasetModule> defaultModules) throws IOException, DatasetManagementException {
  return createRegisteredDatasetFramework(cConf,registryFactory,defaultModules);
}
Program: 7190
Project: 7190
Buggy source:
@Override protected void configure(){
  install(new DataFabricDistributedModule());
  bind(MetricsCollectionService.class).to(NoOpMetricsCollectionService.class).in(Scopes.SINGLETON);
  bind(Scheduler.class).toInstance(createNoopScheduler());
  bind(DatasetFramework.class).to(RemoteDatasetFramework.class);
  bind(DatasetTypeClassLoaderFactory.class).to(DistributedDatasetTypeClassLoaderFactory.class);
  install(new FactoryModuleBuilder().implement(DatasetDefinitionRegistry.class,DefaultDatasetDefinitionRegistry.class).build(DatasetDefinitionRegistryFactory.class));
  bind(NamespaceAdmin.class).to(DefaultNamespaceAdmin.class);
  install(new FactoryModuleBuilder().implement(Store.class,DefaultStore.class).build(StoreFactory.class));
  bind(ConfigStore.class).to(DefaultConfigStore.class);
}

Fixed version (ground truth):
@Override protected void configure(){
  install(new DataFabricDistributedModule());
  bind(MetricsCollectionService.class).to(NoOpMetricsCollectionService.class).in(Scopes.SINGLETON);
  bind(Scheduler.class).toInstance(createNoopScheduler());
  bind(DatasetTypeClassLoaderFactory.class).to(DistributedDatasetTypeClassLoaderFactory.class);
  install(new FactoryModuleBuilder().implement(DatasetDefinitionRegistry.class,DefaultDatasetDefinitionRegistry.class).build(DatasetDefinitionRegistryFactory.class));
  bind(NamespaceAdmin.class).to(DefaultNamespaceAdmin.class);
  install(new FactoryModuleBuilder().implement(Store.class,DefaultStore.class).build(StoreFactory.class));
  bind(ConfigStore.class).to(DefaultConfigStore.class);
}
Program: 7191
Project: 7191
Buggy source:
@Provides @Singleton @Named("String_Node_Str") public LogSaverTableUtil getLogSaverTableUtil(@Named("String_Node_Str") DatasetFramework dsFramework,CConfiguration cConf){
  return new LogSaverTableUtil(dsFramework,cConf);
}

Fixed version (ground truth):
@Provides @Singleton @Named("String_Node_Str") public LogSaverTableUtil getLogSaverTableUtil(DatasetFramework dsFramework,CConfiguration cConf){
  return new LogSaverTableUtil(dsFramework,cConf);
}
Program: 7193
Project: 7193
Buggy source:
@Override public void dropAllInNamespace(Id.Namespace namespace) throws Exception {
  List<Location> locations;
  try {
    locations=getStreamsHomeLocation(namespace).list();
  }
 catch (  FileNotFoundException e) {
    locations=ImmutableList.of();
  }
  for (  final Location streamLocation : locations) {
    doTruncate(streamLocation);
  }
  stateStoreFactory.dropAllInNamespace(namespace);
}

Fixed version (ground truth):
@Override public void dropAllInNamespace(Id.Namespace namespace) throws Exception {
  List<Location> locations;
  try {
    locations=getStreamsHomeLocation(namespace).list();
  }
 catch (  FileNotFoundException e) {
    locations=ImmutableList.of();
  }
  for (  final Location streamLocation : locations) {
    doTruncate(streamLocation);
    alterExploreStream(StreamUtils.getStreamIdFromLocation(streamLocation),false);
  }
  stateStoreFactory.dropAllInNamespace(namespace);
}
Program: 7196
Project: 7196
Buggy source:
@Path("String_Node_Str") @GET public void configHBase(@SuppressWarnings("String_Node_Str") HttpRequest request,HttpResponder responder,@DefaultValue("String_Node_Str") @QueryParam("String_Node_Str") String format){
  if ("String_Node_Str".equals(format)) {
    responder.sendJson(HttpResponseStatus.OK,toMap(cConf));
  }
 else   if ("String_Node_Str".equals(format)) {
    try {
      StringWriter stringWriter=new StringWriter();
      hConf.writeXml(stringWriter);
      responder.sendContent(HttpResponseStatus.OK,stringWriter2ChannelBuffer(stringWriter),"String_Node_Str",null);
    }
 catch (    IOException e) {
      LOG.info("String_Node_Str",e);
      responder.sendStatus(HttpResponseStatus.INTERNAL_SERVER_ERROR);
    }
  }
 else {
    responder.sendString(HttpResponseStatus.BAD_REQUEST,"String_Node_Str" + format + "String_Node_Str");
  }
}

Fixed version (ground truth):
@Path("String_Node_Str") @GET public void configHBase(@SuppressWarnings("String_Node_Str") HttpRequest request,HttpResponder responder,@DefaultValue("String_Node_Str") @QueryParam("String_Node_Str") String format){
  if ("String_Node_Str".equals(format)) {
    responder.sendJson(HttpResponseStatus.OK,toMap(hConf));
  }
 else   if ("String_Node_Str".equals(format)) {
    try {
      StringWriter stringWriter=new StringWriter();
      hConf.writeXml(stringWriter);
      responder.sendContent(HttpResponseStatus.OK,stringWriter2ChannelBuffer(stringWriter),"String_Node_Str",null);
    }
 catch (    IOException e) {
      LOG.info("String_Node_Str",e);
      responder.sendStatus(HttpResponseStatus.INTERNAL_SERVER_ERROR);
    }
  }
 else {
    responder.sendString(HttpResponseStatus.BAD_REQUEST,"String_Node_Str" + format + "String_Node_Str");
  }
}
Program: 7197
Project: 7197
Buggy source:
/** 
 * Writes the   {@link AppMetadataStore#TYPE_RUN_RECORD_STARTED} entry in the app meta table so that{@link AppMetadataStore#TYPE_RUN_RECORD_COMPLETED} can be written which deleted the started record.
 * @param appId the application id
 * @param programType {@link ProgramType} of this program
 * @param programId the program id of this program
 * @param pId the process id of the run
 * @param startTs the startTs
 */
private void writeTempRunRecordStart(String appId,ProgramType programType,String programId,String pId,long startTs){
  store.setStart(Id.Program.from(Id.Application.from(Constants.DEFAULT_NAMESPACE,appId),programType,programId),pId,Long.MAX_VALUE - startTs);
}

Fixed version (ground truth):
/** 
 * Writes the   {@link AppMetadataStore#TYPE_RUN_RECORD_STARTED} entry in the app meta table so that{@link AppMetadataStore#TYPE_RUN_RECORD_COMPLETED} can be written which deleted the started record.
 * @param appId the application id
 * @param programType {@link ProgramType} of this program
 * @param programId the program id of this program
 * @param pId the process id of the run
 * @param startTs the startTs
 */
private void writeTempRunRecordStart(String appId,ProgramType programType,String programId,String pId,long startTs){
  store.setStart(Id.Program.from(Id.Application.from(Constants.DEFAULT_NAMESPACE,appId),programType,programId),pId,startTs);
}
Program: 7198
Project: 7198
Buggy source:
private void upgradeUserTables() throws Exception {
  HBaseAdmin hAdmin=new HBaseAdmin(hConf);
  for (  HTableDescriptor desc : hAdmin.listTables(USER_TABLE_PREFIX)) {
    HTableNameConverter hTableNameConverter=new HTableNameConverterFactory().get();
    TableId tableId=hTableNameConverter.from(desc);
    LOG.info("String_Node_Str",tableId,desc);
    final boolean supportsIncrement=HBaseTableAdmin.supportsReadlessIncrements(desc);
    final boolean transactional=HBaseTableAdmin.isTransactional(desc);
    DatasetAdmin admin=new AbstractHBaseDataSetAdmin(tableId,hConf,hBaseTableUtil){
      @Override protected CoprocessorJar createCoprocessorJar() throws IOException {
        return HBaseTableAdmin.createCoprocessorJarInternal(cConf,locationFactory,hBaseTableUtil,transactional,supportsIncrement);
      }
      @Override protected boolean upgradeTable(      HTableDescriptor tableDescriptor){
        return false;
      }
      @Override public void create() throws IOException {
        throw new UnsupportedOperationException("String_Node_Str");
      }
    }
;
    admin.upgrade();
    LOG.info("String_Node_Str",tableId);
  }
}

Fixed version (ground truth):
private void upgradeUserTables() throws Exception {
  HBaseAdmin hAdmin=new HBaseAdmin(hConf);
  for (  HTableDescriptor desc : hAdmin.listTables(userTablePrefix)) {
    HTableNameConverter hTableNameConverter=new HTableNameConverterFactory().get();
    TableId tableId=hTableNameConverter.from(desc);
    LOG.info("String_Node_Str",tableId,desc);
    final boolean supportsIncrement=HBaseTableAdmin.supportsReadlessIncrements(desc);
    final boolean transactional=HBaseTableAdmin.isTransactional(desc);
    DatasetAdmin admin=new AbstractHBaseDataSetAdmin(tableId,hConf,hBaseTableUtil){
      @Override protected CoprocessorJar createCoprocessorJar() throws IOException {
        return HBaseTableAdmin.createCoprocessorJarInternal(cConf,locationFactory,hBaseTableUtil,transactional,supportsIncrement);
      }
      @Override protected boolean upgradeTable(      HTableDescriptor tableDescriptor){
        return false;
      }
      @Override public void create() throws IOException {
        throw new UnsupportedOperationException("String_Node_Str");
      }
    }
;
    admin.upgrade();
    LOG.info("String_Node_Str",tableId);
  }
}
Program: 7199
Project: 7199
Buggy source:
@Inject private DatasetUpgrader(CConfiguration cConf,Configuration hConf,LocationFactory locationFactory,QueueAdmin queueAdmin,HBaseTableUtil hBaseTableUtil,@Named("String_Node_Str") final DatasetFramework dsFramework,DatasetInstanceMDSUpgrader datasetInstanceMDSUpgrader,DatasetTypeMDSUpgrader datasetTypeMDSUpgrader){
  super(locationFactory);
  this.cConf=cConf;
  this.hConf=hConf;
  this.locationFactory=locationFactory;
  this.queueAdmin=queueAdmin;
  this.hBaseTableUtil=hBaseTableUtil;
  this.dsFramework=dsFramework;
  this.datasetInstanceMDSUpgrader=datasetInstanceMDSUpgrader;
  this.datasetTypeMDSUpgrader=datasetTypeMDSUpgrader;
}

Fixed version (ground truth):
@Inject private DatasetUpgrader(CConfiguration cConf,Configuration hConf,LocationFactory locationFactory,QueueAdmin queueAdmin,HBaseTableUtil hBaseTableUtil,@Named("String_Node_Str") final DatasetFramework dsFramework,DatasetInstanceMDSUpgrader datasetInstanceMDSUpgrader,DatasetTypeMDSUpgrader datasetTypeMDSUpgrader){
  super(locationFactory);
  this.cConf=cConf;
  this.hConf=hConf;
  this.locationFactory=locationFactory;
  this.queueAdmin=queueAdmin;
  this.hBaseTableUtil=hBaseTableUtil;
  this.dsFramework=dsFramework;
  this.datasetInstanceMDSUpgrader=datasetInstanceMDSUpgrader;
  this.datasetTypeMDSUpgrader=datasetTypeMDSUpgrader;
  this.userTablePrefix=Pattern.compile(String.format("String_Node_Str",cConf.get(Constants.Dataset.TABLE_PREFIX)));
}
Program: 7200
Project: 7200
Buggy source:
@Override public QueryHandle execute(Id.Namespace namespace,String statement) throws ExploreException, SQLException {
  startAndWait();
  try {
    Map<String,String> sessionConf=startSession(namespace);
    SessionHandle sessionHandle=openSession(sessionConf);
    try {
      String database=getHiveDatabase(namespace.getId());
      SessionState.get().setCurrentDatabase(database);
      OperationHandle operationHandle=doExecute(sessionHandle,statement);
      QueryHandle handle=saveOperationInfo(operationHandle,sessionHandle,sessionConf,statement,database);
      LOG.trace("String_Node_Str",statement,handle);
      return handle;
    }
 catch (    Throwable e) {
      closeSession(sessionHandle);
      throw e;
    }
  }
 catch (  HiveSQLException e) {
    throw getSqlException(e);
  }
catch (  Throwable e) {
    throw new ExploreException(e);
  }
}

Fixed version (ground truth):
@Override public QueryHandle execute(Id.Namespace namespace,String statement) throws ExploreException, SQLException {
  startAndWait();
  try {
    Map<String,String> sessionConf=startSession(namespace);
    SessionHandle sessionHandle=openSession(sessionConf);
    try {
      String database=getHiveDatabase(namespace.getId());
      setCurrentDatabase(database);
      OperationHandle operationHandle=doExecute(sessionHandle,statement);
      QueryHandle handle=saveOperationInfo(operationHandle,sessionHandle,sessionConf,statement,database);
      LOG.trace("String_Node_Str",statement,handle);
      return handle;
    }
 catch (    Throwable e) {
      closeSession(sessionHandle);
      throw e;
    }
  }
 catch (  HiveSQLException e) {
    throw getSqlException(e);
  }
catch (  Throwable e) {
    throw new ExploreException(e);
  }
}
Program: 7202
Project: 7202
Buggy source:
private String getHiveTableName(String streamId){
  return String.format("String_Node_Str",Constants.DEFAULT_NAMESPACE,streamId);
}

Fixed version (ground truth):
private String getHiveTableName(String streamId){
  return String.format("String_Node_Str",streamId);
}