nus-yam/ex-repair huggingface dataset:
Program: 6404
Project: 6404
Buggy source:
private ProgramController startProgram(ApplicationWithPrograms app,Class<?> programClass) throws Throwable {
  final AtomicReference<Throwable> errorCause=new AtomicReference<>();
  final ProgramController controller=submit(app,programClass,RuntimeArguments.NO_ARGUMENTS);
  runningPrograms.add(controller);
  controller.addListener(new AbstractListener(){
    @Override public void error(    Throwable cause){
      errorCause.set(cause);
    }
    @Override public void killed(){
      errorCause.set(new RuntimeException("String_Node_Str"));
    }
  }
,Threads.SAME_THREAD_EXECUTOR);
  Tasks.waitFor(ProgramController.State.ALIVE,new Callable<ProgramController.State>(){
    @Override public ProgramController.State call() throws Exception {
      Throwable t=errorCause.get();
      if (t != null) {
        Throwables.propagateIfInstanceOf(t,Exception.class);
        throw Throwables.propagate(t);
      }
      return controller.getState();
    }
  }
,30,TimeUnit.SECONDS,50,TimeUnit.MILLISECONDS);
  return controller;
}

Fixed version (ground truth):
private ProgramController startProgram(ApplicationWithPrograms app,Class<?> programClass) throws Throwable {
  final AtomicReference<Throwable> errorCause=new AtomicReference<>();
  final ProgramController controller=submit(app,programClass,RuntimeArguments.NO_ARGUMENTS);
  runningPrograms.add(controller);
  controller.addListener(new AbstractListener(){
    @Override public void error(    Throwable cause){
      errorCause.set(cause);
    }
    @Override public void killed(){
      errorCause.set(new RuntimeException("String_Node_Str"));
    }
  }
,Threads.SAME_THREAD_EXECUTOR);
  Tasks.waitFor(ProgramController.State.ALIVE,new Callable<ProgramController.State>(){
    @Override public ProgramController.State call() throws Exception {
      Throwable t=errorCause.get();
      if (t != null) {
        Throwables.propagateIfInstanceOf(t,Exception.class);
        throw Throwables.propagate(t);
      }
      return controller.getState();
    }
  }
,30,TimeUnit.SECONDS);
  return controller;
}
Program: 6406
Project: 6406
Buggy source:
/** 
 * Waits for the given program to transit to the given state.
 */
protected void waitState(final Id.Program programId,String state) throws Exception {
  Tasks.waitFor(state,new Callable<String>(){
    @Override public String call() throws Exception {
      String path=String.format("String_Node_Str",programId.getApplicationId(),programId.getType().getCategoryName(),programId.getId());
      HttpResponse response=doGet(getVersionedAPIPath(path,programId.getNamespaceId()));
      JsonObject status=GSON.fromJson(EntityUtils.toString(response.getEntity()),JsonObject.class);
      if (status == null || !status.has("String_Node_Str")) {
        return null;
      }
      return status.get("String_Node_Str").getAsString();
    }
  }
,60,TimeUnit.SECONDS,50,TimeUnit.MILLISECONDS);
}

Fixed version (ground truth):
/** 
 * Waits for the given program to transit to the given state.
 */
protected void waitState(final Id.Program programId,String state) throws Exception {
  Tasks.waitFor(state,new Callable<String>(){
    @Override public String call() throws Exception {
      String path=String.format("String_Node_Str",programId.getApplicationId(),programId.getType().getCategoryName(),programId.getId());
      HttpResponse response=doGet(getVersionedAPIPath(path,programId.getNamespaceId()));
      JsonObject status=GSON.fromJson(EntityUtils.toString(response.getEntity()),JsonObject.class);
      if (status == null || !status.has("String_Node_Str")) {
        return null;
      }
      return status.get("String_Node_Str").getAsString();
    }
  }
,60,TimeUnit.SECONDS);
}
Program: 6407
Project: 6407
Buggy source:
protected void verifyProgramRuns(final Id.Program program,final String status,final int expected) throws Exception {
  Tasks.waitFor(true,new Callable<Boolean>(){
    @Override public Boolean call() throws Exception {
      return getProgramRuns(program,status).size() > expected;
    }
  }
,60,TimeUnit.SECONDS,50,TimeUnit.MILLISECONDS);
}

Fixed version (ground truth):
protected void verifyProgramRuns(final Id.Program program,final String status,final int expected) throws Exception {
  Tasks.waitFor(true,new Callable<Boolean>(){
    @Override public Boolean call() throws Exception {
      return getProgramRuns(program,status).size() > expected;
    }
  }
,60,TimeUnit.SECONDS);
}
Program: 6408
Project: 6408
Buggy source:
private void verifyRunningProgramCount(final Id.Program program,final String runId,final int expected) throws Exception {
  Tasks.waitFor(expected,new Callable<Integer>(){
    @Override public Integer call() throws Exception {
      return runningProgramCount(program,runId);
    }
  }
,10,TimeUnit.SECONDS,50,TimeUnit.MILLISECONDS);
}

Fixed version (ground truth):
private void verifyRunningProgramCount(final Id.Program program,final String runId,final int expected) throws Exception {
  Tasks.waitFor(expected,new Callable<Integer>(){
    @Override public Integer call() throws Exception {
      return runningProgramCount(program,runId);
    }
  }
,10,TimeUnit.SECONDS);
}
Program: 6409
Project: 6409
Buggy source:
private void verifyFileExists(final List<File> fileList) throws Exception {
  Tasks.waitFor(true,new Callable<Boolean>(){
    @Override public Boolean call() throws Exception {
      for (      File file : fileList) {
        if (!file.exists()) {
          return false;
        }
      }
      return true;
    }
  }
,180,TimeUnit.SECONDS,50,TimeUnit.MILLISECONDS);
}

Fixed version (ground truth):
private void verifyFileExists(final List<File> fileList) throws Exception {
  Tasks.waitFor(true,new Callable<Boolean>(){
    @Override public Boolean call() throws Exception {
      for (      File file : fileList) {
        if (!file.exists()) {
          return false;
        }
      }
      return true;
    }
  }
,180,TimeUnit.SECONDS);
}
Program: 6410
Project: 6410
Buggy source:
private void waitForTableToBePopulated(final DataSetManager<Table> tableManager) throws Exception {
  Tasks.waitFor(true,new Callable<Boolean>(){
    @Override public Boolean call() throws Exception {
      tableManager.flush();
      Table table=tableManager.get();
      Row row=table.get("String_Node_Str".getBytes(Charsets.UTF_8));
      return row.getColumns().size() != 0;
    }
  }
,10,TimeUnit.SECONDS,50,TimeUnit.MILLISECONDS);
}

