nus-yam/ex-repair huggingface dataset:
Program: 6368
Project: 6368
Buggy source:
/** 
 * Return the partition for a specific partition key.
 */
@Nullable PartitionDetail getPartition(PartitionKey key);

Fixed version (ground truth):
/** 
 * Return the partition for a specific partition key, or null if key is not found.
 */
@Nullable PartitionDetail getPartition(PartitionKey key);
Program: 6369
Project: 6369
Buggy source:
/** 
 * Adds a set of new metadata entries for a particular partition. Note that existing entries cannot be updated.
 * @throws DataSetException when an attempt is made to either update existing entries or add entries for apartition that does not exist
 */
void addMetadata(PartitionKey key,Map<String,String> metadata);

Fixed version (ground truth):
/** 
 * Adds a set of new metadata entries for a particular partition. Note that existing entries cannot be updated.
 * @throws DataSetException when an attempt is made to either update existing entries
 * @throws PartitionNotFoundException when a partition for the given key is not found
 */
void addMetadata(PartitionKey key,Map<String,String> metadata);
Program: 6370
Project: 6370
Buggy source:
/** 
 * Remove a partition for a given partition key.
 */
void dropPartition(PartitionKey key);

Fixed version (ground truth):
/** 
 * Remove a partition for a given partition key, silently ignoring if the key is not found.
 */
void dropPartition(PartitionKey key);
Program: 6371
Project: 6371
Buggy source:
@Override public Location get(Id.Namespace namespaceId,@Nullable String subPath) throws IOException {
  String namespacesDir=cConf.get(Constants.Namespace.NAMESPACES_DIR);
  Location namespaceLocation=locationFactory.create(namespacesDir).append(namespaceId.getId());
  if (subPath != null) {
    namespaceLocation=namespaceLocation.append(subPath);
  }
  return namespaceLocation;
}

Fixed version (ground truth):
@Override public Location get(Id.Namespace namespaceId,@Nullable String subPath) throws IOException {
  Location namespaceLocation=locationFactory.create(namespaceDir).append(namespaceId.getId());
  if (subPath != null) {
    namespaceLocation=namespaceLocation.append(subPath);
  }
  return namespaceLocation;
}
Program: 6372
Project: 6372
Buggy source:
@Inject public DefaultNamespacedLocationFactory(CConfiguration cConf,LocationFactory locationFactory){
  this.cConf=cConf;
  this.locationFactory=locationFactory;
}

Fixed version (ground truth):
@Inject public DefaultNamespacedLocationFactory(CConfiguration cConf,LocationFactory locationFactory){
  this.namespaceDir=cConf.get(Constants.Namespace.NAMESPACES_DIR);
  this.locationFactory=locationFactory;
}
Program: 6373
Project: 6373
Buggy source:
@Override public boolean exists(Id.Namespace namespaceId) throws Exception {
  return get(namespaceId) != null;
}

Fixed version (ground truth):
@Override public boolean exists(Id.Namespace namespaceId) throws Exception {
  try {
    get(namespaceId);
  }
 catch (  NotFoundException e) {
    return false;
  }
  return true;
}
Program: 6374
Project: 6374
Buggy source:
/** 
 * Returns the base   {@link Location} for all CDAP data. This location contains allthe namespace locations.
 */
Location getBaseLocation() throws IOException ;

Fixed version (ground truth):
/** 
 * Returns the base   {@link Location} for all CDAP data.
 */
Location getBaseLocation() throws IOException ;
Program: 6375
Project: 6375
Buggy source:
@Test public void testGet() throws IOException {
  LocationFactory locationFactory=new LocalLocationFactory(TEMP_FOLDER.newFolder());
  NamespacedLocationFactory namespacedLocationFactory=new DefaultNamespacedLocationFactory(CConfiguration.create(),locationFactory);
  Assert.assertTrue(namespacedLocationFactory.list().isEmpty());
  Location defaultLoc=namespacedLocationFactory.get(Id.Namespace.DEFAULT);
  Id.Namespace ns1=Id.Namespace.from("String_Node_Str");
  Location ns1Loc=namespacedLocationFactory.get(ns1);
  Assert.assertNotEquals(defaultLoc,ns1Loc);
  defaultLoc.mkdirs();
  ns1Loc.mkdirs();
  Map<Id.Namespace,Location> expected=ImmutableMap.of(Id.Namespace.DEFAULT,defaultLoc,ns1,ns1Loc);
  Assert.assertEquals(expected,namespacedLocationFactory.list());
  Location sub1=namespacedLocationFactory.get(ns1,"String_Node_Str");
  Location sub2=namespacedLocationFactory.get(ns1,"String_Node_Str");
  Assert.assertNotEquals(sub1,sub2);
}

Fixed version (ground truth):
@Test public void testGet() throws IOException {
  LocationFactory locationFactory=new LocalLocationFactory(TEMP_FOLDER.newFolder());
  NamespacedLocationFactory namespacedLocationFactory=new DefaultNamespacedLocationFactory(CConfiguration.create(),locationFactory);
  Location defaultLoc=namespacedLocationFactory.get(Id.Namespace.DEFAULT);
  Id.Namespace ns1=Id.Namespace.from("String_Node_Str");
  Location ns1Loc=namespacedLocationFactory.get(ns1);
  Assert.assertNotEquals(defaultLoc,ns1Loc);
  Location sub1=namespacedLocationFactory.get(ns1,"String_Node_Str");
  Location sub2=namespacedLocationFactory.get(ns1,"String_Node_Str");
  Assert.assertNotEquals(sub1,sub2);
}
Program: 6377
Project: 6377
Buggy source:
@Override protected void configure(){
  bind(NotificationFeedManager.class).to(NoOpNotificationFeedManager.class);
}

