nus-yam/ex-repair huggingface dataset:
Program: 7623
Project: 7623
Buggy source:
/** 
 * Constructs an new instance. Parameters are binded by Guice.
 */
@Inject public AppFabricHttpHandler(CConfiguration configuration,DataSetAccessor dataSetAccessor,LocationFactory locationFactory,ManagerFactory managerFactory,AuthorizationFactory authFactory,StoreFactory storeFactory,ProgramRuntimeService runtimeService,DiscoveryServiceClient discoveryServiceClient,QueueAdmin queueAdmin,StreamAdmin streamAdmin){
  this.dataSetAccessor=dataSetAccessor;
  this.locationFactory=locationFactory;
  this.configuration=configuration;
  this.managerFactory=managerFactory;
  this.authFactory=authFactory;
  this.runtimeService=runtimeService;
  this.discoveryServiceClient=discoveryServiceClient;
  this.queueAdmin=queueAdmin;
  this.streamAdmin=streamAdmin;
  this.store=storeFactory.create();
  this.appFabricDir=configuration.get(Constants.AppFabric.OUTPUT_DIR,System.getProperty("String_Node_Str"));
  this.archiveDir=this.appFabricDir + "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * Constructs an new instance. Parameters are binded by Guice.
 */
@Inject public AppFabricHttpHandler(Authenticator authenticator,CConfiguration configuration,DataSetAccessor dataSetAccessor,LocationFactory locationFactory,ManagerFactory managerFactory,AuthorizationFactory authFactory,StoreFactory storeFactory,ProgramRuntimeService runtimeService,DiscoveryServiceClient discoveryServiceClient,QueueAdmin queueAdmin,StreamAdmin streamAdmin){
  super(authenticator);
  this.dataSetAccessor=dataSetAccessor;
  this.locationFactory=locationFactory;
  this.configuration=configuration;
  this.managerFactory=managerFactory;
  this.authFactory=authFactory;
  this.runtimeService=runtimeService;
  this.discoveryServiceClient=discoveryServiceClient;
  this.queueAdmin=queueAdmin;
  this.streamAdmin=streamAdmin;
  this.store=storeFactory.create();
  this.appFabricDir=configuration.get(Constants.AppFabric.OUTPUT_DIR,System.getProperty("String_Node_Str"));
  this.archiveDir=this.appFabricDir + "String_Node_Str";
}
Program: 7624
Project: 7624
Buggy source:
@Inject public DatasetHandler(GatewayAuthenticator authenticator,DataSetInstantiatorFromMetaData datasetInstantiator,DataSetAccessor dataSetAccessor,DiscoveryServiceClient discoveryClient){
  super(authenticator);
  this.datasetInstantiator=datasetInstantiator;
  this.dataSetAccessor=dataSetAccessor;
  this.discoveryClient=discoveryClient;
}

Fixed version (ground truth):
@Inject public DatasetHandler(Authenticator authenticator,DataSetInstantiatorFromMetaData datasetInstantiator,DataSetAccessor dataSetAccessor,DiscoveryServiceClient discoveryClient){
  super(authenticator);
  this.datasetInstantiator=datasetInstantiator;
  this.dataSetAccessor=dataSetAccessor;
  this.discoveryClient=discoveryClient;
}
Program: 7625
Project: 7625
Buggy source:
@Override protected Module createModule(TwillContext context){
  return Modules.combine(super.createModule(context),new DiscoveryRuntimeModule().getDistributedModules(),new GatewayAuthModule(),new GatewayCommonHandlerModule(),new AppFabricGatewayModule(),new LogHandlerModule(),new MetricsHandlerModule(),new AbstractModule(){
    @Override protected void configure(){
      install(new FactoryModuleBuilder().implement(JarHttpHandler.class,ExplodeJarHttpHandler.class).build(WebappHttpHandlerFactory.class));
    }
  }
);
}

Fixed version (ground truth):
@Override protected Module createModule(TwillContext context){
  return Modules.combine(super.createModule(context),new DiscoveryRuntimeModule().getDistributedModules(),new AuthModule(),new GatewayCommonHandlerModule(),new AppFabricGatewayModule(),new LogHandlerModule(),new MetricsHandlerModule(),new AbstractModule(){
    @Override protected void configure(){
      install(new FactoryModuleBuilder().implement(JarHttpHandler.class,ExplodeJarHttpHandler.class).build(WebappHttpHandlerFactory.class));
    }
  }
);
}
Program: 7626
Project: 7626
Buggy source:
private void deleteConsumerConfigurations(String app,String flow) throws IOException {
  HTable hTable=new HTable(admin.getConfiguration(),configTableName);
  try {
    byte[] prefix=Bytes.toBytes(QueueName.prefixForFlow(app,flow));
    byte[] stop=Arrays.copyOf(prefix,prefix.length);
    stop[prefix.length - 1]++;
    Scan scan=new Scan();
    scan.setStartRow(prefix);
    scan.setStopRow(stop);
    scan.setFilter(new FirstKeyOnlyFilter());
    scan.setMaxVersions(1);
    ResultScanner resultScanner=hTable.getScanner(scan);
    List<Delete> deletes=Lists.newArrayList();
    Result result;
    try {
      while ((result=resultScanner.next()) != null) {
        byte[] row=result.getRow();
        deletes.add(new Delete(row));
      }
    }
  finally {
      resultScanner.close();
    }
    hTable.delete(deletes);
  }
  finally {
    hTable.close();
  }
}

Fixed version (ground truth):
private void deleteConsumerConfigurations(String app,String flow) throws IOException {
  if (admin.tableExists(configTableName)) {
    HTable hTable=new HTable(admin.getConfiguration(),configTableName);
    try {
      byte[] prefix=Bytes.toBytes(QueueName.prefixForFlow(app,flow));
      byte[] stop=Arrays.copyOf(prefix,prefix.length);
      stop[prefix.length - 1]++;
      Scan scan=new Scan();
      scan.setStartRow(prefix);
      scan.setStopRow(stop);
      scan.setFilter(new FirstKeyOnlyFilter());
      scan.setMaxVersions(1);
      ResultScanner resultScanner=hTable.getScanner(scan);
      List<Delete> deletes=Lists.newArrayList();
      Result result;
      try {
        while ((result=resultScanner.next()) != null) {
          byte[] row=result.getRow();
          deletes.add(new Delete(row));
        }
      }
  finally {
        resultScanner.close();
      }
      hTable.delete(deletes);
    }
  finally {
      hTable.close();
    }
  }
}
Program: 7628
Project: 7628
Buggy source:
/** 
 * Construct the AppFabricServer with service factory and configuration coming from guice injection.
 */
@Inject public AppFabricServer(AppFabricServiceFactory serviceFactory,CConfiguration configuration,DiscoveryService discoveryService,SchedulerService schedulerService,@Named(Constants.AppFabric.SERVER_ADDRESS) InetAddress hostname,@Named("String_Node_Str") Set<HttpHandler> handlers){
  this.hostname=hostname;
  this.discoveryService=discoveryService;
  this.schedulerService=schedulerService;
  this.service=serviceFactory.create(schedulerService);
  this.port=configuration.getInt(Constants.AppFabric.SERVER_PORT,Constants.AppFabric.DEFAULT_THRIFT_PORT);
  this.httpHostName=Constants.AppFabric.DEFAULT_SERVER_ADDRESS;
  this.httpPort=Constants.AppFabric.DEFAULT_SERVER_PORT;
  this.handlers=handlers;
}

Fixed version (ground truth):
/** 
 * Construct the AppFabricServer with service factory and configuration coming from guice injection.
 */
@Inject public AppFabricServer(AppFabricServiceFactory serviceFactory,CConfiguration configuration,DiscoveryService discoveryService,SchedulerService schedulerService,@Named(Constants.AppFabric.SERVER_ADDRESS) InetAddress hostname,@Named("String_Node_Str") Set<HttpHandler> handlers){
  this.hostname=hostname;
  this.discoveryService=discoveryService;
  this.schedulerService=schedulerService;
  this.service=serviceFactory.create(schedulerService);
  this.port=configuration.getInt(Constants.AppFabric.SERVER_PORT,Constants.AppFabric.DEFAULT_THRIFT_PORT);
  this.httpPort=Constants.AppFabric.DEFAULT_SERVER_PORT;
  this.handlers=handlers;
}
Program: 7629
Project: 7629
Buggy source:
@Test public void startStopServer() throws Exception {
  Service.State state=server.startAndWait();
  Assert.assertTrue(state == Service.State.RUNNING);
  TimeUnit.SECONDS.sleep(60);
  state=server.stopAndWait();
  Assert.assertTrue(state == Service.State.TERMINATED);
}

Fixed version (ground truth):
@Test public void startStopServer() throws Exception {
  Service.State state=server.startAndWait();
  Assert.assertTrue(state == Service.State.RUNNING);
  TimeUnit.SECONDS.sleep(5);
  state=server.stopAndWait();
  Assert.assertTrue(state == Service.State.TERMINATED);
}
Program: 7630
Project: 7630
Buggy source:
@Override public Module getDistributedModules(){
  return Modules.combine(getCommonModules(),new TwillModule());
}

Fixed version (ground truth):
@Override public Module getDistributedModules(){
  return Modules.combine(getCommonModules(),new TwillModule(),new DiscoveryRuntimeModule().getDistributedModules());
}
Program: 7631
Project: 7631
Buggy source:
@Override public Module getSingleNodeModules(){
  return getCommonModules();
}

Fixed version (ground truth):
@Override public Module getSingleNodeModules(){
  return Modules.combine(getCommonModules(),new DiscoveryRuntimeModule().getSingleNodeModules());
}
Program: 7632
Project: 7632
Buggy source:
@Override public Module getInMemoryModules(){
  return getCommonModules();
}

Fixed version (ground truth):
@Override public Module getInMemoryModules(){
  return Modules.combine(getCommonModules(),new DiscoveryRuntimeModule().getInMemoryModules());
}
Program: 7633
Project: 7633
Buggy source:
public static void setupMeta() throws OperationException {
  String account=Constants.DEVELOPER_ACCOUNT_ID;
  Location appArchiveLocation=locationFactory.getHomeLocation();
  Application app=new WordCount();
  ApplicationSpecification appSpec=app.configure();
  wordCountAppId=new Id.Application(new Id.Account(account),appSpec.getName());
  store.addApplication(wordCountAppId,appSpec,appArchiveLocation);
  app=new WCount();
  appSpec=app.configure();
  wCountAppId=new Id.Application(new Id.Account(account),appSpec.getName());
  store.addApplication(wCountAppId,appSpec,appArchiveLocation);
  validResources=ImmutableList.of("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  invalidResources=ImmutableList.of("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public static void setupMeta() throws OperationException {
  String account=Constants.DEVELOPER_ACCOUNT_ID;
  Location appArchiveLocation=locationFactory.getHomeLocation();
  Application app=new WordCount();
  ApplicationSpecification appSpec=app.configure();
  wordCountAppId=new Id.Application(new Id.Account(account),appSpec.getName());
  store.addApplication(wordCountAppId,appSpec,appArchiveLocation);
  app=new WCount();
  appSpec=app.configure();
  wCountAppId=new Id.Application(new Id.Account(account),appSpec.getName());
  store.addApplication(wCountAppId,appSpec,appArchiveLocation);
  validResources=ImmutableList.of("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  invalidResources=ImmutableList.of("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
}
Program: 7634
Project: 7634
Buggy source:
@Test public void testGetMetric() throws Exception {
  MetricsCollector collector=collectionService.getCollector(MetricsScope.REACTOR,"String_Node_Str","String_Node_Str");
  collector.gauge("String_Node_Str",10,"String_Node_Str");
  collector.gauge("String_Node_Str",10,"String_Node_Str");
  TimeUnit.SECONDS.sleep(2);
  for (  String resource : validResources) {
    HttpResponse response=GatewayFastTestsSuite.doGet("String_Node_Str" + resource);
    Reader reader=new InputStreamReader(response.getEntity().getContent(),Charsets.UTF_8);
    try {
      Assert.assertEquals("String_Node_Str" + resource + "String_Node_Str",HttpStatus.SC_OK,response.getStatusLine().getStatusCode());
      JsonObject json=new Gson().fromJson(reader,JsonObject.class);
      Assert.assertEquals("String_Node_Str" + resource + "String_Node_Str",10,json.get("String_Node_Str").getAsInt());
    }
  finally {
      reader.close();
    }
  }
}

Fixed version (ground truth):
@Test public void testGetMetric() throws Exception {
  MetricsCollector collector=collectionService.getCollector(MetricsScope.REACTOR,"String_Node_Str","String_Node_Str");
  collector.gauge("String_Node_Str",10,"String_Node_Str");
  collector.gauge("String_Node_Str",10,"String_Node_Str");
  collector=collectionService.getCollector(MetricsScope.REACTOR,"String_Node_Str","String_Node_Str");
  collector.gauge("String_Node_Str",10);
  TimeUnit.SECONDS.sleep(2);
  for (  String resource : validResources) {
    HttpResponse response=GatewayFastTestsSuite.doGet("String_Node_Str" + resource);
    Reader reader=new InputStreamReader(response.getEntity().getContent(),Charsets.UTF_8);
    try {
      Assert.assertEquals("String_Node_Str" + resource + "String_Node_Str",HttpStatus.SC_OK,response.getStatusLine().getStatusCode());
      JsonObject json=new Gson().fromJson(reader,JsonObject.class);
      Assert.assertEquals("String_Node_Str" + resource + "String_Node_Str",10,json.get("String_Node_Str").getAsInt());
    }
  finally {
      reader.close();
    }
  }
}
Program: 7635
Project: 7635
Buggy source:
static ImmutablePair<MetricsRequest,MetricsRequestContext> parseRequestAndContext(URI requestURI) throws MetricsPathException {
  MetricsRequestBuilder builder=new MetricsRequestBuilder(requestURI);
  String uriPath=requestURI.getRawPath();
  int index=uriPath.lastIndexOf("String_Node_Str");
  builder.setMetricPrefix(urlDecode(uriPath.substring(index + 1)));
  String strippedPath=uriPath.substring(0,index);
  MetricsRequestContext metricsRequestContext=null;
  if (strippedPath.startsWith("String_Node_Str")) {
    builder.setContextPrefix(CLUSTER_METRICS_CONTEXT);
    builder.setScope(MetricsScope.REACTOR);
  }
 else {
    metricsRequestContext=parseContext(strippedPath,builder);
  }
  parseQueryString(requestURI,builder);
  return new ImmutablePair<MetricsRequest,MetricsRequestContext>(builder.build(),metricsRequestContext);
}

Fixed version (ground truth):
static ImmutablePair<MetricsRequest,MetricsRequestContext> parseRequestAndContext(URI requestURI) throws MetricsPathException {
  MetricsRequestBuilder builder=new MetricsRequestBuilder(requestURI);
  String uriPath=requestURI.getRawPath();
  int index=uriPath.lastIndexOf("String_Node_Str");
  builder.setMetricPrefix(urlDecode(uriPath.substring(index + 1)));
  String strippedPath=uriPath.substring(0,index);
  MetricsRequestContext metricsRequestContext;
  if (strippedPath.startsWith("String_Node_Str")) {
    builder.setContextPrefix(CLUSTER_METRICS_CONTEXT);
    builder.setScope(MetricsScope.REACTOR);
    metricsRequestContext=new MetricsRequestContext.Builder().build();
  }
 else {
    metricsRequestContext=parseContext(strippedPath,builder);
  }
  parseQueryString(requestURI,builder);
  return new ImmutablePair<MetricsRequest,MetricsRequestContext>(builder.build(),metricsRequestContext);
}
Program: 7636
Project: 7636
Buggy source:
public static void setupMeta() throws OperationException {
  String account=Constants.DEVELOPER_ACCOUNT_ID;
  Location appArchiveLocation=locationFactory.getHomeLocation();
  Application app=new WordCount();
  ApplicationSpecification appSpec=app.configure();
  wordCountAppId=new Id.Application(new Id.Account(account),appSpec.getName());
  store.addApplication(wordCountAppId,appSpec,appArchiveLocation);
  app=new WCount();
  appSpec=app.configure();
  wCountAppId=new Id.Application(new Id.Account(account),appSpec.getName());
  store.addApplication(wCountAppId,appSpec,appArchiveLocation);
  validResources=ImmutableList.of("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  invalidResources=ImmutableList.of("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public static void setupMeta() throws OperationException {
  String account=Constants.DEVELOPER_ACCOUNT_ID;
  Location appArchiveLocation=locationFactory.getHomeLocation();
  Application app=new WordCount();
  ApplicationSpecification appSpec=app.configure();
  wordCountAppId=new Id.Application(new Id.Account(account),appSpec.getName());
  store.addApplication(wordCountAppId,appSpec,appArchiveLocation);
  app=new WCount();
  appSpec=app.configure();
  wCountAppId=new Id.Application(new Id.Account(account),appSpec.getName());
  store.addApplication(wCountAppId,appSpec,appArchiveLocation);
  validResources=ImmutableList.of("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  invalidResources=ImmutableList.of("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
}
Program: 7637
Project: 7637
Buggy source:
@Test public void testGetMetric() throws Exception {
  MetricsCollector collector=collectionService.getCollector(MetricsScope.REACTOR,"String_Node_Str","String_Node_Str");
  collector.gauge("String_Node_Str",10,"String_Node_Str");
  collector.gauge("String_Node_Str",10,"String_Node_Str");
  TimeUnit.SECONDS.sleep(2);
  for (  String resource : validResources) {
    HttpResponse response=GatewayFastTestsSuite.doGet("String_Node_Str" + resource);
    Reader reader=new InputStreamReader(response.getEntity().getContent(),Charsets.UTF_8);
    try {
      Assert.assertEquals("String_Node_Str" + resource + "String_Node_Str",HttpStatus.SC_OK,response.getStatusLine().getStatusCode());
      JsonObject json=new Gson().fromJson(reader,JsonObject.class);
      Assert.assertEquals("String_Node_Str" + resource + "String_Node_Str",10,json.get("String_Node_Str").getAsInt());
    }
  finally {
      reader.close();
    }
  }
}

Fixed version (ground truth):
@Test public void testGetMetric() throws Exception {
  MetricsCollector collector=collectionService.getCollector(MetricsScope.REACTOR,"String_Node_Str","String_Node_Str");
  collector.gauge("String_Node_Str",10,"String_Node_Str");
  collector.gauge("String_Node_Str",10,"String_Node_Str");
  collector=collectionService.getCollector(MetricsScope.REACTOR,"String_Node_Str","String_Node_Str");
  collector.gauge("String_Node_Str",10);
  TimeUnit.SECONDS.sleep(2);
  for (  String resource : validResources) {
    HttpResponse response=GatewayFastTestsSuite.doGet("String_Node_Str" + resource);
    Reader reader=new InputStreamReader(response.getEntity().getContent(),Charsets.UTF_8);
    try {
      Assert.assertEquals("String_Node_Str" + resource + "String_Node_Str",HttpStatus.SC_OK,response.getStatusLine().getStatusCode());
      JsonObject json=new Gson().fromJson(reader,JsonObject.class);
      Assert.assertEquals("String_Node_Str" + resource + "String_Node_Str",10,json.get("String_Node_Str").getAsInt());
    }
  finally {
      reader.close();
    }
  }
}
Program: 7638
Project: 7638
Buggy source:
static ImmutablePair<MetricsRequest,MetricsRequestContext> parseRequestAndContext(URI requestURI) throws MetricsPathException {
  MetricsRequestBuilder builder=new MetricsRequestBuilder(requestURI);
  String uriPath=requestURI.getRawPath();
  int index=uriPath.lastIndexOf("String_Node_Str");
  builder.setMetricPrefix(urlDecode(uriPath.substring(index + 1)));
  String strippedPath=uriPath.substring(0,index);
  MetricsRequestContext metricsRequestContext=null;
  if (strippedPath.startsWith("String_Node_Str")) {
    builder.setContextPrefix(CLUSTER_METRICS_CONTEXT);
    builder.setScope(MetricsScope.REACTOR);
  }
 else {
    metricsRequestContext=parseContext(strippedPath,builder);
  }
  parseQueryString(requestURI,builder);
  return new ImmutablePair<MetricsRequest,MetricsRequestContext>(builder.build(),metricsRequestContext);
}

Fixed version (ground truth):
static ImmutablePair<MetricsRequest,MetricsRequestContext> parseRequestAndContext(URI requestURI) throws MetricsPathException {
  MetricsRequestBuilder builder=new MetricsRequestBuilder(requestURI);
  String uriPath=requestURI.getRawPath();
  int index=uriPath.lastIndexOf("String_Node_Str");
  builder.setMetricPrefix(urlDecode(uriPath.substring(index + 1)));
  String strippedPath=uriPath.substring(0,index);
  MetricsRequestContext metricsRequestContext;
  if (strippedPath.startsWith("String_Node_Str")) {
    builder.setContextPrefix(CLUSTER_METRICS_CONTEXT);
    builder.setScope(MetricsScope.REACTOR);
    metricsRequestContext=new MetricsRequestContext.Builder().build();
  }
 else {
    metricsRequestContext=parseContext(strippedPath,builder);
  }
  parseQueryString(requestURI,builder);
  return new ImmutablePair<MetricsRequest,MetricsRequestContext>(builder.build(),metricsRequestContext);
}
Program: 7639
Project: 7639
Buggy source:
private Location createJobJarTempCopy(Location jobJarLocation) throws IOException {
  Location programJarCopy=locationFactory.create(jobJarLocation.getTempFile("String_Node_Str").toURI());
  InputStream src=jobJarLocation.getInputStream();
  try {
    OutputStream dest=programJarCopy.getOutputStream();
    try {
      ByteStreams.copy(src,dest);
    }
  finally {
      dest.close();
    }
  }
  finally {
    src.close();
  }
  return programJarCopy;
}

Fixed version (ground truth):
private Location createJobJarTempCopy(Location jobJarLocation) throws IOException {
  Location programJarCopy=locationFactory.create("String_Node_Str");
  InputStream src=jobJarLocation.getInputStream();
  try {
    OutputStream dest=programJarCopy.getOutputStream();
    try {
      ByteStreams.copy(src,dest);
    }
  finally {
      dest.close();
    }
  }
  finally {
    src.close();
  }
  return programJarCopy;
}
Program: 7640
Project: 7640
Buggy source:
private Location buildJobJar(BasicMapReduceContext context) throws IOException {
  ApplicationBundler appBundler=new ApplicationBundler(Lists.newArrayList("String_Node_Str"),Lists.newArrayList("String_Node_Str"));
  Id.Program programId=context.getProgram().getId();
  String programJarPath=context.getProgram().getJarLocation().toURI().toString();
  String programDir=programJarPath.substring(0,programJarPath.lastIndexOf('/'));
  Location appFabricDependenciesJarLocation=locationFactory.create(URI.create(programDir)).append(String.format("String_Node_Str",Type.MAPREDUCE.name().toLowerCase(),programId.getAccountId(),programId.getApplicationId(),programId.getId(),context.getRunId().getId()));
  LOG.debug("String_Node_Str",appFabricDependenciesJarLocation.toURI());
  appBundler.createBundle(appFabricDependenciesJarLocation,MapReduce.class,DataSetOutputFormat.class,DataSetInputFormat.class,MapperWrapper.class,ReducerWrapper.class);
  return appFabricDependenciesJarLocation;
}

Fixed version (ground truth):
private Location buildJobJar(BasicMapReduceContext context) throws IOException {
  ApplicationBundler appBundler=new ApplicationBundler(Lists.newArrayList("String_Node_Str"),Lists.newArrayList("String_Node_Str"));
  Id.Program programId=context.getProgram().getId();
  Location appFabricDependenciesJarLocation=locationFactory.create(String.format("String_Node_Str",Type.MAPREDUCE.name().toLowerCase(),programId.getAccountId(),programId.getApplicationId(),programId.getId(),context.getRunId().getId()));
  LOG.debug("String_Node_Str",appFabricDependenciesJarLocation.toURI());
  List<Class<?>> classes=Lists.<Class<?>>newArrayList(MapReduce.class,DataSetOutputFormat.class,DataSetInputFormat.class,MapperWrapper.class,ReducerWrapper.class);
  try {
    Class hbaseTableUtilClass=new HBaseTableUtilFactory().get().getClass();
    classes.add(hbaseTableUtilClass);
  }
 catch (  ProvisionException e) {
    LOG.warn("String_Node_Str");
  }
  appBundler.createBundle(appFabricDependenciesJarLocation,classes);
  return appFabricDependenciesJarLocation;
}
Program: 7641
Project: 7641
Buggy source:
protected Injector createInjector(){
  return Guice.createInjector(new ConfigModule(cConf,hConf),new LocationRuntimeModule().getDistributedModules(),new IOModule(),new MetricsClientRuntimeModule().getMapReduceModules(taskContext),new AbstractModule(){
    @Override protected void configure(){
      bind(Configuration.class).annotatedWith(Names.named("String_Node_Str")).to(Configuration.class);
      bind(CConfiguration.class).annotatedWith(Names.named("String_Node_Str")).to(CConfiguration.class);
      bind(DataSetAccessor.class).to(DistributedDataSetAccessor.class).in(Singleton.class);
      bind(LogAppender.class).to(KafkaLogAppender.class);
    }
  }
);
}

Fixed version (ground truth):
protected Injector createInjector(){
  return Guice.createInjector(new ConfigModule(cConf,hConf),new LocationRuntimeModule().getDistributedModules(),new IOModule(),new MetricsClientRuntimeModule().getMapReduceModules(taskContext),new AbstractModule(){
    @Override protected void configure(){
      bind(Configuration.class).annotatedWith(Names.named("String_Node_Str")).to(Configuration.class);
      bind(CConfiguration.class).annotatedWith(Names.named("String_Node_Str")).to(CConfiguration.class);
      bind(HBaseTableUtil.class).toProvider(HBaseTableUtilFactory.class);
      bind(DataSetAccessor.class).to(DistributedDataSetAccessor.class).in(Singleton.class);
      bind(LogAppender.class).to(KafkaLogAppender.class);
    }
  }
);
}
Program: 7642
Project: 7642
Buggy source:
@Override protected void configure(){
  bind(Configuration.class).annotatedWith(Names.named("String_Node_Str")).to(Configuration.class);
  bind(CConfiguration.class).annotatedWith(Names.named("String_Node_Str")).to(CConfiguration.class);
  bind(DataSetAccessor.class).to(DistributedDataSetAccessor.class).in(Singleton.class);
  bind(LogAppender.class).to(KafkaLogAppender.class);
}

Fixed version (ground truth):
@Override protected void configure(){
  bind(Configuration.class).annotatedWith(Names.named("String_Node_Str")).to(Configuration.class);
  bind(CConfiguration.class).annotatedWith(Names.named("String_Node_Str")).to(CConfiguration.class);
  bind(HBaseTableUtil.class).toProvider(HBaseTableUtilFactory.class);
  bind(DataSetAccessor.class).to(DistributedDataSetAccessor.class).in(Singleton.class);
  bind(LogAppender.class).to(KafkaLogAppender.class);
}
Program: 7646
Project: 7646
Buggy source:
BasicProcedureContext create(DataFabricFacade dataFabricFacade){
  DataSetContext dataSetContext=dataFabricFacade.getDataSetContext();
  Map<String,DataSet> dataSets=DataSets.createDataSets(dataSetContext,procedureSpec.getDataSets());
  BasicProcedureContext context=new BasicProcedureContext(program,runId,instanceId,instanceCount,dataSets,userArguments,procedureSpec,collectionService);
  if (dataSetContext instanceof DataSetInstantiationBase) {
    ((DataSetInstantiationBase)dataSetContext).setMetricsCollector(context.getSystemMetrics());
  }
  return context;
}

Fixed version (ground truth):
BasicProcedureContext create(DataFabricFacade dataFabricFacade){
  DataSetContext dataSetContext=dataFabricFacade.getDataSetContext();
  Map<String,DataSet> dataSets=DataSets.createDataSets(dataSetContext,procedureSpec.getDataSets());
  BasicProcedureContext context=new BasicProcedureContext(program,runId,instanceId,instanceCount,dataSets,userArguments,procedureSpec,collectionService);
  if (dataSetContext instanceof DataSetInstantiationBase) {
    ((DataSetInstantiationBase)dataSetContext).setMetricsCollector(collectionService,context.getSystemMetrics());
  }
  return context;
}
Program: 7647
Project: 7647
Buggy source:
@Override public void recordRead(int opsCount){
  if (programContextMetrics != null) {
    programContextMetrics.gauge("String_Node_Str",1,dataSetName);
    programContextMetrics.gauge("String_Node_Str",1);
  }
}

Fixed version (ground truth):
@Override public void recordRead(int opsCount){
  if (programContextMetrics != null) {
    programContextMetrics.gauge("String_Node_Str",1,dataSetName);
    programContextMetrics.gauge("String_Node_Str",1,dataSetName);
  }
  if (dataSetMetrics != null) {
    dataSetMetrics.gauge("String_Node_Str",1,dataSetName);
    dataSetMetrics.gauge("String_Node_Str",1,dataSetName);
  }
}
Program: 7648
Project: 7648
Buggy source:
public void setMetricsCollector(final MetricsCollector programContextMetrics){
  for (  Map.Entry<TransactionAware,String> txAware : this.txAwareToMetricNames.entrySet()) {
    if (txAware.getKey() instanceof DataSetClient) {
      final String dataSetName=txAware.getValue();
      DataSetClient.DataOpsMetrics dataOpsMetrics=new DataSetClient.DataOpsMetrics(){
        @Override public void recordRead(        int opsCount){
          if (programContextMetrics != null) {
            programContextMetrics.gauge("String_Node_Str",1,dataSetName);
            programContextMetrics.gauge("String_Node_Str",1);
          }
        }
        @Override public void recordWrite(        int opsCount,        int dataSize){
          if (programContextMetrics != null) {
            programContextMetrics.gauge("String_Node_Str",1,dataSetName);
            programContextMetrics.gauge("String_Node_Str",dataSize,dataSetName);
            programContextMetrics.gauge("String_Node_Str",1);
          }
        }
      }
;
      ((DataSetClient)txAware.getKey()).setMetricsCollector(dataOpsMetrics);
    }
  }
}

Fixed version (ground truth):
public void setMetricsCollector(final MetricsCollectionService metricsCollectionService,final MetricsCollector programContextMetrics){
  final MetricsCollector dataSetMetrics=metricsCollectionService.getCollector(MetricsScope.REACTOR,Constants.Metrics.DATASET_CONTEXT,"String_Node_Str");
  for (  Map.Entry<TransactionAware,String> txAware : this.txAwareToMetricNames.entrySet()) {
    if (txAware.getKey() instanceof DataSetClient) {
      final String dataSetName=txAware.getValue();
      DataSetClient.DataOpsMetrics dataOpsMetrics=new DataSetClient.DataOpsMetrics(){
        @Override public void recordRead(        int opsCount){
          if (programContextMetrics != null) {
            programContextMetrics.gauge("String_Node_Str",1,dataSetName);
            programContextMetrics.gauge("String_Node_Str",1,dataSetName);
          }
          if (dataSetMetrics != null) {
            dataSetMetrics.gauge("String_Node_Str",1,dataSetName);
            dataSetMetrics.gauge("String_Node_Str",1,dataSetName);
          }
        }
        @Override public void recordWrite(        int opsCount,        int dataSize){
          if (programContextMetrics != null) {
            programContextMetrics.gauge("String_Node_Str",1,dataSetName);
            programContextMetrics.gauge("String_Node_Str",dataSize,dataSetName);
            programContextMetrics.gauge("String_Node_Str",1,dataSetName);
          }
          if (dataSetMetrics != null) {
            dataSetMetrics.gauge("String_Node_Str",1,dataSetName);
            dataSetMetrics.gauge("String_Node_Str",dataSize,dataSetName);
            dataSetMetrics.gauge("String_Node_Str",1,dataSetName);
          }
        }
      }
;
      ((DataSetClient)txAware.getKey()).setMetricsCollector(dataOpsMetrics);
    }
  }
}
Program: 7649
Project: 7649
Buggy source:
@Override public void recordWrite(int opsCount,int dataSize){
  if (programContextMetrics != null) {
    programContextMetrics.gauge("String_Node_Str",1,dataSetName);
    programContextMetrics.gauge("String_Node_Str",dataSize,dataSetName);
    programContextMetrics.gauge("String_Node_Str",1);
  }
}

Fixed version (ground truth):
@Override public void recordWrite(int opsCount,int dataSize){
  if (programContextMetrics != null) {
    programContextMetrics.gauge("String_Node_Str",1,dataSetName);
    programContextMetrics.gauge("String_Node_Str",dataSize,dataSetName);
    programContextMetrics.gauge("String_Node_Str",1,dataSetName);
  }
  if (dataSetMetrics != null) {
    dataSetMetrics.gauge("String_Node_Str",1,dataSetName);
    dataSetMetrics.gauge("String_Node_Str",dataSize,dataSetName);
    dataSetMetrics.gauge("String_Node_Str",1,dataSetName);
  }
}
Program: 7650
Project: 7650
Buggy source:
private AggregatesScanResult findNextResult(){
  while (currentTag != null && currentTag.hasNext()) {
    Map.Entry<byte[],byte[]> tagValue=currentTag.next();
    String tag=Bytes.toString(tagValue.getKey());
    if (!tag.startsWith(tagPrefix)) {
      continue;
    }
    if (MetricsConstants.EMPTY_TAG.equals(tag)) {
      tag=null;
    }
    return new AggregatesScanResult(context,metric,rid,tag,Bytes.toLong(tagValue.getValue()));
  }
  return null;
}

Fixed version (ground truth):
private AggregatesScanResult findNextResult(){
  while (currentTag != null && currentTag.hasNext()) {
    Map.Entry<byte[],byte[]> tagValue=currentTag.next();
    String tag=Bytes.toString(tagValue.getKey());
    if (tagPrefix != null && !tag.startsWith(tagPrefix)) {
      continue;
    }
    if (MetricsConstants.EMPTY_TAG.equals(tag)) {
      tag=null;
    }
    return new AggregatesScanResult(context,metric,rid,tag,Bytes.toLong(tagValue.getValue()));
  }
  return null;
}
Program: 7652
Project: 7652
Buggy source:
/** 
 * Scans the aggregate table.
 * @param contextPrefix Prefix of context to match
 * @param metricPrefix Prefix of metric to match
 * @param tagPrefix Prefix of tag to match
 * @return A {@link AggregatesScanner} for iterating scan over matching rows
 */
public AggregatesScanner scan(String contextPrefix,String metricPrefix,String runId,String tagPrefix){
  byte[] startRow=getPaddedKey(contextPrefix,metricPrefix,runId,0);
  byte[] endRow=getPaddedKey(contextPrefix,metricPrefix,runId,0xff);
  try {
    Scanner scanner=aggregatesTable.scan(startRow,endRow,null,getFilter(contextPrefix,metricPrefix,runId));
    return new AggregatesScanner(contextPrefix,metricPrefix,runId,tagPrefix == null ? MetricsConstants.EMPTY_TAG : tagPrefix,scanner,entityCodec);
  }
 catch (  Exception e) {
    throw Throwables.propagate(e);
  }
}

Fixed version (ground truth):
/** 
 * Scans the aggregate table.
 * @param contextPrefix Prefix of context to match
 * @param metricPrefix Prefix of metric to match
 * @param tagPrefix Prefix of tag to match
 * @return A {@link AggregatesScanner} for iterating scan over matching rows
 */
public AggregatesScanner scan(String contextPrefix,String metricPrefix,String runId,String tagPrefix){
  return scanFor(contextPrefix,metricPrefix,runId,tagPrefix == null ? MetricsConstants.EMPTY_TAG : tagPrefix);
}
Program: 7653
Project: 7653
Buggy source:
/** 
 * Updates aggregates for the given iterator of   {@link MetricsRecord}.
 * @throws OperationException When there is error updating the table.
 */
public void update(Iterator<MetricsRecord> records) throws OperationException {
  try {
    while (records.hasNext()) {
      MetricsRecord record=records.next();
      byte[] rowKey=getKey(record.getContext(),record.getName(),record.getRunId());
      Map<byte[],Long> increments=Maps.newTreeMap(Bytes.BYTES_COMPARATOR);
      increments.put(Bytes.toBytes(MetricsConstants.EMPTY_TAG),(long)record.getValue());
      for (      TagMetric tag : record.getTags()) {
        increments.put(Bytes.toBytes(tag.getTag()),(long)tag.getValue());
      }
      aggregatesTable.increment(rowKey,increments);
    }
  }
 catch (  Exception e) {
    throw new OperationException(StatusCode.INTERNAL_ERROR,e.getMessage(),e);
  }
}

Fixed version (ground truth):
/** 
 * Updates aggregates for the given iterator of   {@link MetricsRecord}.
 * @throws OperationException When there is an error updating the table.
 */
public void update(Iterator<MetricsRecord> records) throws OperationException {
  try {
    while (records.hasNext()) {
      MetricsRecord record=records.next();
      byte[] rowKey=getKey(record.getContext(),record.getName(),record.getRunId());
      Map<byte[],Long> increments=Maps.newTreeMap(Bytes.BYTES_COMPARATOR);
      increments.put(Bytes.toBytes(MetricsConstants.EMPTY_TAG),(long)record.getValue());
      for (      TagMetric tag : record.getTags()) {
        increments.put(Bytes.toBytes(tag.getTag()),(long)tag.getValue());
      }
      aggregatesTable.increment(rowKey,increments);
    }
  }
 catch (  Exception e) {
    throw new OperationException(StatusCode.INTERNAL_ERROR,e.getMessage(),e);
  }
}
Program: 7654
Project: 7654
Buggy source:
/** 
 * Generates an QueueName for the stream.
 * @param stream  connected to flow
 * @return An {@link QueueName} with schema as stream
 */
public static QueueName fromStream(String stream){
  URI uri=URI.create(Joiner.on("String_Node_Str").join("String_Node_Str","String_Node_Str",stream));
  return new QueueName(uri);
}

Fixed version (ground truth):
/** 
 * Generates an QueueName for the stream.
 * @param stream  connected to flow
 * @return An {@link QueueName} with schema as stream
 */
public static QueueName fromStream(String stream){
  URI uri=URI.create(Joiner.on("String_Node_Str").join("String_Node_Str","String_Node_Str","String_Node_Str",stream));
  return new QueueName(uri);
}
Program: 7655
Project: 7655
Buggy source:
public static QueueName fromFlowlet(String app,String flow,String flowlet,String output){
  URI uri=URI.create(Joiner.on("String_Node_Str").join("String_Node_Str","String_Node_Str",app,flow,flowlet,output));
  return new QueueName(uri);
}

Fixed version (ground truth):
public static QueueName fromFlowlet(String app,String flow,String flowlet,String output){
  URI uri=URI.create(Joiner.on("String_Node_Str").join("String_Node_Str","String_Node_Str","String_Node_Str",app,flow,flowlet,output));
  return new QueueName(uri);
}
Program: 7656
Project: 7656
Buggy source:
public static String prefixForFlow(String app,String flow){
  return Joiner.on("String_Node_Str").join("String_Node_Str","String_Node_Str",app,flow,"String_Node_Str");
}

Fixed version (ground truth):
public static String prefixForFlow(String app,String flow){
  return Joiner.on("String_Node_Str").join("String_Node_Str","String_Node_Str","String_Node_Str",app,flow,"String_Node_Str");
}
Program: 7657
Project: 7657
Buggy source:
/** 
 * Called from static method   {@code QueueName#from(URI)} and {@code QueueName#from(bytes[])}.
 * @param uri of the queue.
 */
private QueueName(URI uri){
  this.uri=uri;
  this.stringName=uri.toASCIIString();
  this.byteName=stringName.getBytes(Charsets.US_ASCII);
  Iterable<String> comps=Splitter.on('/').omitEmptyStrings().split(uri.getPath());
  components=new String[1 + Iterables.size(comps)];
  components[0]=uri.getHost();
  Iterator<String> iter=comps.iterator();
  for (int i=1; i < components.length; i++) {
    components[i]=iter.next();
  }
}

Fixed version (ground truth):
/** 
 * Called from static method   {@code QueueName#from(URI)} and {@code QueueName#from(bytes[])}.
 * @param uri of the queue.
 */
private QueueName(URI uri){
  this.uri=uri;
  this.stringName=uri.toASCIIString();
  this.byteName=stringName.getBytes(Charsets.US_ASCII);
  Iterable<String> comps=Splitter.on('/').omitEmptyStrings().split(uri.getPath());
  components=new String[Iterables.size(comps)];
  Iterator<String> iter=comps.iterator();
  for (int i=0; i < components.length; i++) {
    components[i]=iter.next();
  }
}
Program: 7658
Project: 7658
Buggy source:
@Test public void testQueueNameForStream(){
  QueueName queueName=QueueName.fromStream("String_Node_Str");
  Assert.assertFalse(queueName.isQueue());
  Assert.assertTrue(queueName.isStream());
  Assert.assertEquals("String_Node_Str",queueName.getFirstComponent());
  Assert.assertNull(queueName.getSecondComponent());
  Assert.assertNull(queueName.getThirdComponent());
  Assert.assertEquals("String_Node_Str",queueName.getSimpleName());
  queueName=QueueName.from(queueName.toURI());
  Assert.assertFalse(queueName.isQueue());
  Assert.assertTrue(queueName.isStream());
  Assert.assertEquals("String_Node_Str",queueName.getFirstComponent());
  Assert.assertNull(queueName.getSecondComponent());
  Assert.assertNull(queueName.getThirdComponent());
  Assert.assertEquals("String_Node_Str",queueName.getSimpleName());
  queueName=QueueName.from(queueName.toBytes());
  Assert.assertFalse(queueName.isQueue());
  Assert.assertTrue(queueName.isStream());
  Assert.assertEquals("String_Node_Str",queueName.getFirstComponent());
  Assert.assertNull(queueName.getSecondComponent());
  Assert.assertNull(queueName.getThirdComponent());
  Assert.assertEquals("String_Node_Str",queueName.getSimpleName());
}

Fixed version (ground truth):
@Test public void testQueueNameForStream(){
  QueueName queueName=QueueName.fromStream("String_Node_Str");
  verifyStreamName(queueName,"String_Node_Str");
  queueName=QueueName.fromStream("String_Node_Str");
  verifyStreamName(queueName,"String_Node_Str");
  queueName=QueueName.fromStream("String_Node_Str");
  verifyStreamName(queueName,"String_Node_Str");
}
Program: 7659
Project: 7659
Buggy source:
@Test public void testQueueSpecificationGenWithWordCount() throws Exception {
  ApplicationSpecification appSpec=new WordCountApp().configure();
  ApplicationSpecificationAdapter adapter=ApplicationSpecificationAdapter.create(new ReflectionSchemaGenerator());
  ApplicationSpecification newSpec=adapter.fromJson(adapter.toJson(appSpec));
  QueueSpecificationGenerator generator=new SimpleQueueSpecificationGenerator(Id.Application.from(TEST_ACCOUNT_ID,newSpec.getName()));
  table=generator.create(newSpec.getFlows().values().iterator().next());
  Assert.assertEquals(get(FlowletConnection.Type.STREAM,"String_Node_Str","String_Node_Str").iterator().next().getQueueName().toString(),"String_Node_Str" + TEST_ACCOUNT_ID.getId() + "String_Node_Str");
  Assert.assertEquals(get(FlowletConnection.Type.FLOWLET,"String_Node_Str","String_Node_Str").iterator().next().getQueueName().toString(),"String_Node_Str");
  Assert.assertEquals(1,get(FlowletConnection.Type.FLOWLET,"String_Node_Str","String_Node_Str").size());
}

Fixed version (ground truth):
@Test public void testQueueSpecificationGenWithWordCount() throws Exception {
  ApplicationSpecification appSpec=new WordCountApp().configure();
  ApplicationSpecificationAdapter adapter=ApplicationSpecificationAdapter.create(new ReflectionSchemaGenerator());
  ApplicationSpecification newSpec=adapter.fromJson(adapter.toJson(appSpec));
  QueueSpecificationGenerator generator=new SimpleQueueSpecificationGenerator(Id.Application.from(TEST_ACCOUNT_ID,newSpec.getName()));
  table=generator.create(newSpec.getFlows().values().iterator().next());
  Assert.assertEquals(get(FlowletConnection.Type.STREAM,"String_Node_Str","String_Node_Str").iterator().next().getQueueName().toString(),"String_Node_Str");
  Assert.assertEquals(get(FlowletConnection.Type.FLOWLET,"String_Node_Str","String_Node_Str").iterator().next().getQueueName().toString(),"String_Node_Str");
  Assert.assertEquals(1,get(FlowletConnection.Type.FLOWLET,"String_Node_Str","String_Node_Str").size());
}
Program: 7661
Project: 7661
Buggy source:
/** 
 * @return the second component of the URI (the flow for a queue, the stream name for a stream).
 */
public String getSecondComponent(){
  return getNthComponent(2);
}

Fixed version (ground truth):
/** 
 * @return the second component of the URI (the flow for a queue, the stream name for a stream).
 */
public String getSecondComponent(){
  return getNthComponent(1);
}
Program: 7662
Project: 7662
Buggy source:
/** 
 * @return the third component of the URI (the flowlet for a queue, null for a stream).
 */
public String getThirdComponent(){
  return getNthComponent(3);
}

Fixed version (ground truth):
/** 
 * @return the third component of the URI (the flowlet for a queue, null for a stream).
 */
public String getThirdComponent(){
  return getNthComponent(2);
}
Program: 7663
Project: 7663
Buggy source:
/** 
 * Called from static method   {@code QueueName#from(URI)} and {@code QueueName#from(bytes[])}.
 * @param uri of the queue.
 */
private QueueName(URI uri){
  this.uri=uri;
  this.stringName=uri.toASCIIString();
  this.byteName=stringName.getBytes(Charsets.US_ASCII);
  List<String> comps=Lists.asList(uri.getHost(),uri.getPath().split("String_Node_Str"));
  this.components=comps.toArray(new String[comps.size()]);
}

Fixed version (ground truth):
/** 
 * Called from static method   {@code QueueName#from(URI)} and {@code QueueName#from(bytes[])}.
 * @param uri of the queue.
 */
private QueueName(URI uri){
  this.uri=uri;
  this.stringName=uri.toASCIIString();
  this.byteName=stringName.getBytes(Charsets.US_ASCII);
  Iterable<String> comps=Splitter.on('/').omitEmptyStrings().split(uri.getPath());
  components=new String[1 + Iterables.size(comps)];
  components[0]=uri.getHost();
  Iterator<String> iter=comps.iterator();
  for (int i=1; i < components.length; i++) {
    components[i]=iter.next();
  }
}
Program: 7664
Project: 7664
Buggy source:
/** 
 * For guice injecting configuration object to this singleton.
 */
@Inject public void setConfiguration(@Named("String_Node_Str") CConfiguration config) throws IOException {
  basePath=config.get(Constants.CFG_DATA_LEVELDB_DIR);
  Preconditions.checkNotNull(basePath,"String_Node_Str");
  blockSize=config.getInt(Constants.CFG_DATA_LEVELDB_BLOCKSIZE,Constants.DEFAULT_DATA_LEVELDB_BLOCKSIZE);
  cacheSize=config.getLong(Constants.CFG_DATA_LEVELDB_CACHESIZE,Constants.DEFAULT_DATA_LEVELDB_CACHESIZE);
  writeOptions=new WriteOptions().sync(config.getBoolean(Constants.CFG_DATA_LEVELDB_FSYNC,Constants.DEFAULT_DATA_LEVELDB_FSYNC));
}

Fixed version (ground truth):
/** 
 * For guice injecting configuration object to this singleton.
 */
@Inject public void setConfiguration(@Named("String_Node_Str") CConfiguration config) throws IOException {
  tables.clear();
  basePath=config.get(Constants.CFG_DATA_LEVELDB_DIR);
  Preconditions.checkNotNull(basePath,"String_Node_Str");
  blockSize=config.getInt(Constants.CFG_DATA_LEVELDB_BLOCKSIZE,Constants.DEFAULT_DATA_LEVELDB_BLOCKSIZE);
  cacheSize=config.getLong(Constants.CFG_DATA_LEVELDB_CACHESIZE,Constants.DEFAULT_DATA_LEVELDB_CACHESIZE);
  writeOptions=new WriteOptions().sync(config.getBoolean(Constants.CFG_DATA_LEVELDB_FSYNC,Constants.DEFAULT_DATA_LEVELDB_FSYNC));
}
Program: 7665
Project: 7665
Buggy source:
/** 
 * Helper method to select the queue or stream admin, and to ensure it's table exists.
 * @param queueName name of the queue to be opened.
 * @return the queue admin for that queue.
 * @throws IOException
 */
private LevelDBQueueAdmin ensureTableExists(QueueName queueName) throws IOException {
  LevelDBQueueAdmin admin=queueName.isStream() ? streamAdmin : queueAdmin;
  String queueTableName=admin.getActualTableName(queueName);
  try {
    admin.create(queueTableName);
  }
 catch (  Exception e) {
    throw new IOException("String_Node_Str" + queueTableName,e);
  }
  return admin;
}

Fixed version (ground truth):
/** 
 * Helper method to select the queue or stream admin, and to ensure it's table exists.
 * @param queueName name of the queue to be opened.
 * @return the queue admin for that queue.
 * @throws IOException
 */
private LevelDBQueueAdmin ensureTableExists(QueueName queueName) throws IOException {
  LevelDBQueueAdmin admin=queueName.isStream() ? streamAdmin : queueAdmin;
  try {
    admin.create(queueName);
  }
 catch (  Exception e) {
    throw new IOException("String_Node_Str" + admin.getActualTableName(queueName),e);
  }
  return admin;
}