Fixed version (ground truth):
private void waitForTableToBePopulated(final DataSetManager<Table> tableManager) throws Exception {
  Tasks.waitFor(true,new Callable<Boolean>(){
    @Override public Boolean call() throws Exception {
      tableManager.flush();
      Table table=tableManager.get();
      Row row=table.get("String_Node_Str".getBytes(Charsets.UTF_8));
      return row.getColumns().size() != 0;
    }
  }
,10,TimeUnit.SECONDS);
}
Program: 6412
Project: 6412
Buggy source:
/** 
 * Calls callable, waiting sleepDelay between each call, until it returns the desiredValue or the timeout has passed.
 * @param desiredValue the desired value to get from callable
 * @param callable the callable to check
 * @param timeout time until we timeout
 * @param timeoutUnit unit of time for timeout
 * @param sleepDelay time to wait between calls to callable
 * @param sleepDelayUnit unit of time for sleepDelay
 * @param < T > type of desiredValue
 * @throws TimeoutException if timeout has passed, but didn't get the desiredValue
 * @throws InterruptedException if something interrupted this waiting operation
 * @throws ExecutionException if there was an exception in calling the callable
 */
public static <T>void waitFor(T desiredValue,Callable<T> callable,long timeout,TimeUnit timeoutUnit,long sleepDelay,TimeUnit sleepDelayUnit) throws TimeoutException, InterruptedException, ExecutionException {
  long sleepDelayMs=sleepDelayUnit.toMillis(sleepDelay);
  long startTime=System.currentTimeMillis();
  long timeoutMs=timeoutUnit.toMillis(timeout);
  while (System.currentTimeMillis() - startTime < timeoutMs) {
    try {
      if (desiredValue.equals(callable.call())) {
        return;
      }
    }
 catch (    Exception e) {
      throw new ExecutionException(e);
    }
    Thread.sleep(sleepDelayMs);
  }
  throw new TimeoutException();
}

Fixed version (ground truth):
/** 
 * Calls callable, waiting 50 milliseconds between each call, until it returns the desiredValue or the timeout has passed.
 * @param desiredValue the desired value to get from callable
 * @param callable the callable to check
 * @param timeout time until we timeout
 * @param timeoutUnit unit of time for timeout
 * @param < T > type of desiredValue
 * @throws TimeoutException if timeout has passed, but didn't get the desiredValue
 * @throws InterruptedException if something interrupted this waiting operation
 * @throws ExecutionException if there was an exception in calling the callable
 */
public static <T>void waitFor(T desiredValue,Callable<T> callable,long timeout,TimeUnit timeoutUnit) throws TimeoutException, InterruptedException, ExecutionException {
  waitFor(desiredValue,callable,timeout,timeoutUnit,50,TimeUnit.MILLISECONDS);
}
Program: 6413
Project: 6413
Buggy source:
private void waitForStreamToBePopulated(final StreamManager streamManager,int numEvents) throws Exception {
  Tasks.waitFor(numEvents,new Callable<Integer>(){
    @Override public Integer call() throws Exception {
      List<StreamEvent> streamEvents=streamManager.getEvents(0,Long.MAX_VALUE,Integer.MAX_VALUE);
      return streamEvents.size();
    }
  }
,10,TimeUnit.SECONDS,50,TimeUnit.MILLISECONDS);
}

Fixed version (ground truth):
private void waitForStreamToBePopulated(final StreamManager streamManager,int numEvents) throws Exception {
  Tasks.waitFor(numEvents,new Callable<Integer>(){
    @Override public Integer call() throws Exception {
      List<StreamEvent> streamEvents=streamManager.getEvents(0,Long.MAX_VALUE,Integer.MAX_VALUE);
      return streamEvents.size();
    }
  }
,10,TimeUnit.SECONDS);
}
Program: 6415
Project: 6415
Buggy source:
private void waitForSuccessfulPing(final URL serviceUrl) throws InterruptedException, ExecutionException, TimeoutException {
  Tasks.waitFor(HttpURLConnection.HTTP_OK,new Callable<Integer>(){
    @Override public Integer call() throws Exception {
      HttpURLConnection conn=(HttpURLConnection)serviceUrl.openConnection();
      try {
        return conn.getResponseCode();
      }
  finally {
        conn.disconnect();
      }
    }
  }
,10,TimeUnit.SECONDS,50,TimeUnit.MILLISECONDS);
}

Fixed version (ground truth):
private void waitForSuccessfulPing(final URL serviceUrl) throws InterruptedException, ExecutionException, TimeoutException {
  Tasks.waitFor(HttpURLConnection.HTTP_OK,new Callable<Integer>(){
    @Override public Integer call() throws Exception {
      HttpURLConnection conn=(HttpURLConnection)serviceUrl.openConnection();
      try {
        return conn.getResponseCode();
      }
  finally {
        conn.disconnect();
      }
    }
  }
,10,TimeUnit.SECONDS);
}
Program: 6416
Project: 6416
Buggy source:
private void waitForGetServiceUrl() throws InterruptedException, ExecutionException, TimeoutException {
  Tasks.waitFor(true,new Callable<Boolean>(){
    @Override public Boolean call() throws Exception {
      return getContext().getServiceURL(CENTRAL_SERVICE) != null;
    }
  }
,10,TimeUnit.SECONDS,50,TimeUnit.MILLISECONDS);
}

Fixed version (ground truth):
private void waitForGetServiceUrl() throws InterruptedException, ExecutionException, TimeoutException {
  Tasks.waitFor(true,new Callable<Boolean>(){
    @Override public Boolean call() throws Exception {
      return getContext().getServiceURL(CENTRAL_SERVICE) != null;
    }
  }
,10,TimeUnit.SECONDS);
}
Program: 6418
Project: 6418
Buggy source:
/** 
 * Checks to ensure that a particular    {@param workerManager} has {@param expected} number ofinstances while retrying every 50 ms for 15 seconds.
 * @throws Exception if the worker does not have the specified number of instances after 15 seconds.
 */
private void workerInstancesCheck(final WorkerManager workerManager,int expected) throws Exception {
  Tasks.waitFor(expected,new Callable<Integer>(){
    @Override public Integer call() throws Exception {
      return workerManager.getInstances();
    }
  }
,15,TimeUnit.SECONDS,50,TimeUnit.MILLISECONDS);
}