Fixed version (ground truth):
@Override protected void configure(){
  bind(NotificationFeedManager.class).to(NoOpNotificationFeedManager.class);
  bind(NamespaceStore.class).to(DefaultNamespaceStore.class);
}
Program: 6378
Project: 6378
Buggy source:
@BeforeClass public static void init() throws IOException {
  cConf.set(Constants.CFG_LOCAL_DATA_DIR,tmpFolder.newFolder().getAbsolutePath());
  Injector injector=Guice.createInjector(new ConfigModule(cConf),new LocationRuntimeModule().getInMemoryModules(),new SystemDatasetRuntimeModule().getInMemoryModules(),new DataSetsModules().getInMemoryModules(),new TransactionMetricsModule(),new DataFabricLevelDBModule(),new DiscoveryRuntimeModule().getInMemoryModules(),new ExploreClientModule(),new ViewAdminModules().getInMemoryModules(),Modules.override(new StreamAdminModules().getStandaloneModules()).with(new AbstractModule(){
    @Override protected void configure(){
      bind(StreamMetaStore.class).to(InMemoryStreamMetaStore.class);
    }
  }
),new AbstractModule(){
    @Override protected void configure(){
      bind(NotificationFeedManager.class).to(NoOpNotificationFeedManager.class);
    }
  }
);
  locationFactory=injector.getInstance(LocationFactory.class);
  namespacedLocationFactory=injector.getInstance(NamespacedLocationFactory.class);
  streamAdmin=injector.getInstance(StreamAdmin.class);
  fileWriterFactory=injector.getInstance(StreamFileWriterFactory.class);
  streamCoordinatorClient=injector.getInstance(StreamCoordinatorClient.class);
  streamCoordinatorClient.startAndWait();
}

Fixed version (ground truth):
@BeforeClass public static void init() throws IOException {
  cConf.set(Constants.CFG_LOCAL_DATA_DIR,tmpFolder.newFolder().getAbsolutePath());
  Injector injector=Guice.createInjector(new ConfigModule(cConf),new LocationRuntimeModule().getInMemoryModules(),new SystemDatasetRuntimeModule().getInMemoryModules(),new DataSetsModules().getInMemoryModules(),new TransactionMetricsModule(),new DataFabricLevelDBModule(),new DiscoveryRuntimeModule().getInMemoryModules(),new ExploreClientModule(),new ViewAdminModules().getInMemoryModules(),Modules.override(new StreamAdminModules().getStandaloneModules()).with(new AbstractModule(){
    @Override protected void configure(){
      bind(StreamMetaStore.class).to(InMemoryStreamMetaStore.class);
    }
  }
),new AbstractModule(){
    @Override protected void configure(){
      bind(NotificationFeedManager.class).to(NoOpNotificationFeedManager.class);
      bind(NamespaceStore.class).to(DefaultNamespaceStore.class);
    }
  }
);
  locationFactory=injector.getInstance(LocationFactory.class);
  namespacedLocationFactory=injector.getInstance(NamespacedLocationFactory.class);
  namespaceStore=injector.getInstance(NamespaceStore.class);
  streamAdmin=injector.getInstance(StreamAdmin.class);
  fileWriterFactory=injector.getInstance(StreamFileWriterFactory.class);
  streamCoordinatorClient=injector.getInstance(StreamCoordinatorClient.class);
  streamCoordinatorClient.startAndWait();
}
Program: 6379
Project: 6379
Buggy source:
@Override protected void configure(){
  bind(NotificationFeedManager.class).to(NoOpNotificationFeedManager.class);
}

Fixed version (ground truth):
@Override protected void configure(){
  bind(NotificationFeedManager.class).to(NoOpNotificationFeedManager.class);
  bind(NamespaceStore.class).to(DefaultNamespaceStore.class);
}
Program: 6380
Project: 6380
Buggy source:
@Test public void testCleanupGeneration() throws Exception {
  String streamName="String_Node_Str";
  Id.Stream streamId=Id.Stream.from(Id.Namespace.DEFAULT,streamName);
  StreamAdmin streamAdmin=getStreamAdmin();
  streamAdmin.create(streamId);
  StreamConfig streamConfig=streamAdmin.getConfig(streamId);
  StreamFileJanitor janitor=new StreamFileJanitor(getCConfiguration(),getStreamAdmin(),getNamespacedLocationFactory());
  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()));
    }
  }
}

Fixed version (ground truth):
@Test public void testCleanupGeneration() throws Exception {
  String streamName="String_Node_Str";
  Id.Stream streamId=Id.Stream.from(Id.Namespace.DEFAULT,streamName);
  StreamAdmin streamAdmin=getStreamAdmin();
  streamAdmin.create(streamId);
  StreamConfig streamConfig=streamAdmin.getConfig(streamId);
  StreamFileJanitor janitor=new StreamFileJanitor(getCConfiguration(),getStreamAdmin(),getNamespacedLocationFactory(),getNamespaceStore());
  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: 6381
Project: 6381
Buggy source:
@Before public void setup() throws IOException {
  getNamespacedLocationFactory().get(Id.Namespace.DEFAULT).mkdirs();
}

Fixed version (ground truth):
@Before public void setup() throws Exception {
  getNamespaceStore().create(NamespaceMeta.DEFAULT);
  getNamespacedLocationFactory().get(Id.Namespace.DEFAULT).mkdirs();
}
Program: 6382
Project: 6382
Buggy source:
@Test public void testCleanupTTL() throws Exception {
  String streamName="String_Node_Str";
  Id.Stream streamId=Id.Stream.from(Id.Namespace.DEFAULT,streamName);
  StreamAdmin streamAdmin=getStreamAdmin();
  StreamFileJanitor janitor=new StreamFileJanitor(getCConfiguration(),getStreamAdmin(),getNamespacedLocationFactory());
  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());
}

