nus-yam/ex-repair huggingface dataset:
Program: 7203
Project: 7203
Buggy source:
/** 
 * Upgrades the   {@link DatasetModuleMeta} for namespaceThe system modules are written as it is and the user module meta is written with new jarLocation which is under namespace
 * @param olddatasetModuleMeta the old {@link DatasetModuleMeta}
 * @param newDatasetTypeMDS the new {@link DatasetTypeMDS} where the new moduleMeta will be written
 * @throws IOException
 */
private void upgradeDatasetModuleMeta(DatasetModuleMeta olddatasetModuleMeta,DatasetTypeMDS newDatasetTypeMDS) throws IOException {
  DatasetModuleMeta newDatasetModuleMeta;
  LOG.info("String_Node_Str",olddatasetModuleMeta.getName());
  if (olddatasetModuleMeta.getJarLocation() == null) {
    newDatasetModuleMeta=olddatasetModuleMeta;
  }
 else {
    Location oldJarLocation=locationFactory.create(olddatasetModuleMeta.getJarLocation());
    Location newJarLocation=updateUserDatasetModuleJarLocation(oldJarLocation,olddatasetModuleMeta.getClassName(),Constants.DEFAULT_NAMESPACE);
    newDatasetModuleMeta=new DatasetModuleMeta(olddatasetModuleMeta.getName(),olddatasetModuleMeta.getClassName(),newJarLocation.toURI(),olddatasetModuleMeta.getTypes(),olddatasetModuleMeta.getUsesModules());
    Collection<String> usedByModules=olddatasetModuleMeta.getUsedByModules();
    for (    String moduleName : usedByModules) {
      newDatasetModuleMeta.addUsedByModule(moduleName);
    }
    newDatasetModuleMeta=olddatasetModuleMeta;
    renameLocation(oldJarLocation,newJarLocation);
  }
  newDatasetTypeMDS.writeModule(Constants.DEFAULT_NAMESPACE_ID,newDatasetModuleMeta);
}

Fixed version (ground truth):
/** 
 * Upgrades the   {@link DatasetModuleMeta} for namespaceThe system modules are written as it is and the user module meta is written with new jarLocation which is under namespace
 * @param olddatasetModuleMeta the old {@link DatasetModuleMeta}
 * @param newDatasetTypeMDS the new {@link DatasetTypeMDS} where the new moduleMeta will be written
 * @throws IOException
 */
private void upgradeDatasetModuleMeta(DatasetModuleMeta olddatasetModuleMeta,DatasetTypeMDS newDatasetTypeMDS) throws IOException {
  DatasetModuleMeta newDatasetModuleMeta;
  LOG.info("String_Node_Str",olddatasetModuleMeta.getName());
  if (olddatasetModuleMeta.getJarLocation() == null) {
    newDatasetModuleMeta=olddatasetModuleMeta;
  }
 else {
    Location oldJarLocation=locationFactory.create(olddatasetModuleMeta.getJarLocation());
    Location newJarLocation=updateUserDatasetModuleJarLocation(oldJarLocation,olddatasetModuleMeta.getClassName(),Constants.DEFAULT_NAMESPACE);
    newDatasetModuleMeta=new DatasetModuleMeta(olddatasetModuleMeta.getName(),olddatasetModuleMeta.getClassName(),newJarLocation.toURI(),olddatasetModuleMeta.getTypes(),olddatasetModuleMeta.getUsesModules());
    Collection<String> usedByModules=olddatasetModuleMeta.getUsedByModules();
    for (    String moduleName : usedByModules) {
      newDatasetModuleMeta.addUsedByModule(moduleName);
    }
    renameLocation(oldJarLocation,newJarLocation);
  }
  newDatasetTypeMDS.writeModule(Constants.DEFAULT_NAMESPACE_ID,newDatasetModuleMeta);
}
Program: 7204
Project: 7204
Buggy source:
@Override protected void configure(){
  bind(AbstractNamespaceClient.class).to(DiscoveryNamespaceClient.class);
}

Fixed version (ground truth):
@Override protected void configure(){
  bind(Scheduler.class).annotatedWith(Assisted.class).toInstance(createNoopScheduler());
}
Program: 7205
Project: 7205
Buggy source:
@BeforeClass public static void before() throws Exception {
  lf=new LocalLocationFactory();
  temp=TMP_FOLDER.newFolder("String_Node_Str");
}

Fixed version (ground truth):
@BeforeClass public static void before() throws Exception {
  lf=new LocalLocationFactory();
  temp=TMP_FOLDER.newFolder("String_Node_Str");
  NamespaceAdmin namespaceAdmin=AppFabricTestHelper.getInjector().getInstance(NamespaceAdmin.class);
  namespaceAdmin.createNamespace(Constants.DEFAULT_NAMESPACE_META);
}
Program: 7206
Project: 7206
Buggy source:
private void verifyReservedCreate() throws AlreadyExistsException, IOException, UnauthorizedException {
  NamespaceMeta.Builder builder=new NamespaceMeta.Builder();
  builder.setName(Constants.DEFAULT_NAMESPACE_ID);
  try {
    namespaceClient.create(builder.build());
    Assert.fail(String.format("String_Node_Str",Constants.DEFAULT_NAMESPACE_ID));
  }
 catch (  BadRequestException e) {
  }
  builder.setName(Constants.SYSTEM_NAMESPACE_ID);
  try {
    namespaceClient.create(builder.build());
    Assert.fail(String.format("String_Node_Str",Constants.SYSTEM_NAMESPACE_ID));
  }
 catch (  BadRequestException e) {
  }
}