Fixed version (ground truth):
/** 
 * Checks to ensure that a particular    {@param workerManager} has {@param expected} number ofinstances while retrying every 50 ms for 15 seconds.
 * @throws Exception if the worker does not have the specified number of instances after 15 seconds.
 */
private void workerInstancesCheck(final WorkerManager workerManager,int expected) throws Exception {
  Tasks.waitFor(expected,new Callable<Integer>(){
    @Override public Integer call() throws Exception {
      return workerManager.getInstances();
    }
  }
,15,TimeUnit.SECONDS);
}
Program: 6419
Project: 6419
Buggy source:
/** 
 * Localizes resources requested by users in the Spark Program's client (or beforeSubmit) phases. In Local mode, also copies resources to a temporary directory.
 * @param contextConfig the {@link SparkContextConfig} for this Spark program
 * @param clientContext the {@link ClientSparkContext} for this Spark program
 * @param allLocalizedResources the list of all (user-requested + CDAP system) {@link LocalizeResource} to belocalized for this Spark program
 * @param targetDir in local mode, a temporary directory to copy the resources to
 * @return a {@link Map} of resource name to the {@link File} handle for the local file.
 */
private Map<String,File> localizeUserResources(SparkContextConfig contextConfig,ClientSparkContext clientContext,List<LocalizeResource> allLocalizedResources,File targetDir) throws IOException {
  Map<String,File> localizedResources=new HashMap<>();
  Map<String,LocalizeResource> resourcesToLocalize=clientContext.getResourcesToLocalize();
  for (  final Map.Entry<String,LocalizeResource> entry : resourcesToLocalize.entrySet()) {
    final File localizedFile;
    if (contextConfig.isLocal()) {
      localizedFile=LocalizationUtils.localizeResource(entry.getKey(),entry.getValue(),targetDir);
    }
 else {
      allLocalizedResources.add(entry.getValue());
      localizedFile=new File(entry.getKey());
    }
    localizedResources.put(entry.getKey(),localizedFile);
  }
  return localizedResources;
}

Fixed version (ground truth):
/** 
 * Localizes resources requested by users in the Spark Program's client (or beforeSubmit) phases.
 * @param contextConfig the {@link SparkContextConfig} for this Spark program
 * @param clientContext the {@link ClientSparkContext} for this Spark program
 * @param allLocalizedResources the list of all (user-requested + CDAP system) {@link LocalizeResource} to belocalized for this Spark program
 * @param targetDir a temporary directory to copy the resources to
 * @return a {@link Map} of resource name to the {@link File} handle for the local file.
 */
private Map<String,File> localizeUserResources(SparkContextConfig contextConfig,ClientSparkContext clientContext,List<LocalizeResource> allLocalizedResources,File targetDir) throws IOException {
  Map<String,File> localizedResources=new HashMap<>();
  Map<String,LocalizeResource> resourcesToLocalize=clientContext.getResourcesToLocalize();
  for (  final Map.Entry<String,LocalizeResource> entry : resourcesToLocalize.entrySet()) {
    File localizedFile=LocalizationUtils.localizeResource(entry.getKey(),entry.getValue(),targetDir);
    if (!contextConfig.isLocal()) {
      try {
        URI uri=localizedFile.toURI();
        URI actualURI=new URI(uri.getScheme(),uri.getAuthority(),uri.getPath(),uri.getQuery(),entry.getKey());
        allLocalizedResources.add(new LocalizeResource(actualURI,entry.getValue().isArchive()));
      }
 catch (      URISyntaxException e) {
        throw Throwables.propagate(e);
      }
    }
    localizedResources.put(entry.getKey(),localizedFile);
  }
  return localizedResources;
}
Program: 6420
Project: 6420
Buggy source:
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  RunRequirements that=(RunRequirements)o;
  return Objects.equals(concurrentProgramRunsThreshold,that.concurrentProgramRunsThreshold);
}

Fixed version (ground truth):
@Override public boolean equals(Object other){
  if (this == other) {
    return true;
  }
  if (other == null || getClass() != other.getClass()) {
    return false;
  }
  RunRequirements that=(RunRequirements)other;
  return Objects.equals(concurrentProgramRunsThreshold,that.concurrentProgramRunsThreshold);
}
Program: 6421
Project: 6421
Buggy source:
public RunRequirements getRunRequirements(){
  return runRequirements;
}

Fixed version (ground truth):
public RunRequirements getRunRequirements(){
  return runRequirements == null ? RunRequirements.NONE : runRequirements;
}
Program: 6422
Project: 6422
Buggy source:
/** 
 * Checks if the run requirements for the specified schedule and program are all satisfied.
 * @param programId the id of the program to check
 * @param schedule the schedule to check
 * @return whether all run requirements are satisfied
 */