Fixed version (ground truth):
@Test public void testCleanupTTL() throws Exception {
  String streamName="String_Node_Str";
  Id.Stream streamId=Id.Stream.from(Id.Namespace.DEFAULT,streamName);
  StreamAdmin streamAdmin=getStreamAdmin();
  StreamFileJanitor janitor=new StreamFileJanitor(getCConfiguration(),getStreamAdmin(),getNamespacedLocationFactory(),getNamespaceStore());
  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: 6383
Project: 6383
Buggy source:
@Test public void testCleanupDeletedStream() throws Exception {
  Id.Stream streamId=Id.Stream.from(Id.Namespace.DEFAULT,"String_Node_Str");
  StreamAdmin streamAdmin=getStreamAdmin();
  StreamFileJanitor janitor=new StreamFileJanitor(getCConfiguration(),streamAdmin,getNamespacedLocationFactory());
  streamAdmin.create(streamId);
  try (FileWriter<StreamEvent> writer=createWriter(streamId)){
    for (int i=0; i < 10; i++) {
      writer.append(StreamFileTestUtils.createEvent(i * 1000,"String_Node_Str" + i));
    }
  }
   streamAdmin.drop(streamId);
  janitor.cleanAll();
}

Fixed version (ground truth):
@Test public void testCleanupDeletedStream() throws Exception {
  Id.Stream streamId=Id.Stream.from(Id.Namespace.DEFAULT,"String_Node_Str");
  StreamAdmin streamAdmin=getStreamAdmin();
  StreamFileJanitor janitor=new StreamFileJanitor(getCConfiguration(),streamAdmin,getNamespacedLocationFactory(),getNamespaceStore());
  streamAdmin.create(streamId);
  try (FileWriter<StreamEvent> writer=createWriter(streamId)){
    for (int i=0; i < 10; i++) {
      writer.append(StreamFileTestUtils.createEvent(i * 1000,"String_Node_Str" + i));
    }
  }
   streamAdmin.drop(streamId);
  janitor.cleanAll();
}
Program: 6385
Project: 6385
Buggy source:
@Override protected void configure(){
  bind(MetricsCollectionService.class).to(NoOpMetricsCollectionService.class);
  bind(StreamConsumerStateStoreFactory.class).to(LevelDBStreamConsumerStateStoreFactory.class).in(Singleton.class);
  bind(StreamAdmin.class).to(FileStreamAdmin.class).in(Singleton.class);
  bind(StreamConsumerFactory.class).to(LevelDBStreamFileConsumerFactory.class).in(Singleton.class);
  bind(StreamFileWriterFactory.class).to(LocationStreamFileWriterFactory.class).in(Singleton.class);
  bind(StreamFileJanitorService.class).to(LocalStreamFileJanitorService.class).in(Scopes.SINGLETON);
  bind(StreamMetaStore.class).to(InMemoryStreamMetaStore.class).in(Scopes.SINGLETON);
  bind(HeartbeatPublisher.class).to(MockHeartbeatPublisher.class).in(Scopes.SINGLETON);
}

Fixed version (ground truth):
@Override protected void configure(){
  bind(MetricsCollectionService.class).to(NoOpMetricsCollectionService.class);
  bind(AbstractNamespaceClient.class).to(InMemoryNamespaceClient.class);
  bind(StreamConsumerStateStoreFactory.class).to(LevelDBStreamConsumerStateStoreFactory.class).in(Singleton.class);
  bind(StreamAdmin.class).to(FileStreamAdmin.class).in(Singleton.class);
  bind(StreamConsumerFactory.class).to(LevelDBStreamFileConsumerFactory.class).in(Singleton.class);
  bind(StreamFileWriterFactory.class).to(LocationStreamFileWriterFactory.class).in(Singleton.class);
  bind(StreamFileJanitorService.class).to(LocalStreamFileJanitorService.class).in(Scopes.SINGLETON);
  bind(StreamMetaStore.class).to(InMemoryStreamMetaStore.class).in(Scopes.SINGLETON);
  bind(HeartbeatPublisher.class).to(MockHeartbeatPublisher.class).in(Scopes.SINGLETON);
}
Program: 6386
Project: 6386
Buggy source:
/** 
 * Performs file cleanup for all streams.
 */
public void cleanAll() throws IOException {
  Map<Id.Namespace,Location> namespaceLocations=namespacedLocationFactory.list();
  if (namespaceLocations.size() == 0) {
    return;
  }
  for (  Location namespaceDir : namespaceLocations.values()) {
    Location streamBaseLocation=namespaceDir.append(streamBaseDirPath);
    if (!streamBaseLocation.exists()) {
      continue;
    }
    Location deletedLocation=StreamUtils.getDeletedLocation(streamBaseLocation);
    if (deletedLocation.exists()) {
      Locations.deleteContent(deletedLocation);
    }
    for (    Location streamLocation : StreamUtils.listAllStreams(streamBaseLocation)) {
      Id.Stream streamId=StreamUtils.getStreamIdFromLocation(streamLocation);
      long ttl=0L;
      if (isStreamExists(streamId)) {
        ttl=streamAdmin.getConfig(streamId).getTTL();
      }
      clean(streamLocation,ttl,System.currentTimeMillis());
    }
  }
}

Fixed version (ground truth):
/** 
 * Performs file cleanup for all streams.
 */
public void cleanAll() throws Exception {
  List<NamespaceMeta> namespaces=namespaceStore.list();
  for (  NamespaceMeta namespace : namespaces) {
    Location streamBaseLocation=namespacedLocationFactory.get(Id.Namespace.from(namespace.getName())).append(streamBaseDirPath);
    if (!streamBaseLocation.exists()) {
      continue;
    }
    Location deletedLocation=StreamUtils.getDeletedLocation(streamBaseLocation);
    if (deletedLocation.exists()) {
      Locations.deleteContent(deletedLocation);
    }
    for (    Location streamLocation : StreamUtils.listAllStreams(streamBaseLocation)) {
      Id.Stream streamId=StreamUtils.getStreamIdFromLocation(streamLocation);
      long ttl=0L;
      if (isStreamExists(streamId)) {
        ttl=streamAdmin.getConfig(streamId).getTTL();
      }
      clean(streamLocation,ttl,System.currentTimeMillis());
    }
  }
}
Program: 6387
Project: 6387
Buggy source:
@Inject public StreamFileJanitor(CConfiguration cConf,StreamAdmin streamAdmin,NamespacedLocationFactory namespacedLocationFactory){
  this.streamAdmin=streamAdmin;
  this.streamBaseDirPath=cConf.get(Constants.Stream.BASE_DIR);
  this.namespacedLocationFactory=namespacedLocationFactory;
}

Fixed version (ground truth):
@Inject public StreamFileJanitor(CConfiguration cConf,StreamAdmin streamAdmin,NamespacedLocationFactory namespacedLocationFactory,NamespaceStore namespaceStore){
  this.streamAdmin=streamAdmin;
  this.streamBaseDirPath=cConf.get(Constants.Stream.BASE_DIR);
  this.namespacedLocationFactory=namespacedLocationFactory;
  this.namespaceStore=namespaceStore;
}
Program: 6388
Project: 6388
Buggy source:
@Override protected void doStart(){
  executor=Executors.newSingleThreadScheduledExecutor(Threads.createDaemonThreadFactory("String_Node_Str"));
  executor.submit(new Runnable(){
    @Override public void run(){
      if (state() != State.RUNNING) {
        LOG.info("String_Node_Str");
        return;
      }
      LOG.debug("String_Node_Str");
      try {
        janitor.cleanAll();
        LOG.debug("String_Node_Str");
      }
 catch (      Throwable e) {
        LOG.warn("String_Node_Str",e.getMessage());
        LOG.debug("String_Node_Str",e);
      }
 finally {
        long now=System.currentTimeMillis();
        long delay=(now / cleanupPeriod + 1) * cleanupPeriod - now;
        if (delay <= 0) {
          executor.submit(this);
        }
 else {
          LOG.debug("String_Node_Str",delay);
          executor.schedule(this,delay,TimeUnit.MILLISECONDS);
        }
      }
    }
  }
);
  notifyStarted();
}

Fixed version (ground truth):
@Override protected void doStart(){
  executor=Executors.newSingleThreadScheduledExecutor(Threads.createDaemonThreadFactory("String_Node_Str"));
  executor.submit(new Runnable(){
    @Override public void run(){
      if (state() != State.RUNNING) {
        LOG.info("String_Node_Str");
        return;
      }
      LOG.debug("String_Node_Str");
      try {
        janitor.cleanAll();
        LOG.debug("String_Node_Str");
      }
 catch (      Throwable e) {
        LOG.warn("String_Node_Str",e.getMessage());
      }
 finally {
        long now=System.currentTimeMillis();
        long delay=(now / cleanupPeriod + 1) * cleanupPeriod - now;
        if (delay <= 0) {
          executor.submit(this);
        }
 else {
          LOG.debug("String_Node_Str",delay);
          executor.schedule(this,delay,TimeUnit.MILLISECONDS);
        }
      }
    }
  }
);
  notifyStarted();
}
Program: 6389
Project: 6389
Buggy source:
@Override public Module getDistributedModules(){
  return new AbstractModule(){
    @Override protected void configure(){
      bind(StreamFileJanitorService.class).to(DistributedStreamFileJanitorService.class).in(Scopes.SINGLETON);
      bind(StreamWriterSizeCollector.class).to(BasicStreamWriterSizeCollector.class).in(Scopes.SINGLETON);
      bind(StreamService.class).to(DistributedStreamService.class).in(Scopes.SINGLETON);
      Multibinder<HttpHandler> handlerBinder=Multibinder.newSetBinder(binder(),HttpHandler.class,Names.named(Constants.Stream.STREAM_HANDLER));
      handlerBinder.addBinding().to(StreamHandler.class);
      handlerBinder.addBinding().to(StreamFetchHandler.class);
      handlerBinder.addBinding().to(StreamViewHttpHandler.class);
      CommonHandlers.add(handlerBinder);
      bind(HeartbeatPublisher.class).to(NotificationHeartbeatPublisher.class).in(Scopes.SINGLETON);
      bind(StreamHttpService.class).in(Scopes.SINGLETON);
      bind(Key.get(new TypeLiteral<Supplier<Discoverable>>(){
      }
)).to(StreamHttpService.class);
    }
  }
;
}

Fixed version (ground truth):
@Override public Module getDistributedModules(){
  return new AbstractModule(){
    @Override protected void configure(){
      bind(StreamFileJanitorService.class).to(DistributedStreamFileJanitorService.class).in(Scopes.SINGLETON);
      bind(StreamWriterSizeCollector.class).to(BasicStreamWriterSizeCollector.class).in(Scopes.SINGLETON);
      bind(StreamService.class).to(DistributedStreamService.class).in(Scopes.SINGLETON);
      Multibinder<HttpHandler> handlerBinder=Multibinder.newSetBinder(binder(),HttpHandler.class,Names.named(Constants.Stream.STREAM_HANDLER));
      handlerBinder.addBinding().to(StreamHandler.class);
      handlerBinder.addBinding().to(StreamFetchHandler.class);
      handlerBinder.addBinding().to(StreamViewHttpHandler.class);
      CommonHandlers.add(handlerBinder);
      bind(HeartbeatPublisher.class).to(NotificationHeartbeatPublisher.class).in(Scopes.SINGLETON);
      bind(NamespaceStore.class).to(DefaultNamespaceStore.class).in(Scopes.SINGLETON);
      bind(StreamHttpService.class).in(Scopes.SINGLETON);
      bind(Key.get(new TypeLiteral<Supplier<Discoverable>>(){
      }
)).to(StreamHttpService.class);
    }
  }
;
}
Program: 6390
Project: 6390
Buggy source:
@Override protected void configure(){
  bind(StreamFileJanitorService.class).to(DistributedStreamFileJanitorService.class).in(Scopes.SINGLETON);
  bind(StreamWriterSizeCollector.class).to(BasicStreamWriterSizeCollector.class).in(Scopes.SINGLETON);
  bind(StreamService.class).to(DistributedStreamService.class).in(Scopes.SINGLETON);
  Multibinder<HttpHandler> handlerBinder=Multibinder.newSetBinder(binder(),HttpHandler.class,Names.named(Constants.Stream.STREAM_HANDLER));
  handlerBinder.addBinding().to(StreamHandler.class);
  handlerBinder.addBinding().to(StreamFetchHandler.class);
  handlerBinder.addBinding().to(StreamViewHttpHandler.class);
  CommonHandlers.add(handlerBinder);
  bind(HeartbeatPublisher.class).to(NotificationHeartbeatPublisher.class).in(Scopes.SINGLETON);
  bind(StreamHttpService.class).in(Scopes.SINGLETON);
  bind(Key.get(new TypeLiteral<Supplier<Discoverable>>(){
  }
)).to(StreamHttpService.class);
}

Fixed version (ground truth):
@Override protected void configure(){
  bind(StreamFileJanitorService.class).to(DistributedStreamFileJanitorService.class).in(Scopes.SINGLETON);
  bind(StreamWriterSizeCollector.class).to(BasicStreamWriterSizeCollector.class).in(Scopes.SINGLETON);
  bind(StreamService.class).to(DistributedStreamService.class).in(Scopes.SINGLETON);
  Multibinder<HttpHandler> handlerBinder=Multibinder.newSetBinder(binder(),HttpHandler.class,Names.named(Constants.Stream.STREAM_HANDLER));
  handlerBinder.addBinding().to(StreamHandler.class);
  handlerBinder.addBinding().to(StreamFetchHandler.class);
  handlerBinder.addBinding().to(StreamViewHttpHandler.class);
  CommonHandlers.add(handlerBinder);
  bind(HeartbeatPublisher.class).to(NotificationHeartbeatPublisher.class).in(Scopes.SINGLETON);
  bind(NamespaceStore.class).to(DefaultNamespaceStore.class).in(Scopes.SINGLETON);
  bind(StreamHttpService.class).in(Scopes.SINGLETON);
  bind(Key.get(new TypeLiteral<Supplier<Discoverable>>(){
  }
)).to(StreamHttpService.class);
}
Program: 6391
Project: 6391
Buggy source:
void State(ProgramRunStatus runStatus){
  this.runStatus=runStatus;
}

Fixed version (ground truth):
void State(ProgramRunStatus runStatus){
  this.runStatus=runStatus;
  this.programStatus=ProgramRunStatus.RUNNING == runStatus ? ProgramStatus.RUNNING : ProgramStatus.STOPPED;
}
Program: 6392
Project: 6392
Buggy source:
/** 
 * Returns a map where the pairs map from status to program status (e.g. {"status" : "RUNNING"}) or in case of an error in the input (e.g. invalid id, program not found), a map from statusCode to integer and error to error message (e.g. {"statusCode": 404, "error": "Program not found"})
 * @param id The Program Id to get the status of
 * @throws BadRequestException if program type is invalid
 * @throws NotFoundException if the application to which this program belongs was not found
 */
private StatusMap getStatus(final Id.Program id) throws BadRequestException, NotFoundException {
  if (id.getType() == null) {
    throw new BadRequestException(String.format("String_Node_Str",id.getId()));
  }
  ApplicationSpecification appSpec=store.getApplication(id.getApplication());
  if (appSpec == null) {
    throw new NotFoundException(Id.Application.from(id.getNamespaceId(),id.getApplicationId()));
  }
  String programStatus=getProgramStatus(id).getStatus();
  StatusMap statusMap=new StatusMap();
  statusMap.setStatus(programStatus);
  statusMap.setStatusCode(HttpResponseStatus.OK.getCode());
  return statusMap;
}

Fixed version (ground truth):
/** 
 * Returns status of a type specified by the type{flows,workflows,mapreduce,spark,services,schedules}.
 */
@GET @Path("String_Node_Str") public void getStatus(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String type,@PathParam("String_Node_Str") String id) throws NotFoundException, SchedulerException, BadRequestException {
  if (type.equals("String_Node_Str")) {
    getScheduleStatus(responder,appId,namespaceId,id);
    return;
  }
  ProgramType programType=ProgramType.valueOfCategoryName(type);
  Id.Program program=Id.Program.from(namespaceId,appId,programType,id);
  ProgramStatus programStatus=getProgramStatus(program);
  Map<String,String> status=ImmutableMap.of("String_Node_Str",programStatus.name());
  responder.sendJson(HttpResponseStatus.OK,status);
}
Program: 6393
Project: 6393
Buggy source:
/** 
 * Deletes queues.
 */
@DELETE @Path("String_Node_Str") public void deleteFlowQueues(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String flowId) throws Exception {
  Id.Program programId=Id.Program.from(namespaceId,appId,ProgramType.FLOW,flowId);
  try {
    ProgramStatus status=getProgramStatus(programId);
    if (status.getStatus().equals(HttpResponseStatus.NOT_FOUND.toString())) {
      responder.sendStatus(HttpResponseStatus.NOT_FOUND);
    }
 else     if (status.getStatus().equals("String_Node_Str")) {
      responder.sendString(HttpResponseStatus.FORBIDDEN,"String_Node_Str");
    }
 else {
      queueAdmin.dropAllForFlow(Id.Flow.from(programId.getApplication(),programId.getId()));
      FlowUtils.deleteFlowPendingMetrics(metricStore,namespaceId,appId,flowId);
      responder.sendStatus(HttpResponseStatus.OK);
    }
  }
 catch (  SecurityException e) {
    responder.sendStatus(HttpResponseStatus.UNAUTHORIZED);
  }
}

Fixed version (ground truth):
/** 
 * Deletes queues.
 */
@DELETE @Path("String_Node_Str") public void deleteFlowQueues(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String flowId) throws Exception {
  Id.Program programId=Id.Program.from(namespaceId,appId,ProgramType.FLOW,flowId);
  try {
    ProgramStatus status=getProgramStatus(programId);
    if (ProgramStatus.RUNNING == status) {
      responder.sendString(HttpResponseStatus.FORBIDDEN,"String_Node_Str");
    }
 else {
      queueAdmin.dropAllForFlow(Id.Flow.from(programId.getApplication(),programId.getId()));
      FlowUtils.deleteFlowPendingMetrics(metricStore,namespaceId,appId,flowId);
      responder.sendStatus(HttpResponseStatus.OK);
    }
  }
 catch (  SecurityException e) {
    responder.sendStatus(HttpResponseStatus.UNAUTHORIZED);
  }
}
Program: 6394
Project: 6394
Buggy source:
private boolean isRunning(Id.Program id) throws BadRequestException, NotFoundException {
  String programStatus=getStatus(id).getStatus();
  return programStatus != null && !"String_Node_Str".equals(programStatus);
}

Fixed version (ground truth):
private boolean isRunning(Id.Program id) throws BadRequestException, NotFoundException {
  return ProgramStatus.STOPPED != getProgramStatus(id);
}
Program: 6395
Project: 6395
Buggy source:
@DELETE @Path("String_Node_Str") public synchronized void deleteQueues(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId){
  Id.Namespace namespace=Id.Namespace.from(namespaceId);
  try {
    List<ProgramRecord> flows=listPrograms(namespace,ProgramType.FLOW,store);
    for (    ProgramRecord flow : flows) {
      String appId=flow.getApp();
      String flowId=flow.getName();
      Id.Program programId=Id.Program.from(namespace,appId,ProgramType.FLOW,flowId);
      ProgramStatus status=getProgramStatus(programId);
      if (!"String_Node_Str".equals(status.getStatus())) {
        responder.sendString(HttpResponseStatus.FORBIDDEN,String.format("String_Node_Str" + "String_Node_Str",flowId,appId,namespaceId));
        return;
      }
    }
    queueAdmin.dropAllInNamespace(namespace);
    FlowUtils.deleteFlowPendingMetrics(metricStore,namespaceId,null,null);
    responder.sendStatus(HttpResponseStatus.OK);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str" + namespace,e);
    responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,e.getMessage());
  }
}