Fixed version (ground truth):
private void verifyReservedCreate() throws Exception {
  NamespaceMeta.Builder builder=new NamespaceMeta.Builder();
  builder.setName(Constants.DEFAULT_NAMESPACE_ID);
  try {
    namespaceClient.create(builder.build());
    Assert.fail(String.format("String_Node_Str",Constants.DEFAULT_NAMESPACE_ID));
  }
 catch (  BadRequestException e) {
  }
  builder.setName(Constants.SYSTEM_NAMESPACE_ID);
  try {
    namespaceClient.create(builder.build());
    Assert.fail(String.format("String_Node_Str",Constants.SYSTEM_NAMESPACE_ID));
  }
 catch (  BadRequestException e) {
  }
}
Program: 7207
Project: 7207
Buggy source:
public void create(NamespaceMeta namespaceMeta) throws AlreadyExistsException, BadRequestException, IOException, UnauthorizedException {
  URL url=resolve(String.format("String_Node_Str",namespaceMeta.getName()));
  HttpResponse response=execute(HttpRequest.put(url).withBody(new Gson().toJson(namespaceMeta)).build());
  String responseBody=response.getResponseBodyAsString();
  if (response.getResponseCode() == HttpURLConnection.HTTP_OK) {
    if (responseBody != null && responseBody.equals(String.format("String_Node_Str",namespaceMeta.getName()))) {
      throw new AlreadyExistsException(NAMESPACE_ENTITY_TYPE,namespaceMeta.getName());
    }
    return;
  }
  if (response.getResponseCode() == HttpURLConnection.HTTP_BAD_REQUEST) {
    throw new BadRequestException("String_Node_Str" + responseBody);
  }
  throw new IOException("String_Node_Str" + "String_Node_Str");
}

Fixed version (ground truth):
public void create(NamespaceMeta namespaceMeta) throws Exception {
  URL url=resolve(String.format("String_Node_Str",namespaceMeta.getName()));
  HttpResponse response=execute(HttpRequest.put(url).withBody(new Gson().toJson(namespaceMeta)).build());
  String responseBody=response.getResponseBodyAsString();
  if (response.getResponseCode() == HttpURLConnection.HTTP_OK) {
    if (responseBody != null && responseBody.equals(String.format("String_Node_Str",namespaceMeta.getName()))) {
      throw new AlreadyExistsException(NAMESPACE_ENTITY_TYPE,namespaceMeta.getName());
    }
    return;
  }
  if (response.getResponseCode() == HttpURLConnection.HTTP_BAD_REQUEST) {
    throw new BadRequestException("String_Node_Str" + responseBody);
  }
  throw new IOException("String_Node_Str" + "String_Node_Str");
}
Program: 7208
Project: 7208
Buggy source:
@BeforeClass public static void init() throws IOException {
  zkServer=InMemoryZKServer.builder().setDataDir(tmpFolder.newFolder()).build();
  zkServer.startAndWait();
  Configuration hConf=new Configuration();
  hConf.set(MiniDFSCluster.HDFS_MINIDFS_BASEDIR,tmpFolder.newFolder().getAbsolutePath());
  dfsCluster=new MiniDFSCluster.Builder(hConf).numDataNodes(1).build();
  final FileSystem fileSystem=dfsCluster.getFileSystem();
  CConfiguration cConf=CConfiguration.create();
  cConf.set(Constants.Zookeeper.QUORUM,zkServer.getConnectionStr());
  Injector injector=Guice.createInjector(new ConfigModule(cConf),new ZKClientModule(),new DiscoveryRuntimeModule().getDistributedModules(),new DataFabricModules().getDistributedModules(),new DataSetsModules().getDistributedModules(),new TransactionMetricsModule(),new NotificationFeedServiceRuntimeModule().getInMemoryModules(),new AbstractModule(){
    @Override protected void configure(){
      bind(LocationFactory.class).toInstance(new HDFSLocationFactory(fileSystem));
    }
  }
,Modules.override(new StreamAdminModules().getDistributedModules()).with(new AbstractModule(){
    @Override protected void configure(){
      bind(StreamMetaStore.class).to(InMemoryStreamMetaStore.class);
    }
  }
));
  zkClient=injector.getInstance(ZKClientService.class);
  zkClient.startAndWait();
  streamAdmin=injector.getInstance(StreamAdmin.class);
  coordinatorClient=injector.getInstance(StreamCoordinatorClient.class);
  coordinatorClient.startAndWait();
}

Fixed version (ground truth):
@BeforeClass public static void init() throws IOException {
  zkServer=InMemoryZKServer.builder().setDataDir(tmpFolder.newFolder()).build();
  zkServer.startAndWait();
  Configuration hConf=new Configuration();
  hConf.set(MiniDFSCluster.HDFS_MINIDFS_BASEDIR,tmpFolder.newFolder().getAbsolutePath());
  dfsCluster=new MiniDFSCluster.Builder(hConf).numDataNodes(1).build();
  final FileSystem fileSystem=dfsCluster.getFileSystem();
  CConfiguration cConf=CConfiguration.create();
  cConf.set(Constants.Zookeeper.QUORUM,zkServer.getConnectionStr());
  Injector injector=Guice.createInjector(new ConfigModule(cConf),new ZKClientModule(),new DiscoveryRuntimeModule().getDistributedModules(),new DataFabricModules().getDistributedModules(),new DataSetsModules().getDistributedModules(),new TransactionMetricsModule(),new NotificationFeedServiceRuntimeModule().getInMemoryModules(),new AbstractModule(){
    @Override protected void configure(){
      bind(LocationFactory.class).toInstance(new HDFSLocationFactory(fileSystem));
    }
  }
,Modules.override(new StreamAdminModules().getDistributedModules()).with(new AbstractModule(){
    @Override protected void configure(){
      bind(StreamMetaStore.class).to(InMemoryStreamMetaStore.class);
    }
  }
));
  zkClient=injector.getInstance(ZKClientService.class);
  zkClient.startAndWait();
  setupNamespaces(injector.getInstance(LocationFactory.class));
  streamAdmin=injector.getInstance(StreamAdmin.class);
  coordinatorClient=injector.getInstance(StreamCoordinatorClient.class);
  coordinatorClient.startAndWait();
}
Program: 7209
Project: 7209
Buggy source:
@BeforeClass public static void init() throws IOException {
  CConfiguration cConf=CConfiguration.create();
  cConf.set(Constants.CFG_LOCAL_DATA_DIR,tmpFolder.newFolder().getAbsolutePath());
  Injector injector=Guice.createInjector(new ConfigModule(cConf),new DiscoveryRuntimeModule().getInMemoryModules(),new DataFabricModules().getInMemoryModules(),new LocationRuntimeModule().getInMemoryModules(),new TransactionMetricsModule(),new NotificationFeedServiceRuntimeModule().getInMemoryModules(),Modules.override(new StreamAdminModules().getInMemoryModules()).with(new AbstractModule(){
    @Override protected void configure(){
      bind(StreamMetaStore.class).to(InMemoryStreamMetaStore.class);
    }
  }
));
  streamAdmin=injector.getInstance(StreamAdmin.class);
  coordinatorClient=injector.getInstance(StreamCoordinatorClient.class);
  coordinatorClient.startAndWait();
}