public boolean checkSatisfied(Id.Program programId,Schedule schedule){
  Integer programThreshold=schedule.getRunRequirements().getConcurrentProgramRunsThreshold();
  if (programThreshold != null) {
    try {
      List<RunRecordMeta> running=store.getRuns(programId,ProgramRunStatus.RUNNING,0,Long.MAX_VALUE,programThreshold + 1);
      if (running.size() > programThreshold) {
        LOG.info("String_Node_Str",programId,programThreshold);
        return false;
      }
    }
 catch (    Exception e) {
      LOG.error("String_Node_Str",programId,e);
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Checks if the run requirements for the specified schedule and program are all satisfied.
 * @param programId the id of the program to check
 * @param schedule the schedule to check
 * @return whether all run requirements are satisfied
 */
public boolean checkSatisfied(Id.Program programId,Schedule schedule){
  Integer programThreshold=schedule.getRunRequirements().getConcurrentProgramRunsThreshold();
  if (programThreshold != null) {
    try {
      int max=programThreshold == Integer.MAX_VALUE ? Integer.MAX_VALUE : programThreshold + 1;
      List<RunRecordMeta> running=store.getRuns(programId,ProgramRunStatus.RUNNING,0,Long.MAX_VALUE,max);
      if (running.size() > programThreshold) {
        LOG.info("String_Node_Str",programId,programThreshold);
        return false;
      }
    }
 catch (    Exception e) {
      LOG.error("String_Node_Str",programId,e);
      return false;
    }
  }
  return true;
}
Program: 6423
Project: 6423
Buggy source:
/** 
 * Constructs a ClassLoader based on the given   {@link Parameters} and also uses the given{@link TaskContextProviderFactory} to create {@link MapReduceTaskContextProvider} on demand.
 */
private MapReduceClassLoader(final Parameters parameters,final TaskContextProviderFactory contextProviderFactory){
  super(null,createDelegates(parameters));
  this.parameters=parameters;
  this.taskContextProviderSupplier=Suppliers.memoize(new Supplier<MapReduceTaskContextProvider>(){
    @Override public MapReduceTaskContextProvider get(){
      return contextProviderFactory.create(parameters.getCConf(),parameters.getHConf());
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Constructs a ClassLoader based on the given   {@link Parameters} and also uses the given{@link TaskContextProviderFactory} to create {@link MapReduceTaskContextProvider} on demand.
 */
private MapReduceClassLoader(final Parameters parameters,final TaskContextProviderFactory contextProviderFactory){
  super(null,createDelegates(parameters));
  this.parameters=parameters;
  this.taskContextProviderSupplier=new Supplier<MapReduceTaskContextProvider>(){
    @Override public MapReduceTaskContextProvider get(){
      return contextProviderFactory.create(parameters.getCConf(),parameters.getHConf());
    }
  }
;
}
Program: 6424
Project: 6424
Buggy source:
/** 
 * Returns the   {@link MapReduceTaskContextProvider} associated with this ClassLoader.
 */
public MapReduceTaskContextProvider getTaskContextProvider(){
  MapReduceTaskContextProvider provider=taskContextProviderSupplier.get();
  provider.startAndWait();
  return provider;
}

Fixed version (ground truth):
/** 
 * Returns the   {@link MapReduceTaskContextProvider} associated with this ClassLoader.
 */
public MapReduceTaskContextProvider getTaskContextProvider(){
synchronized (this) {
    taskContextProvider=Optional.fromNullable(taskContextProvider).or(taskContextProviderSupplier);
  }
  taskContextProvider.startAndWait();
  return taskContextProvider;
}
Program: 6425
Project: 6425
Buggy source:
@Override public void close() throws Exception {
  try {
    MapReduceTaskContextProvider provider=taskContextProviderSupplier.get();
    Service.State state=provider.state();
    if (state == Service.State.STARTING || state == Service.State.RUNNING) {
      provider.stopAndWait();
    }
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Override public void close() throws Exception {
  try {
    MapReduceTaskContextProvider provider;
synchronized (this) {
      provider=taskContextProvider;
    }
    if (provider != null) {
      Service.State state=provider.state();
      if (state == Service.State.STARTING || state == Service.State.RUNNING) {
        provider.stopAndWait();
      }
    }
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str",e);
  }
}
Program: 6426
Project: 6426
Buggy source:
@Override public void run(){
  for (  Object resource : resources) {
    if (resource == null) {
      continue;
    }
    try {
      if (resource instanceof File) {
        if (((File)resource).isDirectory()) {
          DirUtils.deleteDirectoryContents((File)resource);
        }
 else {
          ((File)resource).delete();
        }
      }
 else       if (resource instanceof Location) {
        Locations.deleteQuietly((Location)resource);
      }
 else       if (resource instanceof AutoCloseable) {
        ((AutoCloseable)resource).close();
      }
 else       if (resource instanceof Runnable) {
        ((Runnable)resource).run();
      }
    }
 catch (    Throwable t) {
      LOG.warn("String_Node_Str",resource,t);
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  for (  Object resource : resources) {
    if (resource == null) {
      continue;
    }
    try {
      if (resource instanceof File) {
        if (((File)resource).isDirectory()) {
          DirUtils.deleteDirectoryContents((File)resource);
        }
 else {
          ((File)resource).delete();
        }
      }
 else       if (resource instanceof Location) {
        Locations.deleteQuietly((Location)resource,true);
      }
 else       if (resource instanceof AutoCloseable) {
        ((AutoCloseable)resource).close();
      }
 else       if (resource instanceof Runnable) {
        ((Runnable)resource).run();
      }
    }
 catch (    Throwable t) {
      LOG.warn("String_Node_Str",resource,t);
    }
  }
}
Program: 6427
Project: 6427
Buggy source:
private Runnable createCleanupTask(final Object... resources){
  return new Runnable(){
    @Override public void run(){
      for (      Object resource : resources) {
        if (resource == null) {
          continue;
        }
        try {
          if (resource instanceof File) {
            if (((File)resource).isDirectory()) {
              DirUtils.deleteDirectoryContents((File)resource);
            }
 else {
              ((File)resource).delete();
            }
          }
 else           if (resource instanceof Location) {
            Locations.deleteQuietly((Location)resource);
          }
 else           if (resource instanceof AutoCloseable) {
            ((AutoCloseable)resource).close();
          }
 else           if (resource instanceof Runnable) {
            ((Runnable)resource).run();
          }
        }
 catch (        Throwable t) {
          LOG.warn("String_Node_Str",resource,t);
        }
      }
    }
  }
;
}

Fixed version (ground truth):
private Runnable createCleanupTask(final Object... resources){
  return new Runnable(){
    @Override public void run(){
      for (      Object resource : resources) {
        if (resource == null) {
          continue;
        }
        try {
          if (resource instanceof File) {
            if (((File)resource).isDirectory()) {
              DirUtils.deleteDirectoryContents((File)resource);
            }
 else {
              ((File)resource).delete();
            }
          }
 else           if (resource instanceof Location) {
            Locations.deleteQuietly((Location)resource,true);
          }
 else           if (resource instanceof AutoCloseable) {
            ((AutoCloseable)resource).close();
          }
 else           if (resource instanceof Runnable) {
            ((Runnable)resource).run();
          }
        }
 catch (        Throwable t) {
          LOG.warn("String_Node_Str",resource,t);
        }
      }
    }
  }
;
}
Program: 6429
Project: 6429
Buggy source:
protected ClientConfig getClientConfig(){
  ClientConfig.Builder builder=new ClientConfig.Builder();
  builder.setConnectionConfig(InstanceURIParser.DEFAULT.parse(URI.create(getInstanceURI()).toString()));
  if (accessToken != null) {
    builder.setAccessToken(accessToken);
  }
  builder.setDefaultConnectTimeout(120000);
  builder.setDefaultReadTimeout(120000);
  builder.setUploadConnectTimeout(0);
  builder.setUploadConnectTimeout(0);
  return builder.build();
}

Fixed version (ground truth):
protected ClientConfig getClientConfig(){
  ClientConfig.Builder builder=new ClientConfig.Builder();
  builder.setConnectionConfig(InstanceURIParser.DEFAULT.parse(URI.create(getInstanceURI()).toString()));
  if (accessToken != null) {
    builder.setAccessToken(accessToken);
  }
  builder.setDefaultConnectTimeout(120000);
  builder.setDefaultReadTimeout(120000);
  builder.setUploadConnectTimeout(0);
  builder.setUploadReadTimeout(0);
  return builder.build();
}
Program: 6430
Project: 6430
Buggy source:
/** 
 * Get queue at namespace level if it is empty returns the default queue.
 * @param namespaceId NamespaceId
 * @return schedule queue at namespace level or default queue.
 */
@Nullable public String getQueue(Id.Namespace namespaceId){
  NamespaceMeta meta=store.getNamespace(namespaceId);
  if (meta != null) {
    NamespaceConfig config=meta.getConfig();
    return config.getSchedulerQueueName() != null ? config.getSchedulerQueueName() : getDefaultQueue();
  }
 else {
    return getDefaultQueue();
  }
}

Fixed version (ground truth):
/** 
 * Get queue at namespace level if it is empty returns the default queue.
 * @param namespaceId NamespaceId
 * @return schedule queue at namespace level or default queue.
 */
@Nullable public String getQueue(Id.Namespace namespaceId){
  NamespaceMeta meta=store.getNamespace(namespaceId);
  if (meta != null) {
    NamespaceConfig config=meta.getConfig();
    String namespaceQueue=config.getSchedulerQueueName();
    return Strings.isNullOrEmpty(namespaceQueue) ? getDefaultQueue() : namespaceQueue;
  }
 else {
    return getDefaultQueue();
  }
}
Program: 6431
Project: 6431
Buggy source:
/** 
 * Add secure tokens to the   {@link TwillPreparer}.
 */
private TwillPreparer addSecureStore(TwillPreparer preparer,LocationFactory locationFactory){
  Credentials credentials=new Credentials();
  if (User.isHBaseSecurityEnabled(hConf)) {
    HBaseTokenUtils.obtainToken(hConf,credentials);
  }
  try {
    if (locationFactory instanceof HDFSLocationFactory) {
      YarnUtils.addDelegationTokens(hConf,locationFactory,credentials);
    }
 else     if (locationFactory instanceof FileContextLocationFactory) {
      List<Token<?>> tokens=((FileContextLocationFactory)locationFactory).getFileContext().getDelegationTokens(new Path(locationFactory.getHomeLocation().toURI()),YarnUtils.getYarnTokenRenewer(hConf));
      for (      Token<?> token : tokens) {
        credentials.addToken(token.getService(),token);
      }
    }
  }
 catch (  IOException e) {
    throw Throwables.propagate(e);
  }
  if (!credentials.getAllTokens().isEmpty()) {
    preparer.addSecureStore(YarnSecureStore.create(credentials));
  }
  return preparer;
}

Fixed version (ground truth):
/** 
 * Add secure tokens to the   {@link TwillPreparer}.
 */
private TwillPreparer addSecureStore(TwillPreparer preparer,LocationFactory locationFactory){
  Credentials credentials=new Credentials();
  if (User.isHBaseSecurityEnabled(hConf)) {
    HBaseTokenUtils.obtainToken(hConf,credentials);
  }
  try {
    if (UserGroupInformation.isSecurityEnabled()) {
      if (locationFactory instanceof HDFSLocationFactory) {
        YarnUtils.addDelegationTokens(hConf,locationFactory,credentials);
      }
 else       if (locationFactory instanceof FileContextLocationFactory) {
        List<Token<?>> tokens=((FileContextLocationFactory)locationFactory).getFileContext().getDelegationTokens(new Path(locationFactory.getHomeLocation().toURI()),YarnUtils.getYarnTokenRenewer(hConf));
        for (        Token<?> token : tokens) {
          credentials.addToken(token.getService(),token);
        }
      }
    }
  }
 catch (  IOException e) {
    throw Throwables.propagate(e);
  }
  if (!credentials.getAllTokens().isEmpty()) {
    preparer.addSecureStore(YarnSecureStore.create(credentials));
  }
  return preparer;
}
Program: 6432
Project: 6432
Buggy source:
private DynamicDatasetCache entryForCurrentThread(){
  try {
    return perThreadMap.get(Thread.currentThread().getId());
  }
 catch (  ExecutionException e) {
    throw Throwables.propagate(e);
  }
}

Fixed version (ground truth):
private DynamicDatasetCache entryForCurrentThread(){
  try {
    return perThreadMap.get(Thread.currentThread());
  }
 catch (  ExecutionException e) {
    throw Throwables.propagate(e);
  }
}
Program: 6433
Project: 6433
Buggy source:
/** 
 * See   {@link DynamicDatasetCache ).}
 * @param staticDatasets  if non-null, a map from dataset name to runtime arguments. These datasets will beinstantiated immediately, and they will participate in every transaction started through  {@link #newTransactionContext()}.
 */
public MultiThreadDatasetCache(final SystemDatasetInstantiator instantiator,final TransactionSystemClient txClient,final Id.Namespace namespace,final Map<String,String> runtimeArguments,final MetricsContext metricsContext,@Nullable final Map<String,Map<String,String>> staticDatasets){
  super(instantiator,txClient,namespace,runtimeArguments,metricsContext);
  this.perThreadMap=CacheBuilder.newBuilder().weakValues().removalListener(new RemovalListener<Long,DynamicDatasetCache>(){
    @Override @ParametersAreNonnullByDefault public void onRemoval(    RemovalNotification<Long,DynamicDatasetCache> notification){
      DynamicDatasetCache cache=notification.getValue();
      if (cache != null) {
        cache.close();
      }
    }
  }
).build(new CacheLoader<Long,SingleThreadDatasetCache>(){
    @Override @ParametersAreNonnullByDefault public SingleThreadDatasetCache load(    Long threadId) throws Exception {
      return new SingleThreadDatasetCache(instantiator,txClient,namespace,runtimeArguments,metricsContext,staticDatasets);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * See   {@link DynamicDatasetCache ).}
 * @param staticDatasets  if non-null, a map from dataset name to runtime arguments. These datasets will beinstantiated immediately, and they will participate in every transaction started through  {@link #newTransactionContext()}.
 */
public MultiThreadDatasetCache(final SystemDatasetInstantiator instantiator,final TransactionSystemClient txClient,final Id.Namespace namespace,final Map<String,String> runtimeArguments,final MetricsContext metricsContext,@Nullable final Map<String,Map<String,String>> staticDatasets){
  super(instantiator,txClient,namespace,runtimeArguments,metricsContext);
  this.perThreadMap=CacheBuilder.newBuilder().weakKeys().removalListener(new RemovalListener<Thread,DynamicDatasetCache>(){
    @Override @ParametersAreNonnullByDefault public void onRemoval(    RemovalNotification<Thread,DynamicDatasetCache> notification){
      DynamicDatasetCache cache=notification.getValue();
      if (cache != null) {
        cache.close();
      }
    }
  }
).build(new CacheLoader<Thread,SingleThreadDatasetCache>(){
    @Override @ParametersAreNonnullByDefault public SingleThreadDatasetCache load(    Thread thread) throws Exception {
      return new SingleThreadDatasetCache(instantiator,txClient,namespace,runtimeArguments,metricsContext,staticDatasets);
    }
  }
);
}
Program: 6434
Project: 6434
Buggy source:
@Override @ParametersAreNonnullByDefault public SingleThreadDatasetCache load(Long threadId) throws Exception {
  return new SingleThreadDatasetCache(instantiator,txClient,namespace,runtimeArguments,metricsContext,staticDatasets);
}

Fixed version (ground truth):
@Override @ParametersAreNonnullByDefault public SingleThreadDatasetCache load(Thread thread) throws Exception {
  return new SingleThreadDatasetCache(instantiator,txClient,namespace,runtimeArguments,metricsContext,staticDatasets);
}
Program: 6435
Project: 6435
Buggy source:
@Override @ParametersAreNonnullByDefault public void onRemoval(RemovalNotification<Long,DynamicDatasetCache> notification){
  DynamicDatasetCache cache=notification.getValue();
  if (cache != null) {
    cache.close();
  }
}

Fixed version (ground truth):
@Override @ParametersAreNonnullByDefault public void onRemoval(RemovalNotification<Thread,DynamicDatasetCache> notification){
  DynamicDatasetCache cache=notification.getValue();
  if (cache != null) {
    cache.close();
  }
}
Program: 6436
Project: 6436
Buggy source:
@Test public void testDatasetCache() throws IOException, DatasetManagementException, TransactionFailureException, InterruptedException {
  final Map<String,TestDataset> thread1map=new HashMap<>();
  final Map<String,TestDataset> thread2map=new HashMap<>();
  Thread thread1=createThread(thread1map);
  Thread thread2=createThread(thread2map);
  thread1.start();
  thread2.start();
  thread1.join();
  thread2.join();
  Assert.assertNotSame(thread1map.get("String_Node_Str"),thread2map.get("String_Node_Str"));
  Assert.assertNotSame(thread1map.get("String_Node_Str"),thread2map.get("String_Node_Str"));
}

Fixed version (ground truth):
@Test() public void testDatasetCache() throws Exception {
  Map<String,TestDataset> thread1map=new HashMap<>();
  Map<String,TestDataset> thread2map=new HashMap<>();
  Thread thread1=createThread(thread1map);
  Thread thread2=createThread(thread2map);
  thread1.start();
  thread2.start();
  thread1.join();
  thread2.join();
  Assert.assertNotSame(thread1map.get("String_Node_Str"),thread2map.get("String_Node_Str"));
  Assert.assertNotSame(thread1map.get("String_Node_Str"),thread2map.get("String_Node_Str"));
  thread1=thread2=null;
  thread1map=thread2map=null;
  Tasks.waitFor(true,new Callable<Boolean>(){
    @Override public Boolean call() throws Exception {
      System.gc();
      return ((MultiThreadDatasetCache)cache).getCacheKeys().isEmpty();
    }
  }
,5,TimeUnit.SECONDS,100,TimeUnit.MILLISECONDS);
}
Program: 6437
Project: 6437
Buggy source:
@Test public void testKVToKV() throws Exception {
  ETLStage source=new ETLStage("String_Node_Str",ImmutableMap.of(Properties.BatchReadableWritable.NAME,"String_Node_Str"));
  ETLStage sink=new ETLStage("String_Node_Str",ImmutableMap.of(Properties.BatchReadableWritable.NAME,"String_Node_Str"));
  ETLStage transform=new ETLStage("String_Node_Str",ImmutableMap.<String,String>of());
  List<ETLStage> transformList=Lists.newArrayList(transform);
  ETLBatchConfig etlConfig=new ETLBatchConfig("String_Node_Str",source,sink,transformList);
  AppRequest<ETLBatchConfig> appRequest=new AppRequest<>(ETLBATCH_ARTIFACT,etlConfig);
  Id.Application appId=Id.Application.from(Id.Namespace.DEFAULT,"String_Node_Str");
  ApplicationManager appManager=deployApplication(appId,appRequest);
  DataSetManager<KeyValueTable> table1=getDataset("String_Node_Str");
  KeyValueTable inputTable=table1.get();
  for (int i=0; i < 10000; i++) {
    inputTable.write("String_Node_Str" + i,"String_Node_Str" + i);
  }
  table1.flush();
  MapReduceManager mrManager=appManager.getMapReduceManager(ETLMapReduce.NAME);
  mrManager.start();
  mrManager.waitForFinish(5,TimeUnit.MINUTES);
  DataSetManager<KeyValueTable> table2=getDataset("String_Node_Str");
  KeyValueTable outputTable=table2.get();
  for (int i=0; i < 10000; i++) {
    Assert.assertEquals("String_Node_Str" + i,Bytes.toString(outputTable.read("String_Node_Str" + i)));
  }
}

Fixed version (ground truth):
@Test public void testKVToKV() throws Exception {
  ETLStage source=new ETLStage("String_Node_Str",ImmutableMap.of(Properties.BatchReadableWritable.NAME,"String_Node_Str"));
  ETLStage sink=new ETLStage("String_Node_Str",ImmutableMap.of(Properties.BatchReadableWritable.NAME,"String_Node_Str"));
  ETLStage transform=new ETLStage("String_Node_Str",ImmutableMap.<String,String>of());
  List<ETLStage> transformList=Lists.newArrayList(transform);
  ETLBatchConfig etlConfig=new ETLBatchConfig("String_Node_Str",source,sink,transformList);
  AppRequest<ETLBatchConfig> appRequest=new AppRequest<>(ETLBATCH_ARTIFACT,etlConfig);
  Id.Application appId=Id.Application.from(Id.Namespace.DEFAULT,"String_Node_Str");
  ApplicationManager appManager=deployApplication(appId,appRequest);
  DataSetManager<KeyValueTable> table1=getDataset("String_Node_Str");
  KeyValueTable inputTable=table1.get();
  for (int i=0; i < 10000; i++) {
    inputTable.write("String_Node_Str" + i,"String_Node_Str" + i);
  }
  table1.flush();
  MapReduceManager mrManager=appManager.getMapReduceManager(ETLMapReduce.NAME);
  mrManager.start();
  mrManager.waitForFinish(5,TimeUnit.MINUTES);
  DataSetManager<KeyValueTable> table2=getDataset("String_Node_Str");
  try (KeyValueTable outputTable=table2.get()){
    for (int i=0; i < 10000; i++) {
      Assert.assertEquals("String_Node_Str" + i,Bytes.toString(outputTable.read("String_Node_Str" + i)));
    }
  }
 }
Program: 6440
Project: 6440
Buggy source:
@Test public void testKVToKVMeta() throws Exception {
  ETLStage source=new ETLStage("String_Node_Str",ImmutableMap.of(Properties.BatchReadableWritable.NAME,"String_Node_Str"));
  ETLStage sink=new ETLStage("String_Node_Str",ImmutableMap.of(Properties.BatchReadableWritable.NAME,"String_Node_Str"));
  ETLBatchConfig etlConfig=new ETLBatchConfig("String_Node_Str",source,sink);
  AppRequest<ETLBatchConfig> appRequest=new AppRequest<>(ETLBATCH_ARTIFACT,etlConfig);
  Id.Application appId=Id.Application.from(Id.Namespace.DEFAULT,"String_Node_Str");
  ApplicationManager appManager=deployApplication(appId,appRequest);
  MapReduceManager mrManager=appManager.getMapReduceManager(ETLMapReduce.NAME);
  mrManager.start();
  mrManager.waitForFinish(5,TimeUnit.MINUTES);
  DataSetManager<KeyValueTable> sourceMetaTable=getDataset(MetaKVTableSource.META_TABLE);
  KeyValueTable sourceTable=sourceMetaTable.get();
  Assert.assertEquals(MetaKVTableSource.PREPARE_RUN_KEY,Bytes.toString(sourceTable.read(MetaKVTableSource.PREPARE_RUN_KEY)));
  Assert.assertEquals(MetaKVTableSource.FINISH_RUN_KEY,Bytes.toString(sourceTable.read(MetaKVTableSource.FINISH_RUN_KEY)));
  DataSetManager<KeyValueTable> sinkMetaTable=getDataset(MetaKVTableSink.META_TABLE);
  KeyValueTable sinkTable=sinkMetaTable.get();
  Assert.assertEquals(MetaKVTableSink.PREPARE_RUN_KEY,Bytes.toString(sinkTable.read(MetaKVTableSink.PREPARE_RUN_KEY)));
  Assert.assertEquals(MetaKVTableSink.FINISH_RUN_KEY,Bytes.toString(sinkTable.read(MetaKVTableSink.FINISH_RUN_KEY)));
}

Fixed version (ground truth):
@Test public void testKVToKVMeta() throws Exception {
  ETLStage source=new ETLStage("String_Node_Str",ImmutableMap.of(Properties.BatchReadableWritable.NAME,"String_Node_Str"));
  ETLStage sink=new ETLStage("String_Node_Str",ImmutableMap.of(Properties.BatchReadableWritable.NAME,"String_Node_Str"));
  ETLBatchConfig etlConfig=new ETLBatchConfig("String_Node_Str",source,sink);
  AppRequest<ETLBatchConfig> appRequest=new AppRequest<>(ETLBATCH_ARTIFACT,etlConfig);
  Id.Application appId=Id.Application.from(Id.Namespace.DEFAULT,"String_Node_Str");
  ApplicationManager appManager=deployApplication(appId,appRequest);
  MapReduceManager mrManager=appManager.getMapReduceManager(ETLMapReduce.NAME);
  mrManager.start();
  mrManager.waitForFinish(5,TimeUnit.MINUTES);
  DataSetManager<KeyValueTable> sourceMetaTable=getDataset(MetaKVTableSource.META_TABLE);
  KeyValueTable sourceTable=sourceMetaTable.get();
  Assert.assertEquals(MetaKVTableSource.PREPARE_RUN_KEY,Bytes.toString(sourceTable.read(MetaKVTableSource.PREPARE_RUN_KEY)));
  Assert.assertEquals(MetaKVTableSource.FINISH_RUN_KEY,Bytes.toString(sourceTable.read(MetaKVTableSource.FINISH_RUN_KEY)));
  DataSetManager<KeyValueTable> sinkMetaTable=getDataset(MetaKVTableSink.META_TABLE);
  try (KeyValueTable sinkTable=sinkMetaTable.get()){
    Assert.assertEquals(MetaKVTableSink.PREPARE_RUN_KEY,Bytes.toString(sinkTable.read(MetaKVTableSink.PREPARE_RUN_KEY)));
    Assert.assertEquals(MetaKVTableSink.FINISH_RUN_KEY,Bytes.toString(sinkTable.read(MetaKVTableSink.FINISH_RUN_KEY)));
  }
 }
Program: 6442
Project: 6442
Buggy source:
public S3AvroOutputFormatProvider(S3AvroSinkConfig config,BatchSinkContext context){
  SimpleDateFormat format=new SimpleDateFormat(config.pathFormat);
  conf=Maps.newHashMap();
  conf.put(JobContext.OUTPUT_KEY_CLASS,AvroKey.class.getName());
  conf.put("String_Node_Str",config.schema);
  conf.put(FileOutputFormat.OUTDIR,String.format("String_Node_Str",config.basePath,format.format(context.getLogicalStartTime())));
}

Fixed version (ground truth):
public S3AvroOutputFormatProvider(S3AvroSinkConfig config,BatchSinkContext context){
  @SuppressWarnings("String_Node_Str") SimpleDateFormat format=new SimpleDateFormat(config.pathFormat);
  conf=Maps.newHashMap();
  conf.put(JobContext.OUTPUT_KEY_CLASS,AvroKey.class.getName());
  conf.put("String_Node_Str",config.schema);
  conf.put(FileOutputFormat.OUTDIR,String.format("String_Node_Str",config.basePath,format.format(context.getLogicalStartTime())));
}
Program: 6443
Project: 6443
Buggy source:
public S3AvroSinkConfig(String basePath,String pathFormat,String schema,String accessID,String accessKey){
  super(basePath,pathFormat,accessID,accessKey);
  this.schema=schema;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public S3AvroSinkConfig(String basePath,String schema,String accessID,String accessKey,String pathFormat,String filesystemProperties){
  super(basePath,accessID,accessKey,pathFormat,filesystemProperties);
  this.schema=schema;
}
Program: 6444
Project: 6444
Buggy source:
@Override public void prepareRun(BatchSinkContext context){
  Job job=context.getHadoopJob();
  Configuration conf=job.getConfiguration();
  conf.set("String_Node_Str",this.config.accessID);
  conf.set("String_Node_Str",this.config.accessKey);
}

Fixed version (ground truth):
@Override public void prepareRun(BatchSinkContext context){
  Job job=context.getHadoopJob();
  Configuration conf=job.getConfiguration();
  if (config.fileSystemProperties != null) {
    Map<String,String> properties=GSON.fromJson(config.fileSystemProperties,MAP_STRING_STRING_TYPE);
    for (    Map.Entry<String,String> entry : properties.entrySet()) {
      conf.set(entry.getKey(),entry.getValue());
    }
  }
}
Program: 6445
Project: 6445
Buggy source:
public S3BatchSinkConfig(String basePath,String pathFormat,String accessID,String accessKey){
  this.basePath=basePath;
  this.pathFormat=pathFormat == null || pathFormat.isEmpty() ? DEFAULT_PATH_FORMAT : pathFormat;
  this.accessID=accessID;
  this.accessKey=accessKey;
}

Fixed version (ground truth):
public S3BatchSinkConfig(String basePath,String accessID,String accessKey,@Nullable String pathFormat,@Nullable String fileSystemProperties){
  this.basePath=basePath;
  this.pathFormat=pathFormat == null || pathFormat.isEmpty() ? DEFAULT_PATH_FORMAT : pathFormat;
  this.accessID=accessID;
  this.accessKey=accessKey;
  this.fileSystemProperties=updateFileSystemProperties(fileSystemProperties,accessID,accessKey);
}
Program: 6446
Project: 6446
Buggy source:
protected S3BatchSink(S3BatchSinkConfig config){
  this.config=config;
}

Fixed version (ground truth):
protected S3BatchSink(S3BatchSinkConfig config){
  this.config=config;
  this.config.fileSystemProperties=updateFileSystemProperties(this.config.fileSystemProperties,this.config.accessID,this.config.accessKey);
}
Program: 6447
Project: 6447
Buggy source:
public S3ParquetOutputFormatProvider(S3ParquetSinkConfig config,BatchSinkContext context){
  SimpleDateFormat format=new SimpleDateFormat(config.pathFormat);
  conf=Maps.newHashMap();
  conf.put("String_Node_Str",config.schema);
  conf.put(FileOutputFormat.OUTDIR,String.format("String_Node_Str",config.basePath,format.format(context.getLogicalStartTime())));
}

Fixed version (ground truth):
public S3ParquetOutputFormatProvider(S3ParquetSinkConfig config,BatchSinkContext context){
  @SuppressWarnings("String_Node_Str") SimpleDateFormat format=new SimpleDateFormat(config.pathFormat);
  conf=Maps.newHashMap();
  conf.put("String_Node_Str",config.schema);
  conf.put(FileOutputFormat.OUTDIR,String.format("String_Node_Str",config.basePath,format.format(context.getLogicalStartTime())));
}
Program: 6448
Project: 6448
Buggy source:
public S3ParquetSinkConfig(String basePath,String pathFormat,String schema,String accessID,String accessKey){
  super(basePath,pathFormat,accessID,accessKey);
  this.schema=schema;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public S3ParquetSinkConfig(String basePath,String schema,String accessID,String accessKey,String pathFormat,String fileSystemProperties){
  super(basePath,accessID,accessKey,pathFormat,fileSystemProperties);
  this.schema=schema;
}
Program: 6450
Project: 6450
Buggy source:
/** 
 * Returns the upper bound beyond which we can compact any increment deltas into a new sum.
 * @param columnFamily the column family name
 * @return the newest timestamp beyond which can compact delta increments
 */
public long getCompactionBound(byte[] columnFamily){
  if (txnlFamilies.contains(columnFamily)) {
    TransactionSnapshot snapshot=cache.getLatestState();
    return snapshot != null ? snapshot.getVisibilityUpperBound() : 0;
  }
 else {
    return Long.MAX_VALUE;
  }
}

Fixed version (ground truth):
/** 
 * Returns the upper bound beyond which we can compact any increment deltas into a new sum.
 * @param columnFamily the column family name
 * @return the newest timestamp beyond which can compact delta increments
 */
public long getCompactionBound(byte[] columnFamily){
  if (txnlFamilies.contains(columnFamily)) {
    TransactionVisibilityState snapshot=cache.getLatestState();
    return snapshot != null ? snapshot.getVisibilityUpperBound() : 0;
  }
 else {
    return Long.MAX_VALUE;
  }
}
Program: 6452
Project: 6452
Buggy source:
/** 
 * Constructs a new instance.
 * @param queueConfigTableName table name that stores queue configuration
 * @param cConfReader reader to read the latest {@link CConfiguration}
 * @param transactionSnapshotSupplier A supplier for the latest {@link TransactionSnapshot}
 * @param hTableSupplier A supplier for creating {@link HTableInterface}.
 */
ConsumerConfigCache(TableName queueConfigTableName,CConfigurationReader cConfReader,Supplier<TransactionSnapshot> transactionSnapshotSupplier,InputSupplier<HTableInterface> hTableSupplier){
  this.queueConfigTableName=queueConfigTableName;
  this.cConfReader=cConfReader;
  this.transactionSnapshotSupplier=transactionSnapshotSupplier;
  this.hTableSupplier=hTableSupplier;
  this.txCodec=new TransactionCodec();
}

Fixed version (ground truth):
/** 
 * Constructs a new instance.
 * @param queueConfigTableName table name that stores queue configuration
 * @param cConfReader reader to read the latest {@link CConfiguration}
 * @param transactionSnapshotSupplier A supplier for the latest {@link TransactionSnapshot}
 * @param hTableSupplier A supplier for creating {@link HTableInterface}.
 */
ConsumerConfigCache(TableName queueConfigTableName,CConfigurationReader cConfReader,Supplier<TransactionVisibilityState> transactionSnapshotSupplier,InputSupplier<HTableInterface> hTableSupplier){
  this.queueConfigTableName=queueConfigTableName;
  this.cConfReader=cConfReader;
  this.transactionSnapshotSupplier=transactionSnapshotSupplier;
  this.hTableSupplier=hTableSupplier;
  this.txCodec=new TransactionCodec();
}