Fixed version (ground truth):
@DELETE @Path("String_Node_Str") public synchronized void deleteQueues(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId){
  Id.Namespace namespace=Id.Namespace.from(namespaceId);
  try {
    List<ProgramRecord> flows=listPrograms(namespace,ProgramType.FLOW,store);
    for (    ProgramRecord flow : flows) {
      String appId=flow.getApp();
      String flowId=flow.getName();
      Id.Program programId=Id.Program.from(namespace,appId,ProgramType.FLOW,flowId);
      ProgramStatus status=getProgramStatus(programId);
      if (ProgramStatus.STOPPED != status) {
        responder.sendString(HttpResponseStatus.FORBIDDEN,String.format("String_Node_Str" + "String_Node_Str",flowId,appId,namespaceId));
        return;
      }
    }
    queueAdmin.dropAllInNamespace(namespace);
    FlowUtils.deleteFlowPendingMetrics(metricStore,namespaceId,null,null);
    responder.sendStatus(HttpResponseStatus.OK);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str" + namespace,e);
    responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,e.getMessage());
  }
}
Program: 6397
Project: 6397
Buggy source:
/** 
 * 'protected' for the workflow handler to use
 */
protected ProgramStatus getProgramStatus(Id.Program id,@Nullable String runId) throws NotFoundException {
  ProgramRuntimeService.RuntimeInfo runtimeInfo=findRuntimeInfo(id,runId);
  if (runtimeInfo == null) {
    if (id.getType() != ProgramType.WEBAPP) {
      ProgramSpecification spec=getProgramSpecification(id);
      if (spec == null) {
        throw new NotFoundException(id);
      }
      if (id.getType() == ProgramType.MAPREDUCE && !store.getRuns(id,ProgramRunStatus.RUNNING,0,Long.MAX_VALUE,1).isEmpty()) {
        return new ProgramStatus(id.getApplicationId(),id.getId(),"String_Node_Str");
      }
      return new ProgramStatus(id.getApplicationId(),id.getId(),"String_Node_Str");
    }
    try {
      Location webappLoc=Programs.programLocation(namespacedLocationFactory,appFabricDir,id);
      if (webappLoc != null && webappLoc.exists()) {
        return new ProgramStatus(id.getApplicationId(),id.getId(),"String_Node_Str");
      }
      throw new NotFoundException(id);
    }
 catch (    IOException ioe) {
      throw new NotFoundException(id,ioe);
    }
  }
  String status=controllerStateToString(runtimeInfo.getController().getState());
  return new ProgramStatus(id.getApplicationId(),id.getId(),status);
}