Fixed version (ground truth):
@BeforeClass public static void init() throws IOException {
  CConfiguration cConf=CConfiguration.create();
  cConf.set(Constants.CFG_LOCAL_DATA_DIR,tmpFolder.newFolder().getAbsolutePath());
  Injector injector=Guice.createInjector(new ConfigModule(cConf),new DiscoveryRuntimeModule().getInMemoryModules(),new DataFabricModules().getInMemoryModules(),new LocationRuntimeModule().getInMemoryModules(),new TransactionMetricsModule(),new NotificationFeedServiceRuntimeModule().getInMemoryModules(),Modules.override(new StreamAdminModules().getInMemoryModules()).with(new AbstractModule(){
    @Override protected void configure(){
      bind(StreamMetaStore.class).to(InMemoryStreamMetaStore.class);
    }
  }
));
  setupNamespaces(injector.getInstance(LocationFactory.class));
  streamAdmin=injector.getInstance(StreamAdmin.class);
  coordinatorClient=injector.getInstance(StreamCoordinatorClient.class);
  coordinatorClient.startAndWait();
}
Program: 7210
Project: 7210
Buggy source:
@Test public void streamPublishesHeartbeatTest() throws Exception {
  final int entries=10;
  final String streamName="String_Node_Str";
  final Id.Stream streamId=Id.Stream.from(Constants.DEFAULT_NAMESPACE,streamName);
  HttpURLConnection urlConn=openURL(String.format("String_Node_Str",hostname,port,streamName),HttpMethod.PUT);
  Assert.assertEquals(HttpResponseStatus.OK.getCode(),urlConn.getResponseCode());
  urlConn.disconnect();
  for (int i=0; i < entries; ++i) {
    urlConn=openURL(String.format("String_Node_Str",hostname,port,streamName),HttpMethod.POST);
    urlConn.setDoOutput(true);
    urlConn.addRequestProperty("String_Node_Str",Integer.toString(i));
    urlConn.getOutputStream().write(TWO_BYTES);
    Assert.assertEquals(HttpResponseStatus.OK.getCode(),urlConn.getResponseCode());
    urlConn.disconnect();
  }
  TimeUnit.SECONDS.sleep(Constants.Stream.HEARTBEAT_INTERVAL + 1);
  StreamWriterHeartbeat heartbeat=heartbeatPublisher.getHeartbeat();
  Assert.assertNotNull(heartbeat);
  Assert.assertEquals(1,heartbeat.getStreamsSizes().size());
  Long streamSize=heartbeat.getStreamsSizes().get(streamId);
  Assert.assertNotNull(streamSize);
  Assert.assertEquals(entries * TWO_BYTES.length,(long)streamSize);
}

Fixed version (ground truth):
@Test public void streamPublishesHeartbeatTest() throws Exception {
  final int entries=10;
  final String streamName="String_Node_Str";
  final Id.Stream streamId=Id.Stream.from(Constants.DEFAULT_NAMESPACE,streamName);
  streamAdmin.create(streamId);
  streamMetaStore.addStream(streamId);
  for (int i=0; i < entries; ++i) {
    HttpURLConnection urlConn=openURL(String.format("String_Node_Str",hostname,port,streamName),HttpMethod.POST);
    urlConn.setDoOutput(true);
    urlConn.addRequestProperty("String_Node_Str",Integer.toString(i));
    urlConn.getOutputStream().write(TWO_BYTES);
    Assert.assertEquals(HttpResponseStatus.OK.getCode(),urlConn.getResponseCode());
    urlConn.disconnect();
  }
  TimeUnit.SECONDS.sleep(Constants.Stream.HEARTBEAT_INTERVAL + 1);
  StreamWriterHeartbeat heartbeat=heartbeatPublisher.getHeartbeat();
  Assert.assertNotNull(heartbeat);
  Assert.assertEquals(1,heartbeat.getStreamsSizes().size());
  Long streamSize=heartbeat.getStreamsSizes().get(streamId);
  Assert.assertNotNull(streamSize);
  Assert.assertEquals(entries * TWO_BYTES.length,(long)streamSize);
}
Program: 7212
Project: 7212
Buggy source:
@Test public void testCreateExist() throws Exception {
  StreamAdmin streamAdmin=getStreamAdmin();
  String streamName="String_Node_Str";
  Id.Stream streamId=Id.Stream.from("String_Node_Str",streamName);
  Id.Stream otherStreamId=Id.Stream.from("String_Node_Str",streamName);
  Assert.assertFalse(streamAdmin.exists(streamId));
  Assert.assertFalse(streamAdmin.exists(otherStreamId));
  streamAdmin.create(streamId);
  Assert.assertTrue(streamAdmin.exists(streamId));
  Assert.assertFalse(streamAdmin.exists(otherStreamId));
  streamAdmin.create(otherStreamId);
  Assert.assertTrue(streamAdmin.exists(otherStreamId));
}