Fixed version (ground truth):
/** 
 * Returns the program status.
 * @param id the id of the program for which the status call is made
 * @return the status of the program
 * @throws BadRequestException if the program type is invalid
 * @throws NotFoundException if the application to which this program belongs was not found
 */
private ProgramStatus getProgramStatus(Id.Program id) throws BadRequestException, NotFoundException {
  if (id.getType() == null) {
    throw new BadRequestException(String.format("String_Node_Str",id.getId()));
  }
  ApplicationSpecification appSpec=store.getApplication(id.getApplication());
  if (appSpec == null) {
    throw new NotFoundException(Id.Application.from(id.getNamespaceId(),id.getApplicationId()));
  }
  ProgramRuntimeService.RuntimeInfo runtimeInfo=findRuntimeInfo(id,null);
  if (runtimeInfo == null) {
    if (id.getType() != ProgramType.WEBAPP) {
      ProgramSpecification spec=getProgramSpecification(id);
      if (spec == null) {
        throw new NotFoundException(id);
      }
      if (id.getType() == ProgramType.MAPREDUCE && !store.getRuns(id,ProgramRunStatus.RUNNING,0,Long.MAX_VALUE,1).isEmpty()) {
        return ProgramStatus.RUNNING;
      }
      return ProgramStatus.STOPPED;
    }
    try {
      Location webappLoc=Programs.programLocation(namespacedLocationFactory,appFabricDir,id);
      if (webappLoc != null && webappLoc.exists()) {
        return ProgramStatus.STOPPED;
      }
      throw new NotFoundException(id);
    }
 catch (    IOException ioe) {
      throw new NotFoundException(id,ioe);
    }
  }
  return runtimeInfo.getController().getState().getProgramStatus();
}
Program: 6398
Project: 6398
Buggy source:
@Test public void test() throws TimeoutException, InterruptedException, IOException {
  ApplicationManager appManager=deployApplication(HelloWorld.class);
  FlowManager flowManager=appManager.getFlowManager("String_Node_Str").start();
  StreamManager streamManager=getStreamManager("String_Node_Str");
  streamManager.send("String_Node_Str");
  streamManager.send("String_Node_Str");
  streamManager.send("String_Node_Str");
  streamManager.send("String_Node_Str");
  streamManager.send("String_Node_Str");
  try {
    RuntimeMetrics metrics=RuntimeStats.getFlowletMetrics("String_Node_Str","String_Node_Str","String_Node_Str");
    metrics.waitForProcessed(5,5,TimeUnit.SECONDS);
  }
  finally {
    flowManager.stop();
  }
  ServiceManager serviceManager=appManager.getServiceManager(HelloWorld.Greeting.SERVICE_NAME);
  serviceManager.start();
  serviceManager.waitForStatus(true);
  URL url=new URL(serviceManager.getServiceURL(),"String_Node_Str");
  HttpURLConnection connection=(HttpURLConnection)url.openConnection();
  Assert.assertEquals(HttpURLConnection.HTTP_OK,connection.getResponseCode());
  String response;
  try {
    response=new String(ByteStreams.toByteArray(connection.getInputStream()),Charsets.UTF_8);
  }
  finally {
    connection.disconnect();
  }
  Assert.assertEquals("String_Node_Str",response);
  appManager.stopAll();
}