Fixed version (ground truth):
@Test public void testCreateExist() throws Exception {
  StreamAdmin streamAdmin=getStreamAdmin();
  String streamName="String_Node_Str";
  Id.Stream streamId=Id.Stream.from(FOO_NAMESPACE,streamName);
  Id.Stream otherStreamId=Id.Stream.from(OTHER_NAMESPACE,streamName);
  Assert.assertFalse(streamAdmin.exists(streamId));
  Assert.assertFalse(streamAdmin.exists(otherStreamId));
  streamAdmin.create(streamId);
  Assert.assertTrue(streamAdmin.exists(streamId));
  Assert.assertFalse(streamAdmin.exists(otherStreamId));
  streamAdmin.create(otherStreamId);
  Assert.assertTrue(streamAdmin.exists(otherStreamId));
}
Program: 7213
Project: 7213
Buggy source:
@Test public void testDropAllInNamespace() throws Exception {
  StreamAdmin streamAdmin=getStreamAdmin();
  Id.Stream otherStream=Id.Stream.from("String_Node_Str","String_Node_Str");
  String fooNamespace="String_Node_Str";
  List<Id.Stream> fooStreams=Lists.newArrayList();
  for (int i=0; i < 4; i++) {
    fooStreams.add(Id.Stream.from(fooNamespace,"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(fooNamespace));
  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.assertEquals(0,getStreamSize(defaultStream));
  }
  Assert.assertNotEquals(0,getStreamSize(otherStream));
  streamAdmin.truncate(otherStream);
  Assert.assertEquals(0,getStreamSize(otherStream));
}
Program: 7214
Project: 7214
Buggy source:
private DatasetSpecification migrateDatasetSpec(DatasetSpecification oldSpec){
  Id.DatasetInstance dsId=from(oldSpec.getName());
  String newDatasetName=dsId.getId();
  DatasetSpecification.Builder builder=DatasetSpecification.builder(newDatasetName,oldSpec.getType()).properties(oldSpec.getProperties());
  for (  DatasetSpecification embeddedDsSpec : oldSpec.getSpecifications().values()) {
    LOG.debug("String_Node_Str",embeddedDsSpec);
    DatasetSpecification migratedEmbeddedSpec=migrateDatasetSpec(embeddedDsSpec);
    LOG.debug("String_Node_Str",migratedEmbeddedSpec);
    builder.datasets(migratedEmbeddedSpec);
  }
  return builder.build();
}

Fixed version (ground truth):
private DatasetSpecification migrateDatasetSpec(DatasetSpecification oldSpec,String newDatasetName){
  DatasetSpecification.Builder builder=DatasetSpecification.builder(newDatasetName,oldSpec.getType()).properties(oldSpec.getProperties());
  for (  Map.Entry<String,DatasetSpecification> dsSpecEntry : oldSpec.getSpecifications().entrySet()) {
    DatasetSpecification embeddedDsSpec=dsSpecEntry.getValue();
    LOG.debug("String_Node_Str",embeddedDsSpec);
    DatasetSpecification migratedEmbeddedSpec=migrateDatasetSpec(embeddedDsSpec,dsSpecEntry.getKey());
    LOG.debug("String_Node_Str",migratedEmbeddedSpec);
    builder.datasets(migratedEmbeddedSpec);
  }
  return builder.build();
}
Program: 7216
Project: 7216
Buggy source:
/** 
 * Construct the AppFabricServer with service factory and configuration coming from guice injection.
 */
@Inject public AppFabricServer(CConfiguration configuration,DiscoveryService discoveryService,SchedulerService schedulerService,NotificationService notificationService,@Named(Constants.AppFabric.SERVER_ADDRESS) InetAddress hostname,@Named("String_Node_Str") Set<HttpHandler> handlers,@Nullable MetricsCollectionService metricsCollectionService,ProgramRuntimeService programRuntimeService,AdapterService adapterService,@Named("String_Node_Str") Set<String> servicesNames,@Named("String_Node_Str") Set<String> handlerHookNames,NamespaceAdmin namespaceAdmin){
  this.hostname=hostname;
  this.discoveryService=discoveryService;
  this.schedulerService=schedulerService;
  this.handlers=handlers;
  this.configuration=configuration;
  this.metricsCollectionService=metricsCollectionService;
  this.programRuntimeService=programRuntimeService;
  this.adapterService=adapterService;
  this.notificationService=notificationService;
  this.servicesNames=servicesNames;
  this.handlerHookNames=handlerHookNames;
  this.namespaceAdmin=namespaceAdmin;
}

Fixed version (ground truth):
/** 
 * Construct the AppFabricServer with service factory and configuration coming from guice injection.
 */
@Inject public AppFabricServer(CConfiguration configuration,DiscoveryService discoveryService,SchedulerService schedulerService,NotificationService notificationService,@Named(Constants.AppFabric.SERVER_ADDRESS) InetAddress hostname,@Named("String_Node_Str") Set<HttpHandler> handlers,@Nullable MetricsCollectionService metricsCollectionService,ProgramRuntimeService programRuntimeService,AdapterService adapterService,StreamCoordinatorClient streamCoordinatorClient,@Named("String_Node_Str") Set<String> servicesNames,@Named("String_Node_Str") Set<String> handlerHookNames,NamespaceAdmin namespaceAdmin){
  this.hostname=hostname;
  this.discoveryService=discoveryService;
  this.schedulerService=schedulerService;
  this.handlers=handlers;
  this.configuration=configuration;
  this.metricsCollectionService=metricsCollectionService;
  this.programRuntimeService=programRuntimeService;
  this.adapterService=adapterService;
  this.notificationService=notificationService;
  this.servicesNames=servicesNames;
  this.handlerHookNames=handlerHookNames;
  this.namespaceAdmin=namespaceAdmin;
  this.streamCoordinatorClient=streamCoordinatorClient;
}
Program: 7218
Project: 7218
Buggy source:
/** 
 * Creates a new namespace
 * @param metadata the {@link NamespaceMeta} for the new namespace to be created
 * @throws AlreadyExistsException if the specified namespace already exists
 */
public void createNamespace(NamespaceMeta metadata) throws NamespaceCannotBeCreatedException, AlreadyExistsException {
  Preconditions.checkArgument(metadata != null,"String_Node_Str");
  NamespaceMeta existing=store.getNamespace(Id.Namespace.from(metadata.getName()));
  if (existing != null) {
    throw new AlreadyExistsException(NAMESPACE_ELEMENT_TYPE,metadata.getName());
  }
  try {
    dsFramework.createNamespace(Id.Namespace.from(metadata.getName()));
  }
 catch (  DatasetManagementException e) {
    throw new NamespaceCannotBeCreatedException(metadata.getName(),e);
  }
  store.createNamespace(metadata);
}

Fixed version (ground truth):
/** 
 * Creates a new namespace
 * @param metadata the {@link NamespaceMeta} for the new namespace to be created
 * @throws AlreadyExistsException if the specified namespace already exists
 */
public void createNamespace(NamespaceMeta metadata) throws NamespaceCannotBeCreatedException, AlreadyExistsException {
  Preconditions.checkArgument(metadata != null,"String_Node_Str");
  if (hasNamespace(Id.Namespace.from(metadata.getName()))) {
    throw new AlreadyExistsException(NAMESPACE_ELEMENT_TYPE,metadata.getName());
  }
  try {
    dsFramework.createNamespace(Id.Namespace.from(metadata.getName()));
  }
 catch (  DatasetManagementException e) {
    throw new NamespaceCannotBeCreatedException(metadata.getName(),e);
  }
  store.createNamespace(metadata);
}
Program: 7219
Project: 7219
Buggy source:
/** 
 * Checks if the specified namespace exists
 * @param namespaceId the {@link Id.Namespace} to check for existence
 * @return true, if the specifed namespace exists, false otherwise
 */
public boolean hasNamespace(Id.Namespace namespaceId){
  boolean exists=true;
  try {
    getNamespace(namespaceId);
  }
 catch (  NotFoundException e) {
    if (Constants.DEFAULT_NAMESPACE.equals(namespaceId.getId())) {
      createDefaultNamespace();
    }
 else {
      exists=false;
    }
  }
  return exists;
}

Fixed version (ground truth):
/** 
 * Checks if the specified namespace exists
 * @param namespaceId the {@link Id.Namespace} to check for existence
 * @return true, if the specifed namespace exists, false otherwise
 */
public boolean hasNamespace(Id.Namespace namespaceId){
  try {
    getNamespace(namespaceId);
  }
 catch (  NotFoundException e) {
    return false;
  }
  return true;
}
Program: 7221
Project: 7221
Buggy source:
/** 
 * Construct the AppFabricServer with service factory and configuration coming from guice injection.
 */
@Inject public AppFabricServer(CConfiguration configuration,DiscoveryService discoveryService,SchedulerService schedulerService,NotificationService notificationService,@Named(Constants.AppFabric.SERVER_ADDRESS) InetAddress hostname,@Named("String_Node_Str") Set<HttpHandler> handlers,@Nullable MetricsCollectionService metricsCollectionService,ProgramRuntimeService programRuntimeService,AdapterService adapterService,@Named("String_Node_Str") Set<String> servicesNames,@Named("String_Node_Str") Set<String> handlerHookNames){
  this.hostname=hostname;
  this.discoveryService=discoveryService;
  this.schedulerService=schedulerService;
  this.handlers=handlers;
  this.configuration=configuration;
  this.metricsCollectionService=metricsCollectionService;
  this.programRuntimeService=programRuntimeService;
  this.adapterService=adapterService;
  this.notificationService=notificationService;
  this.servicesNames=servicesNames;
  this.handlerHookNames=handlerHookNames;
}

Fixed version (ground truth):
/** 
 * Construct the AppFabricServer with service factory and configuration coming from guice injection.
 */
@Inject public AppFabricServer(CConfiguration configuration,DiscoveryService discoveryService,SchedulerService schedulerService,NotificationService notificationService,@Named(Constants.AppFabric.SERVER_ADDRESS) InetAddress hostname,@Named("String_Node_Str") Set<HttpHandler> handlers,@Nullable MetricsCollectionService metricsCollectionService,ProgramRuntimeService programRuntimeService,AdapterService adapterService,@Named("String_Node_Str") Set<String> servicesNames,@Named("String_Node_Str") Set<String> handlerHookNames,NamespaceAdmin namespaceAdmin){
  this.hostname=hostname;
  this.discoveryService=discoveryService;
  this.schedulerService=schedulerService;
  this.handlers=handlers;
  this.configuration=configuration;
  this.metricsCollectionService=metricsCollectionService;
  this.programRuntimeService=programRuntimeService;
  this.adapterService=adapterService;
  this.notificationService=notificationService;
  this.servicesNames=servicesNames;
  this.handlerHookNames=handlerHookNames;
  this.namespaceAdmin=namespaceAdmin;
}
Program: 7222
Project: 7222
Buggy source:
@BeforeClass public static void set() throws Exception {
  schedulerService=AppFabricTestHelper.getInjector().getInstance(SchedulerService.class);
  notificationFeedManager=AppFabricTestHelper.getInjector().getInstance(NotificationFeedManager.class);
  store=AppFabricTestHelper.getInjector().getInstance(StoreFactory.class).create();
  locationFactory=AppFabricTestHelper.getInjector().getInstance(LocationFactory.class);
}

Fixed version (ground truth):
@BeforeClass public static void set() throws Exception {
  schedulerService=AppFabricTestHelper.getInjector().getInstance(SchedulerService.class);
  store=AppFabricTestHelper.getInjector().getInstance(StoreFactory.class).create();
  locationFactory=AppFabricTestHelper.getInjector().getInstance(LocationFactory.class);
  namespaceAdmin=AppFabricTestHelper.getInjector().getInstance(NamespaceAdmin.class);
  namespaceAdmin.createNamespace(Constants.DEFAULT_NAMESPACE_META);
}
Program: 7223
Project: 7223
Buggy source:
@AfterClass public static void finish(){
  schedulerService.stopAndWait();
}

Fixed version (ground truth):
@AfterClass public static void finish() throws NotFoundException, NamespaceCannotBeDeletedException {
  namespaceAdmin.deleteDatasets(Constants.DEFAULT_NAMESPACE_ID);
  schedulerService.stopAndWait();
}
Program: 7224
Project: 7224
Buggy source:
public void reset() throws Exception {
  MockResponder responder=new MockResponder();
  String uri=String.format("String_Node_Str");
  HttpRequest request=new DefaultHttpRequest(HttpVersion.HTTP_1_1,HttpMethod.PUT,uri);
  httpHandler.resetCDAP(request,responder);
  verifyResponse(HttpResponseStatus.OK,responder.getStatus(),"String_Node_Str");
  for (  NamespaceMeta namespaceMeta : namespaceAdmin.listNamespaces()) {
    if (!Constants.DEFAULT_NAMESPACE.equals(namespaceMeta.getId()) && !Constants.SYSTEM_NAMESPACE.equals(namespaceMeta.getId())) {
      Id.Namespace namespace=Id.Namespace.from(namespaceMeta.getId());
      streamAdmin.dropAllInNamespace(namespace);
      namespaceHttpHandler.deleteDatasets(null,new MockResponder(),namespaceMeta.getId());
      namespaceHttpHandler.delete(null,new MockResponder(),namespaceMeta.getId());
    }
  }
}

Fixed version (ground truth):
public void reset() throws Exception {
  MockResponder responder=new MockResponder();
  String uri=String.format("String_Node_Str");
  HttpRequest request=new DefaultHttpRequest(HttpVersion.HTTP_1_1,HttpMethod.PUT,uri);
  httpHandler.resetCDAP(request,responder);
  verifyResponse(HttpResponseStatus.OK,responder.getStatus(),"String_Node_Str");
  for (  NamespaceMeta namespaceMeta : namespaceAdmin.listNamespaces()) {
    if (!Constants.DEFAULT_NAMESPACE.equals(namespaceMeta.getName()) && !Constants.SYSTEM_NAMESPACE.equals(namespaceMeta.getName())) {
      Id.Namespace namespace=Id.Namespace.from(namespaceMeta.getName());
      streamAdmin.dropAllInNamespace(namespace);
      namespaceHttpHandler.deleteDatasets(null,new MockResponder(),namespaceMeta.getName());
      namespaceHttpHandler.delete(null,new MockResponder(),namespaceMeta.getName());
    }
  }
}
Program: 7225
Project: 7225
Buggy source:
@BeforeClass public static void set() throws Exception {
  schedulerService=AppFabricTestHelper.getInjector().getInstance(SchedulerService.class);
  notificationFeedManager=AppFabricTestHelper.getInjector().getInstance(NotificationFeedManager.class);
  store=AppFabricTestHelper.getInjector().getInstance(StoreFactory.class).create();
  locationFactory=AppFabricTestHelper.getInjector().getInstance(LocationFactory.class);
  namespaceAdmin=AppFabricTestHelper.getInjector().getInstance(NamespaceAdmin.class);
  namespaceAdmin.createNamespace(new NamespaceMeta.Builder().setId(namespace).build());
}

Fixed version (ground truth):
@BeforeClass public static void set() throws Exception {
  schedulerService=AppFabricTestHelper.getInjector().getInstance(SchedulerService.class);
  notificationFeedManager=AppFabricTestHelper.getInjector().getInstance(NotificationFeedManager.class);
  store=AppFabricTestHelper.getInjector().getInstance(StoreFactory.class).create();
  locationFactory=AppFabricTestHelper.getInjector().getInstance(LocationFactory.class);
  namespaceAdmin=AppFabricTestHelper.getInjector().getInstance(NamespaceAdmin.class);
  namespaceAdmin.createNamespace(new NamespaceMeta.Builder().setName(namespace).build());
}
Program: 7226
Project: 7226
Buggy source:
/** 
 * Creates a Namespace.
 * @param namespace the namespace to create
 * @throws Exception
 */
protected static void createNamespace(Id.Namespace namespace) throws Exception {
  getTestManager().createNamespace(new NamespaceMeta.Builder().setId(namespace).build());
}

Fixed version (ground truth):
/** 
 * Creates a Namespace.
 * @param namespace the namespace to create
 * @throws Exception
 */
protected static void createNamespace(Id.Namespace namespace) throws Exception {
  getTestManager().createNamespace(new NamespaceMeta.Builder().setName(namespace).build());
}
Program: 7229
Project: 7229
Buggy source:
/** 
 * only use in unit test since the singleton may be reused for multiple tests.
 */
public void clearTables(){
  tables.clear();
}

Fixed version (ground truth):
/** 
 * only use in unit test since the singleton may be reused for multiple tests.
 */
public void clearTables() throws IOException {
  for (  String name : ImmutableList.copyOf(tables.keySet())) {
    dropTable(name);
  }
}
Program: 7230
Project: 7230
Buggy source:
@AfterClass public static void tearDownClass() throws Exception {
  testStackIndex--;
  if (standaloneMain != null && testStackIndex == 0) {
    standaloneMain.shutDown();
    standaloneMain=null;
  }
}

Fixed version (ground truth):
@AfterClass public static void tearDownClass() throws Exception {
  testStackIndex--;
  if (standaloneMain != null && testStackIndex == 0) {
    standaloneMain.shutDown();
    standaloneMain=null;
    LevelDBTableService.getInstance().clearTables();
  }
}
Program: 7231
Project: 7231
Buggy source:
private ClientConfig getClientConfig(){
  return new ClientConfig.Builder(clientConfig).setNamespace(application.getNamespace()).build();
}

Fixed version (ground truth):
private ClientConfig getClientConfig(){
  ConnectionConfig connectionConfig=ConnectionConfig.builder(clientConfig.getConnectionConfig()).setNamespace(application.getNamespace()).build();
  return new ClientConfig.Builder(clientConfig).setConnectionConfig(connectionConfig).build();
}
Program: 7232
Project: 7232
Buggy source:
private ClientConfig getClientConfig(){
  return new ClientConfig.Builder(clientConfig).setNamespace(procedure.getNamespace()).build();
}

Fixed version (ground truth):
private ClientConfig getClientConfig(){
  ConnectionConfig connectionConfig=ConnectionConfig.builder(clientConfig.getConnectionConfig()).setNamespace(procedure.getNamespace()).build();
  return new ClientConfig.Builder(clientConfig).setConnectionConfig(connectionConfig).build();
}
Program: 7233
Project: 7233
Buggy source:
private ClientConfig getClientConfig(){
  return new ClientConfig.Builder(clientConfig).setNamespace(serviceId.getNamespace()).build();
}

Fixed version (ground truth):
private ClientConfig getClientConfig(){
  ConnectionConfig connectionConfig=ConnectionConfig.builder(clientConfig.getConnectionConfig()).setNamespace(serviceId.getNamespace()).build();
  return new ClientConfig.Builder(clientConfig).setConnectionConfig(connectionConfig).build();
}
Program: 7234
Project: 7234
Buggy source:
/** 
 * Returns a list of spark jobs associated with account & application.
 */
@GET @Path("String_Node_Str") public void getServicesByApp(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String appId){
  getProgramsByApp(responder,Constants.DEFAULT_NAMESPACE,appId,ProgramType.SERVICE.getCategoryName());
}

Fixed version (ground truth):
/** 
 * Returns a list of services associated with account & application.
 */
@GET @Path("String_Node_Str") public void getServicesByApp(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String appId){
  getProgramsByApp(responder,Constants.DEFAULT_NAMESPACE,appId,ProgramType.SERVICE.getCategoryName());
}
Program: 7238
Project: 7238
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 MetadataStoreDataset(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,@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();
}
Program: 7239
Project: 7239
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 MetadataStoreDataset(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,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);
  }
}
Program: 7240
Project: 7240
Buggy source:
/** 
 * Adds a partition to the Hive table for the given dataset.
 * @param datasetID the ID of the dataset to add a partition to
 * @param partitionKey the partition key to add
 * @param fsPath the path of the partition
 * @return the query handle for disabling the dataset
 * @throws ExploreException if there was an exception adding the partition
 * @throws SQLException if there was a problem with the add partition statement
 */