Fixed version (ground truth):
@Test public void test() throws Exception {
  ApplicationManager appManager=deployApplication(HelloWorld.class);
  FlowManager flowManager=appManager.getFlowManager("String_Node_Str").start();
  Assert.assertTrue(flowManager.isRunning());
  StreamManager streamManager=getStreamManager("String_Node_Str");
  streamManager.send("String_Node_Str");
  streamManager.send("String_Node_Str");
  streamManager.send("String_Node_Str");
  streamManager.send("String_Node_Str");
  streamManager.send("String_Node_Str");
  try {
    RuntimeMetrics metrics=flowManager.getFlowletMetrics("String_Node_Str");
    metrics.waitForProcessed(5,5,TimeUnit.SECONDS);
  }
  finally {
    flowManager.stop();
    Assert.assertFalse(flowManager.isRunning());
  }
  ServiceManager serviceManager=appManager.getServiceManager(HelloWorld.Greeting.SERVICE_NAME).start();
  serviceManager.waitForStatus(true);
  URL url=new URL(serviceManager.getServiceURL(),"String_Node_Str");
  HttpURLConnection connection=(HttpURLConnection)url.openConnection();
  Assert.assertEquals(HttpURLConnection.HTTP_OK,connection.getResponseCode());
  String response;
  try {
    response=new String(ByteStreams.toByteArray(connection.getInputStream()),Charsets.UTF_8);
  }
  finally {
    connection.disconnect();
  }
  Assert.assertEquals("String_Node_Str",response);
}
Program: 6399
Project: 6399
Buggy source:
@Test public void test() throws Exception {
  ApplicationManager appManager=deployApplication(HelloWorld.class);
  FlowManager flowManager=appManager.getFlowManager("String_Node_Str").start();
  Assert.assertTrue(flowManager.isRunning());
  StreamManager streamManager=getStreamManager("String_Node_Str");
  streamManager.send("String_Node_Str");
  streamManager.send("String_Node_Str");
  streamManager.send("String_Node_Str");
  streamManager.send("String_Node_Str");
  streamManager.send("String_Node_Str");
  try {
    RuntimeMetrics metrics=flowManager.getFlowletMetrics("String_Node_Str");
    metrics.waitForProcessed(5,5,TimeUnit.SECONDS);
  }
  finally {
    flowManager.stop();
    Assert.assertFalse(flowManager.isRunning());
  }
  ServiceManager serviceManager=appManager.getServiceManager(HelloWorld.Greeting.SERVICE_NAME).start();
  serviceManager.waitForStatus(true);
  URL url=new URL(serviceManager.getServiceURL(15,TimeUnit.SECONDS),"String_Node_Str");
  HttpURLConnection connection=(HttpURLConnection)url.openConnection();
  Assert.assertEquals(HttpURLConnection.HTTP_OK,connection.getResponseCode());
  String response;
  try {
    response=new String(ByteStreams.toByteArray(connection.getInputStream()),Charsets.UTF_8);
  }
  finally {
    connection.disconnect();
  }
  Assert.assertEquals("String_Node_Str",response);
}