public QueryHandle addPartition(Id.DatasetInstance datasetID,PartitionKey partitionKey,String fsPath) throws ExploreException, SQLException {
  String addPartitionStatement=String.format("String_Node_Str",getDatasetTableName(datasetID),generateHivePartitionKey(partitionKey),fsPath);
  LOG.debug("String_Node_Str",partitionKey,datasetID,addPartitionStatement);
  return exploreService.execute(datasetID.getNamespace(),addPartitionStatement);
}

Fixed version (ground truth):
/** 
 * Adds a partition to the Hive table for the given dataset.
 * @param datasetID the ID of the dataset to add a partition to
 * @param partitionKey the partition key to add
 * @param fsPath the path of the partition
 * @return the query handle for adding the partition the dataset
 * @throws ExploreException if there was an exception adding the partition
 * @throws SQLException if there was a problem with the add partition statement
 */
public QueryHandle addPartition(Id.DatasetInstance datasetID,PartitionKey partitionKey,String fsPath) throws ExploreException, SQLException {
  String addPartitionStatement=String.format("String_Node_Str",getDatasetTableName(datasetID),generateHivePartitionKey(partitionKey),fsPath);
  LOG.debug("String_Node_Str",partitionKey,datasetID,addPartitionStatement);
  return exploreService.execute(datasetID.getNamespace(),addPartitionStatement);
}
Program: 7243
Project: 7243
Buggy source:
/** 
 * Drop a partition from the Hive table for the given dataset.
 * @param datasetID the ID of the dataset to drop the partition from
 * @param partitionKey the partition key to drop
 * @return the query handle for disabling the dataset
 * @throws ExploreException if there was an exception dropping the partition
 * @throws SQLException if there was a problem with the drop partition statement
 */