Fixed version (ground truth):
@Test public void test() throws Exception {
  ApplicationManager appManager=deployApplication(HelloWorld.class);
  FlowManager flowManager=appManager.getFlowManager("String_Node_Str").start();
  Assert.assertTrue(flowManager.isRunning());
  StreamManager streamManager=getStreamManager("String_Node_Str");
  streamManager.send("String_Node_Str");
  streamManager.send("String_Node_Str");
  streamManager.send("String_Node_Str");
  streamManager.send("String_Node_Str");
  streamManager.send("String_Node_Str");
  try {
    RuntimeMetrics metrics=flowManager.getFlowletMetrics("String_Node_Str");
    metrics.waitForProcessed(5,5,TimeUnit.SECONDS);
  }
  finally {
    flowManager.stop();
    Assert.assertFalse(flowManager.isRunning());
  }
  ServiceManager serviceManager=appManager.getServiceManager(HelloWorld.Greeting.SERVICE_NAME).start();
  serviceManager.waitForStatus(true);
  URL url=new URL(serviceManager.getServiceURL(),"String_Node_Str");
  HttpURLConnection connection=(HttpURLConnection)url.openConnection();
  Assert.assertEquals(HttpURLConnection.HTTP_OK,connection.getResponseCode());
  String response;
  try {
    response=new String(ByteStreams.toByteArray(connection.getInputStream()),Charsets.UTF_8);
  }
  finally {
    connection.disconnect();
  }
  Assert.assertEquals("String_Node_Str",response);
}
Program: 6401
Project: 6401
Buggy source:
@Override public Id.NamespacedId deserialize(JsonElement json,Type typeOfT,JsonDeserializationContext context) throws JsonParseException {
  JsonObject jsonObj=json.getAsJsonObject();
  JsonObject id=jsonObj.getAsJsonObject("String_Node_Str");
  String type=jsonObj.get("String_Node_Str").getAsString();
switch (type) {
case "String_Node_Str":
    return deserializeApplicationId(id);
case "String_Node_Str":
  return deserializeProgramId(id);
case "String_Node_Str":
return deserializeFlowId(id);
case "String_Node_Str":
return deserializeFlowletId(id);
case "String_Node_Str":
return deserializeServiceId(id);
case "String_Node_Str":
return deserializeSchedule(id);
case "String_Node_Str":
return deserializeWorkerId(id);
case "String_Node_Str":
return deserializeWorkflowId(id);
case "String_Node_Str":
return deserializeDatasetInstanceId(id);
case "String_Node_Str":
return deserializeStreamId(id);
case "String_Node_Str":
return deserializeArtifactId(id);
default :
throw new UnsupportedOperationException(String.format("String_Node_Str" + "String_Node_Str",type,Id.Application.class.getSimpleName(),Id.Program.class.getSimpleName(),Id.Flow.class.getSimpleName(),Id.Flow.Flowlet.class.getSimpleName(),Id.Service.class.getSimpleName(),Id.Schedule.class.getSimpleName(),Id.Worker.class.getSimpleName(),Id.Workflow.class.getSimpleName(),Id.DatasetInstance.class.getSimpleName(),Id.Stream.class.getSimpleName()));
}
}