public QueryHandle dropPartition(Id.DatasetInstance datasetID,PartitionKey partitionKey) throws ExploreException, SQLException {
  String dropPartitionStatement=String.format("String_Node_Str",getDatasetTableName(datasetID),generateHivePartitionKey(partitionKey));
  LOG.debug("String_Node_Str",partitionKey,datasetID,dropPartitionStatement);
  return exploreService.execute(datasetID.getNamespace(),dropPartitionStatement);
}

Fixed version (ground truth):
/** 
 * Drop a partition from the Hive table for the given dataset.
 * @param datasetID the ID of the dataset to drop the partition from
 * @param partitionKey the partition key to drop
 * @return the query handle for dropping the partition from the dataset
 * @throws ExploreException if there was an exception dropping the partition
 * @throws SQLException if there was a problem with the drop partition statement
 */
public QueryHandle dropPartition(Id.DatasetInstance datasetID,PartitionKey partitionKey) throws ExploreException, SQLException {
  String dropPartitionStatement=String.format("String_Node_Str",getDatasetTableName(datasetID),generateHivePartitionKey(partitionKey));
  LOG.debug("String_Node_Str",partitionKey,datasetID,dropPartitionStatement);
  return exploreService.execute(datasetID.getNamespace(),dropPartitionStatement);
}
Program: 7244
Project: 7244
Buggy source:
private void upgradeStreamTable(TableInfo tableInfo) throws Exception {
  Map<String,String> serdeProperties=tableInfo.getSerdeParameters();
  String streamName=serdeProperties.get(Constants.Explore.STREAM_NAME);
  Id.Stream streamID=Id.Stream.from(Constants.DEFAULT_NAMESPACE_ID,streamName);
  LOG.info("String_Node_Str",streamID);
  QueryHandle enableHandle=exploreTableService.enableStream(streamID,streamAdmin.getConfig(streamID));
  QueryStatus status=waitForCompletion(enableHandle);
  if (status.getStatus() != QueryStatus.OpStatus.FINISHED) {
    throw new ExploreException("String_Node_Str" + streamID);
  }
  LOG.info("String_Node_Str",streamID);
  QueryHandle disableHandle=execute("String_Node_Str","String_Node_Str" + streamName);
  status=waitForCompletion(disableHandle);
  if (status.getStatus() != QueryStatus.OpStatus.FINISHED) {
    throw new ExploreException("String_Node_Str" + streamName);
  }
}