Fixed version (ground truth):
@Override public Id.NamespacedId deserialize(JsonElement json,Type typeOfT,JsonDeserializationContext context) throws JsonParseException {
  JsonObject jsonObj=json.getAsJsonObject();
  JsonObject id=jsonObj.getAsJsonObject("String_Node_Str");
  String type=jsonObj.get("String_Node_Str").getAsString();
switch (type) {
case "String_Node_Str":
    return deserializeApplicationId(id);
case "String_Node_Str":
  return deserializeProgramId(id);
case "String_Node_Str":
return deserializeFlowId(id);
case "String_Node_Str":
return deserializeFlowletId(id);
case "String_Node_Str":
return deserializeServiceId(id);
case "String_Node_Str":
return deserializeSchedule(id);
case "String_Node_Str":
return deserializeWorkerId(id);
case "String_Node_Str":
return deserializeWorkflowId(id);
case "String_Node_Str":
return deserializeDatasetInstanceId(id);
case "String_Node_Str":
return deserializeStreamId(id);
case "String_Node_Str":
return deserializeArtifactId(id);
default :
throw new UnsupportedOperationException(String.format("String_Node_Str" + "String_Node_Str",type,Id.Application.class.getSimpleName(),Id.Program.class.getSimpleName(),Id.Flow.class.getSimpleName(),Id.Flow.Flowlet.class.getSimpleName(),Id.Service.class.getSimpleName(),Id.Schedule.class.getSimpleName(),Id.Worker.class.getSimpleName(),Id.Workflow.class.getSimpleName(),Id.DatasetInstance.class.getSimpleName(),Id.Stream.class.getSimpleName(),Id.Artifact.class.getSimpleName()));
}
}
Program: 6402
Project: 6402
Buggy source:
/** 
 * Sets up a   {@link DatasetFramework} instance for standalone usage.  NOTE: should NOT be used by applications!!!
 */
private void initializeDSFramework(CConfiguration cConf,DatasetFramework datasetFramework,boolean includeNewDatasets) throws IOException, DatasetManagementException {
  DatasetMetaTableUtil.setupDatasets(datasetFramework);
  if (includeNewDatasets) {
    ArtifactStore.setupDatasets(datasetFramework);
  }
  DefaultStore.setupDatasets(datasetFramework);
  DefaultConfigStore.setupDatasets(datasetFramework);
  LogSaverTableUtil.setupDatasets(datasetFramework);
  ScheduleStoreTableUtil.setupDatasets(datasetFramework);
  DefaultMetricDatasetFactory factory=new DefaultMetricDatasetFactory(cConf,datasetFramework);
  DefaultMetricDatasetFactory.setupDatasets(factory);
  UsageRegistry.setupDatasets(datasetFramework);
}

Fixed version (ground truth):
/** 
 * Sets up a   {@link DatasetFramework} instance for standalone usage.  NOTE: should NOT be used by applications!!!
 */
private void initializeDSFramework(CConfiguration cConf,DatasetFramework datasetFramework,boolean includeNewDatasets) throws IOException, DatasetManagementException {
  DatasetMetaTableUtil.setupDatasets(datasetFramework);
  if (includeNewDatasets) {
    ArtifactStore.setupDatasets(datasetFramework);
    DefaultBusinessMetadataStore.setupDatasets(datasetFramework);
    LineageStore.setupDatasets(datasetFramework);
  }
  DefaultStore.setupDatasets(datasetFramework);
  DefaultConfigStore.setupDatasets(datasetFramework);
  LogSaverTableUtil.setupDatasets(datasetFramework);
  ScheduleStoreTableUtil.setupDatasets(datasetFramework);
  DefaultMetricDatasetFactory factory=new DefaultMetricDatasetFactory(cConf,datasetFramework);
  DefaultMetricDatasetFactory.setupDatasets(factory);
  UsageRegistry.setupDatasets(datasetFramework);
}
Program: 6403
Project: 6403
Buggy source:
/** 
 * Constructs an instance by parsing the given string. If the string does not match the version pattern,  {@link #getVersion()} will return null.
 * @param str the version string.
 * @param matchSuffix if {@code true}, try to match the version pattern by the suffix of the string. Otherwise match the whole string.
 */
public ArtifactVersion(String str,boolean matchSuffix){
  String tmpVersion=null;
  Integer major=null;
  Integer minor=null;
  Integer fix=null;
  String suffix=null;
  if (str != null) {
    Matcher matcher=PATTERN.matcher(str);
    boolean matches=matchSuffix ? (matcher.find()) : matcher.matches();
    if (matches) {
      tmpVersion=matcher.group(0);
      major=valueOf(matcher.group(1));
      minor=valueOf(matcher.group(2));
      fix=valueOf(matcher.group(3));
      suffix=matcher.group(4);
    }
  }
  this.version=tmpVersion;
  this.major=major;
  this.minor=minor;
  this.fix=fix;
  this.suffix=suffix;
}

Fixed version (ground truth):
/** 
 * Constructs an instance by parsing the given string. If the string does not match the version pattern,  {@link #getVersion()} will return null.
 * @param str the version string.
 * @param matchSuffix if {@code true}, try to match the version pattern by the suffix of the string. Otherwise match the whole string.
 */
public ArtifactVersion(String str,boolean matchSuffix){
  String tmpVersion=null;
  Integer major=null;
  Integer minor=null;
  Integer fix=null;
  String suffix=null;
  if (str != null) {
    Matcher matcher=matchSuffix ? SUFFIX_PATTERN.matcher(str) : PATTERN.matcher(str);
    boolean matches=matchSuffix ? (matcher.find()) : matcher.matches();
    if (matches) {
      tmpVersion=matchSuffix ? matcher.group(0).substring(1) : matcher.group(0);
      major=valueOf(matcher.group(1));
      minor=valueOf(matcher.group(2));
      fix=valueOf(matcher.group(3));
      suffix=matcher.group(4);
    }
  }
  this.version=tmpVersion;
  this.major=major;
  this.minor=minor;
  this.fix=fix;
  this.suffix=suffix;
}