Fixed version (ground truth):
private void upgradeStreamTable(TableInfo tableInfo) throws Exception {
  Map<String,String> serdeProperties=tableInfo.getSerdeParameters();
  String streamName=serdeProperties.get(Constants.Explore.STREAM_NAME);
  Id.Stream streamID=Id.Stream.from(Constants.DEFAULT_NAMESPACE_ID,streamName);
  LOG.info("String_Node_Str",streamID);
  QueryHandle enableHandle=exploreTableService.enableStream(streamID,streamAdmin.getConfig(streamID));
  QueryStatus status=waitForCompletion(enableHandle);
  if (status.getStatus() != QueryStatus.OpStatus.FINISHED) {
    throw new ExploreException("String_Node_Str" + streamID);
  }
  dropTable(tableInfo.getTableName());
}
Program: 7245
Project: 7245
Buggy source:
private void upgradeRecordScannableTable(TableInfo tableInfo) throws Exception {
  Map<String,String> serdeProperties=tableInfo.getSerdeParameters();
  String datasetName=serdeProperties.get(Constants.Explore.DATASET_NAME);
  Id.DatasetInstance datasetID=Id.DatasetInstance.from(Constants.DEFAULT_NAMESPACE_ID,datasetName);
  DatasetSpecification spec=datasetFramework.getDatasetSpec(datasetID);
  LOG.info("String_Node_Str",datasetID);
  QueryHandle enableHandle=exploreTableService.enableDataset(datasetID,spec);
  QueryStatus status=waitForCompletion(enableHandle);
  if (status.getStatus() != QueryStatus.OpStatus.FINISHED) {
    throw new ExploreException("String_Node_Str" + datasetID);
  }
  String oldTable=tableInfo.getTableName();
  LOG.info("String_Node_Str",oldTable);
  QueryHandle disableHandle=execute("String_Node_Str","String_Node_Str" + oldTable);
  status=waitForCompletion(disableHandle);
  if (status.getStatus() != QueryStatus.OpStatus.FINISHED) {
    throw new ExploreException("String_Node_Str" + oldTable);
  }
}

Fixed version (ground truth):
private void upgradeRecordScannableTable(TableInfo tableInfo) throws Exception {
  Map<String,String> serdeProperties=tableInfo.getSerdeParameters();
  String datasetName=serdeProperties.get(Constants.Explore.DATASET_NAME);
  datasetName=datasetName.substring("String_Node_Str".length(),datasetName.length());
  Id.DatasetInstance datasetID=Id.DatasetInstance.from(Constants.DEFAULT_NAMESPACE_ID,datasetName);
  DatasetSpecification spec=datasetFramework.getDatasetSpec(datasetID);
  enableDataset(datasetID,spec);
  dropTable(tableInfo.getTableName());
}
Program: 7246
Project: 7246
Buggy source:
private void upgradeFilesetTable(TableInfo tableInfo) throws Exception {
  String oldName=tableInfo.getTableName();
  String newName="String_Node_Str" + oldName.substring("String_Node_Str".length(),oldName.length());
  QueryHandle renameHandle=execute("String_Node_Str",String.format("String_Node_Str",oldName,newName));
  QueryStatus status=waitForCompletion(renameHandle);
  if (status.getStatus() != QueryStatus.OpStatus.FINISHED) {
    throw new ExploreException(String.format("String_Node_Str",oldName,newName));
  }
  Map<String,String> tblProperties=tableInfo.getParameters();
  String cdapName=tblProperties.get(Constants.Explore.CDAP_NAME);
  QueryHandle propertyHandle=execute("String_Node_Str",String.format("String_Node_Str",newName,Constants.Explore.CDAP_NAME,cdapName,Constants.Explore.CDAP_VERSION,ProjectInfo.getVersion().toString()));
  status=waitForCompletion(propertyHandle);
  if (status.getStatus() != QueryStatus.OpStatus.FINISHED) {
    throw new ExploreException(String.format("String_Node_Str",newName));
  }
}

Fixed version (ground truth):
private void upgradeFilesetTable(TableInfo tableInfo) throws Exception {
  String dsName=tableInfo.getParameters().get(Constants.Explore.CDAP_NAME);
  dsName=dsName.substring("String_Node_Str".length(),dsName.length());
  Id.DatasetInstance datasetID=Id.DatasetInstance.from(Constants.DEFAULT_NAMESPACE_ID,dsName);
  DatasetSpecification spec=datasetFramework.getDatasetSpec(datasetID);
  enableDataset(datasetID,spec);
  Dataset dataset=ExploreServiceUtils.instantiateDataset(datasetFramework,datasetID);
  if (dataset instanceof TimePartitionedFileSet) {
    TimePartitionedFileSet tpfs=(TimePartitionedFileSet)dataset;
    Map<PartitionKey,String> partitions=tpfs.getPartitions(null);
    if (!partitions.isEmpty()) {
      QueryHandle handle=exploreTableService.addPartitions(datasetID,tpfs.getPartitions(null));
      QueryStatus status=waitForCompletion(handle);
      if (status.getStatus() != QueryStatus.OpStatus.FINISHED) {
        throw new ExploreException("String_Node_Str" + datasetID);
      }
    }
  }
  dropTable(tableInfo.getTableName());
}
Program: 7247
Project: 7247
Buggy source:
public CLIConfig(){
  this(null,System.out,new AltStyleTableRenderer());
}

Fixed version (ground truth):
public CLIConfig(){
  this(ClientConfig.builder().build(),System.out,new AltStyleTableRenderer());
}
Program: 7249
Project: 7249
Buggy source:
@Override protected void configure(){
  bind(CConfiguration.class).toInstance(CConfiguration.create());
  bind(PrintStream.class).toInstance(output);
  bind(CLIConfig.class).toInstance(cliConfig);
  bind(ClientConfig.class).toInstance(cliConfig.getClientConfig());
  bind(TableRenderer.class).toInstance(tableRenderer);
}

Fixed version (ground truth):
@Override protected void configure(){
  bind(LaunchOptions.class).toInstance(options);
  bind(CConfiguration.class).toInstance(CConfiguration.create());
  bind(PrintStream.class).toInstance(output);
  bind(CLIConfig.class).toInstance(cliConfig);
  bind(ClientConfig.class).toInstance(cliConfig.getClientConfig());
  bind(TableRenderer.class).toInstance(tableRenderer);
}
Program: 7250
Project: 7250
Buggy source:
@Inject public ConnectCommand(CLIConfig cliConfig,InstanceURIParser instanceURIParser,@Named(CLIMain.NAME_DEBUG) final boolean debug){
  this.cliConfig=cliConfig;
  this.instanceURIParser=instanceURIParser;
  this.debug=debug;
}

Fixed version (ground truth):
@Inject public ConnectCommand(CLIConfig cliConfig,InstanceURIParser instanceURIParser,LaunchOptions launchOptions){
  this.cliConfig=cliConfig;
  this.instanceURIParser=instanceURIParser;
  this.debug=launchOptions.isDebug();
}