nus-yam/ex-repair huggingface dataset:
Program: 21032
Project: 21032
Buggy source:
@Test public void testSingleValueLongCompares() throws IOException {
  byte[] rowKey=dataHelper.randomData("String_Node_Str");
  byte[] qualToCheck=dataHelper.randomData("String_Node_Str");
  Table table=getDefaultTable();
  table.put(new Put(rowKey).addColumn(SharedTestEnvRule.COLUMN_FAMILY,qualToCheck,Bytes.toBytes(2000l)));
  Scan rootScan=new Scan().addColumn(SharedTestEnvRule.COLUMN_FAMILY,qualToCheck).withStartRow(rowKey).withStopRow(rowKey);
  Assert.assertNull("String_Node_Str",getFirst(table,rootScan,CompareOp.LESS,1000l));
  Assert.assertNotNull("String_Node_Str",getFirst(table,rootScan,CompareOp.GREATER,1000l));
  Assert.assertNull("String_Node_Str",getFirst(table,rootScan,CompareOp.LESS_OR_EQUAL,1000l));
  Assert.assertNotNull("String_Node_Str",getFirst(table,rootScan,CompareOp.GREATER_OR_EQUAL,1000l));
  Assert.assertNotNull("String_Node_Str",getFirst(table,rootScan,CompareOp.LESS_OR_EQUAL,2000l));
  Assert.assertNotNull("String_Node_Str",getFirst(table,rootScan,CompareOp.GREATER_OR_EQUAL,2000l));
}

Fixed version (ground truth):
@Test @SuppressWarnings("String_Node_Str") public void testSingleValueLongCompares() throws IOException {
  byte[] rowKey=dataHelper.randomData("String_Node_Str");
  byte[] qualToCheck=dataHelper.randomData("String_Node_Str");
  Table table=getDefaultTable();
  table.put(new Put(rowKey).addColumn(SharedTestEnvRule.COLUMN_FAMILY,qualToCheck,Bytes.toBytes(2000l)));
  Scan rootScan=new Scan().addColumn(SharedTestEnvRule.COLUMN_FAMILY,qualToCheck).withStartRow(rowKey).withStopRow(rowKey,true);
  Assert.assertNull("String_Node_Str",getFirst(table,rootScan,CompareOp.LESS,1000l));
  Assert.assertNotNull("String_Node_Str",getFirst(table,rootScan,CompareOp.GREATER,1000l));
  Assert.assertNull("String_Node_Str",getFirst(table,rootScan,CompareOp.LESS_OR_EQUAL,1000l));
  Assert.assertNotNull("String_Node_Str",getFirst(table,rootScan,CompareOp.GREATER_OR_EQUAL,1000l));
  Assert.assertNotNull("String_Node_Str",getFirst(table,rootScan,CompareOp.LESS_OR_EQUAL,2000l));
  Assert.assertNotNull("String_Node_Str",getFirst(table,rootScan,CompareOp.GREATER_OR_EQUAL,2000l));
}
Program: 21033
Project: 21033
Buggy source:
@Test public void testGetScannerBeforeTimestamp() throws IOException {
  Table table=getDefaultTable();
  byte[] rowKey=dataHelper.randomData("String_Node_Str");
  byte[] qual=dataHelper.randomData("String_Node_Str");
  byte[][] values=dataHelper.randomData("String_Node_Str",2);
  long ts1=100000l;
  long ts2=200000l;
  table.put(new Put(rowKey).addColumn(COLUMN_FAMILY,qual,ts1,values[0]));
  table.put(new Put(rowKey).addColumn(COLUMN_FAMILY,qual,ts2,values[1]));
  Scan scan1=new Scan().withStartRow(rowKey).withStopRow(rowFollowing(rowKey)).setTimeRange(0,ts1);
  try (ResultScanner resultScanner=table.getScanner(scan1)){
    Assert.assertNull(resultScanner.next());
  }
   Scan scan2=new Scan().withStartRow(rowKey).withStopRow(rowFollowing(rowKey)).setTimeRange(0,ts2 + 1);
  try (ResultScanner resultScanner=table.getScanner(scan2)){
    Result result=resultScanner.next();
    Assert.assertNotNull(result);
    Assert.assertArrayEquals(values[1],CellUtil.cloneValue(result.getColumnLatestCell(COLUMN_FAMILY,qual)));
  }
   Scan scan3=new Scan().withStartRow(rowKey).withStartRow(rowFollowing(rowKey)).setTimeRange(0,ts1 + 1);
  try (ResultScanner resultScanner=table.getScanner(scan3)){
    Result result=resultScanner.next();
    Assert.assertNotNull(result);
    Assert.assertArrayEquals(values[0],CellUtil.cloneValue(result.getColumnLatestCell(COLUMN_FAMILY,qual)));
  }
 }

Fixed version (ground truth):
@Test public void testGetScannerBeforeTimestamp() throws IOException {
  Table table=getDefaultTable();
  byte[] rowKey=dataHelper.randomData("String_Node_Str");
  byte[] qual=dataHelper.randomData("String_Node_Str");
  byte[][] values=dataHelper.randomData("String_Node_Str",2);
  long ts1=100000l;
  long ts2=200000l;
  table.put(new Put(rowKey).addColumn(COLUMN_FAMILY,qual,ts1,values[0]));
  table.put(new Put(rowKey).addColumn(COLUMN_FAMILY,qual,ts2,values[1]));
  Scan scan1=new Scan().withStartRow(rowKey).withStopRow(rowFollowing(rowKey)).setTimeRange(0,ts1);
  try (ResultScanner resultScanner=table.getScanner(scan1)){
    Assert.assertNull(resultScanner.next());
  }
   Scan scan2=new Scan().withStartRow(rowKey).withStopRow(rowFollowing(rowKey)).setTimeRange(0,ts2 + 1);
  try (ResultScanner resultScanner=table.getScanner(scan2)){
    Result result=resultScanner.next();
    Assert.assertNotNull(result);
    Assert.assertArrayEquals(values[1],CellUtil.cloneValue(result.getColumnLatestCell(COLUMN_FAMILY,qual)));
  }
   Scan scan3=new Scan().withStartRow(rowKey).withStopRow(rowFollowing(rowKey)).setTimeRange(0,ts1 + 1);
  try (ResultScanner resultScanner=table.getScanner(scan3)){
    Result result=resultScanner.next();
    Assert.assertNotNull(result);
    Assert.assertArrayEquals(values[0],CellUtil.cloneValue(result.getColumnLatestCell(COLUMN_FAMILY,qual)));
  }
 }
Program: 21034
Project: 21034
Buggy source:
@Test public void testStartEndEquals() throws IOException {
  Table table=getDefaultTable();
  byte[] rowKey=dataHelper.randomData("String_Node_Str");
  byte[] qualifier=dataHelper.randomData("String_Node_Str");
  byte[] value=dataHelper.randomData("String_Node_Str");
  table.put(new Put(rowKey).addColumn(COLUMN_FAMILY,qualifier,value));
  Scan scan=new Scan();
  scan.withStartRow(rowKey).withStopRow(rowKey);
  try (ResultScanner resultScanner=table.getScanner(scan)){
    Result result=resultScanner.next();
    Assert.assertNotNull(result);
    Cell cell=result.getColumnCells(COLUMN_FAMILY,qualifier).get(0);
    Assert.assertTrue(Bytes.equals(value,ByteString.copyFrom(cell.getValueArray(),cell.getValueOffset(),cell.getValueLength()).toByteArray()));
  }
 }

Fixed version (ground truth):
@Test public void testStartEndEquals() throws IOException {
  Table table=getDefaultTable();
  byte[] rowKey=dataHelper.randomData("String_Node_Str");
  byte[] qualifier=dataHelper.randomData("String_Node_Str");
  byte[] value=dataHelper.randomData("String_Node_Str");
  table.put(new Put(rowKey).addColumn(COLUMN_FAMILY,qualifier,value));
  Scan scan=new Scan().withStartRow(rowKey).withStopRow(rowKey,true);
  try (ResultScanner resultScanner=table.getScanner(scan)){
    Result result=resultScanner.next();
    Assert.assertNotNull(result);
    Cell cell=result.getColumnCells(COLUMN_FAMILY,qualifier).get(0);
    Assert.assertTrue(Bytes.equals(value,ByteString.copyFrom(cell.getValueArray(),cell.getValueOffset(),cell.getValueLength()).toByteArray()));
  }
 }
Program: 21035
Project: 21035
Buggy source:
/** 
 * This is a private alpha release of Cloud Bigtable replication. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy. Updates an app profile within an instance.
 * @param request a {@link com.google.bigtable.admin.v2.UpdateAppProfileRequest} object.
 * @return a {@link @link com.google.longrunning.Operation} object.
 */
Operation updateAppProfile(UpdateAppProfileRequest request);

Fixed version (ground truth):
/** 
 * This is a private alpha release of Cloud Bigtable replication. This feature is not currently available to most Cloud Bigtable customers. This feature might be changed in backward-incompatible ways and is not recommended for production use. It is not subject to any SLA or deprecation policy. Updates an app profile within an instance.
 * @param request a {@link com.google.bigtable.admin.v2.UpdateAppProfileRequest} object.
 * @return a {@link com.google.longrunning.Operation} object.
 */
Operation updateAppProfile(UpdateAppProfileRequest request);
Program: 21036
Project: 21036
Buggy source:
/** 
 * Gets the details of a table asynchronously.
 * @param request a {@link GetTableRequest} object.
 * @return a {@link public CompletableFuture} that returns a {@link Table} object.
 */
public CompletableFuture<Table> getTableAsync(GetTableRequest request){
  return toCompletableFuture(adminClient.getTableAsync(request));
}

Fixed version (ground truth):
/** 
 * Gets the details of a table asynchronously.
 * @param request a {@link GetTableRequest} object.
 * @return a {@link CompletableFuture} that returns a {@link Table} object.
 */
public CompletableFuture<Table> getTableAsync(GetTableRequest request){
  return toCompletableFuture(adminClient.getTableAsync(request));
}
Program: 21037
Project: 21037
Buggy source:
/** 
 * Lists the names of all tables in an instance asynchronously.
 * @param request a {@link ListTablesRequest} object.
 * @return a {@link public CompletableFuture} that returns a {@link ListTablesResponse} object.
 */
public CompletableFuture<ListTablesResponse> listTablesAsync(ListTablesRequest request){
  return toCompletableFuture(adminClient.listTablesAsync(request));
}

Fixed version (ground truth):
/** 
 * Lists the names of all tables in an instance asynchronously.
 * @param request a {@link ListTablesRequest} object.
 * @return a {@link CompletableFuture} that returns a {@link ListTablesResponse} object.
 */
public CompletableFuture<ListTablesResponse> listTablesAsync(ListTablesRequest request){
  return toCompletableFuture(adminClient.listTablesAsync(request));
}
Program: 21038
Project: 21038
Buggy source:
/** 
 * Permanently deletes all rows in a range.
 * @param request a {@link DropRowRangeRequest} object.
 * @return a {@link public CompletableFuture} that returns {@link Empty} object.
 */
public CompletableFuture<Empty> dropRowRangeAsync(DropRowRangeRequest request){
  return toCompletableFuture(adminClient.dropRowRangeAsync(request));
}

Fixed version (ground truth):
/** 
 * Permanently deletes all rows in a range.
 * @param request a {@link DropRowRangeRequest} object.
 * @return a {@link CompletableFuture} that returns {@link Empty} object.
 */
public CompletableFuture<Empty> dropRowRangeAsync(DropRowRangeRequest request){
  return toCompletableFuture(adminClient.dropRowRangeAsync(request));
}
Program: 21039
Project: 21039
Buggy source:
/** 
 * Creates, modifies or deletes a new column family within a specified table.
 * @param request a {@link ModifyColumnFamiliesRequest} object.
 * @return a {@link public CompletableFuture} that returns {@link Table} object that contains the updatedtable structure.
 */
public CompletableFuture<Table> modifyColumnFamilyAsync(ModifyColumnFamiliesRequest request){
  return toCompletableFuture(adminClient.modifyColumnFamilyAsync(request));
}

Fixed version (ground truth):
/** 
 * Creates, modifies or deletes a new column family within a specified table.
 * @param request a {@link ModifyColumnFamiliesRequest} object.
 * @return a {@link CompletableFuture} that returns {@link Table} object that contains the updatedtable structure.
 */
public CompletableFuture<Table> modifyColumnFamilyAsync(ModifyColumnFamiliesRequest request){
  return toCompletableFuture(adminClient.modifyColumnFamilyAsync(request));
}
Program: 21040
Project: 21040
Buggy source:
/** 
 * Permanently deletes a specified table and all of its data.
 * @param request a {@link DeleteTableRequest} object.
 * @return a {@link public CompletableFuture} that returns {@link Empty} object.
 */
public CompletableFuture<Empty> deleteTableAsync(DeleteTableRequest request){
  return toCompletableFuture(adminClient.deleteTableAsync(request));
}

Fixed version (ground truth):
/** 
 * Permanently deletes a specified table and all of its data.
 * @param request a {@link DeleteTableRequest} object.
 * @return a {@link CompletableFuture} that returns {@link Empty} object.
 */
public CompletableFuture<Empty> deleteTableAsync(DeleteTableRequest request){
  return toCompletableFuture(adminClient.deleteTableAsync(request));
}
Program: 21041
Project: 21041
Buggy source:
/** 
 * Cancels the RPC with a specific message.
 * @param message
 */
protected void cancel(final String message){
synchronized (callLock) {
    if (call != null) {
      call.cancel(message,null);
      call=null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Cancels the RPC with a specific message.
 * @param message
 */
protected void cancel(final String message){
  call.cancel(message,null);
}
Program: 21042
Project: 21042
Buggy source:
private CheckAndMutateBuilder getBuilder(byte[] row,byte[] family,byte[] qualifier,CompareOp op,byte[] value) throws Exception {
  CheckAndMutateBuilder builder=getDefaultTable().checkAndMutate(row,family).qualifier(qualifier);
  if (value == null && op != CompareOp.NOT_EQUAL) {
    return builder.ifNotExists();
  }
 else {
    return builder.ifMatches(TestCheckAndMutateHBase2.translate(op),value);
  }
}

Fixed version (ground truth):
private CheckAndMutateBuilder getBuilder(byte[] row,byte[] family,byte[] qualifier,CompareOp op,byte[] value) throws Exception {
  CheckAndMutateBuilder builder=getDefaultTable().checkAndMutate(row,family).qualifier(qualifier);
  if (value == null && op != CompareOp.NOT_EQUAL) {
    return builder.ifNotExists();
  }
 else {
    return builder.ifMatches(CompareOperator.valueOf(op.name()),value);
  }
}
Program: 21043
Project: 21043
Buggy source:
/** 
 * <p>Constructor for BigtableBufferedMutator.</p>
 * @param adapter Converts HBase objects to Bigtable protos
 * @param configuration For Additional configuration. TODO: move this to options
 * @param listener Handles exceptions. By default, it just throws the exception.
 * @param session a {@link com.google.cloud.bigtable.grpc.BigtableSession} to get {@link com.google.cloud.bigtable.config.BigtableOptions},   {@link com.google.cloud.bigtable.grpc.async.AsyncExecutor}and   {@link com.google.cloud.bigtable.grpc.async.BulkMutation} objects fromstarting the async operations on the BigtableDataClient.
 */
public BigtableAsyncBufferedMutator(HBaseRequestAdapter adapter,Configuration configuration,BigtableSession session){
  helper=new BigtableBufferedMutatorHelper(adapter,configuration,session);
}

Fixed version (ground truth):
/** 
 * <p>Constructor for BigtableBufferedMutator.</p>
 * @param adapter Converts HBase objects to Bigtable protos
 * @param configuration For Additional configuration. TODO: move this to options
 * @param session a {@link com.google.cloud.bigtable.grpc.BigtableSession} to get {@link com.google.cloud.bigtable.config.BigtableOptions},   {@link com.google.cloud.bigtable.grpc.async.AsyncExecutor}and   {@link com.google.cloud.bigtable.grpc.async.BulkMutation} objects fromstarting the async operations on the BigtableDataClient.
 */
public BigtableAsyncBufferedMutator(HBaseRequestAdapter adapter,Configuration configuration,BigtableSession session){
  helper=new BigtableBufferedMutatorHelper(adapter,configuration,session);
}
Program: 21044
Project: 21044
Buggy source:
/** 
 * <p> Constructor for BigtableBufferedMutator. </p>
 * @param adapter Converts HBase objects to Bigtable protos
 * @param configuration For Additional configuration. TODO: move this to options
 * @param listener Handles exceptions. By default, it just throws the exception.
 * @param session a {@link com.google.cloud.bigtable.grpc.BigtableSession} to get{@link com.google.cloud.bigtable.config.BigtableOptions},  {@link com.google.cloud.bigtable.grpc.async.AsyncExecutor} and{@link com.google.cloud.bigtable.grpc.async.BulkMutation} objects from starting theasync operations on the BigtableDataClient.
 */
public BigtableBufferedMutatorHelper(HBaseRequestAdapter adapter,Configuration configuration,BigtableSession session){
  this.adapter=adapter;
  this.configuration=configuration;
  this.options=session.getOptions();
  this.asyncExecutor=session.createAsyncExecutor();
  BigtableTableName tableName=this.adapter.getBigtableTableName();
  this.bulkMutation=session.createBulkMutation(tableName);
}

Fixed version (ground truth):
/** 
 * <p> Constructor for BigtableBufferedMutator. </p>
 * @param adapter Converts HBase objects to Bigtable protos
 * @param configuration For Additional configuration. TODO: move this to options
 * @param session a {@link com.google.cloud.bigtable.grpc.BigtableSession} to get{@link com.google.cloud.bigtable.config.BigtableOptions},  {@link com.google.cloud.bigtable.grpc.async.AsyncExecutor} and{@link com.google.cloud.bigtable.grpc.async.BulkMutation} objects from starting theasync operations on the BigtableDataClient.
 */
public BigtableBufferedMutatorHelper(HBaseRequestAdapter adapter,Configuration configuration,BigtableSession session){
  this.adapter=adapter;
  this.configuration=configuration;
  this.options=session.getOptions();
  this.asyncExecutor=session.createAsyncExecutor();
  BigtableTableName tableName=this.adapter.getBigtableTableName();
  this.bulkMutation=session.createBulkMutation(tableName);
}
Program: 21045
Project: 21045
Buggy source:
/** 
 * Waits for the long running operation to complete by polling with exponential backoff.
 * @param operation
 * @param timeout
 * @param timeUnit
 * @throws InterruptedException
 * @throws TimeoutException If the timeout is exceeded.
 */
void waitForOperation(Operation operation,long timeout,TimeUnit timeUnit) throws IOException, TimeoutException ;

Fixed version (ground truth):
/** 
 * Waits for the long running operation to complete by polling with exponential backoff.
 * @param operation
 * @param timeout
 * @param timeUnit
 * @throws IOException
 * @throws TimeoutException If the timeout is exceeded.
 */
void waitForOperation(Operation operation,long timeout,TimeUnit timeUnit) throws IOException, TimeoutException ;
Program: 21046
Project: 21046
Buggy source:
/** 
 * <p>Constructor for RefreshingOAuth2CredentialsInterceptor.</p>
 * @param scheduler a {@link ExecutorService} object.
 * @param credentials a {@link OAuth2Credentials} object.
 */
public RefreshingOAuth2CredentialsInterceptor(ExecutorService scheduler,OAuth2Credentials credentials){
  this.executor=Preconditions.checkNotNull(scheduler);
  this.credentials=Preconditions.checkNotNull(credentials);
  rateLimiter=RateLimiter.create(1);
}

Fixed version (ground truth):
/** 
 * <p>Constructor for RefreshingOAuth2CredentialsInterceptor.</p>
 * @param scheduler a {@link ExecutorService} object.
 * @param credentials a {@link OAuth2Credentials} object.
 */
public RefreshingOAuth2CredentialsInterceptor(ExecutorService scheduler,OAuth2Credentials credentials){
  this.executor=Preconditions.checkNotNull(scheduler);
  this.credentials=Preconditions.checkNotNull(credentials);
  rateLimiter=RateLimiter.create(0.1);
}
Program: 21047
Project: 21047
Buggy source:
/** 
 * Calls   {@link com.google.auth.oauth2.OAuth2Credentials#refreshAccessToken()}.
 * @return HeaderCacheElement containing either a valid {@link com.google.auth.oauth2.AccessToken} or an exception.
 */
private HeaderCacheElement refreshCredentials(){
  if (!rateLimiter.tryAcquire()) {
    LOG.trace("String_Node_Str");
    return new HeaderCacheElement(Status.UNAUTHENTICATED.withDescription("String_Node_Str"));
  }
  try {
    LOG.info("String_Node_Str");
    AccessToken newToken=credentials.refreshAccessToken();
    return new HeaderCacheElement(newToken);
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str",e);
    return new HeaderCacheElement(Status.UNAUTHENTICATED.withDescription("String_Node_Str").withCause(e));
  }
}

Fixed version (ground truth):
/** 
 * Calls   {@link com.google.auth.oauth2.OAuth2Credentials#refreshAccessToken()}.
 * @return HeaderCacheElement containing either a valid {@link com.google.auth.oauth2.AccessToken} or an exception.
 */
private HeaderCacheElement refreshCredentials(){
  try {
    LOG.info("String_Node_Str");
    AccessToken newToken=credentials.refreshAccessToken();
    return new HeaderCacheElement(newToken);
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str",e);
    return new HeaderCacheElement(Status.UNAUTHENTICATED.withDescription("String_Node_Str").withCause(e));
  }
}
Program: 21048
Project: 21048
Buggy source:
private void revokeUnauthToken(HeaderCacheElement oldToken){
synchronized (lock) {
    if (headerCache == oldToken) {
      LOG.warn("String_Node_Str");
      headerCache=EMPTY_HEADER;
    }
 else {
      LOG.info("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private void revokeUnauthToken(HeaderCacheElement oldToken){
  if (!rateLimiter.tryAcquire()) {
    LOG.trace("String_Node_Str");
    return;
  }
synchronized (lock) {
    if (headerCache == oldToken) {
      LOG.warn("String_Node_Str");
      headerCache=EMPTY_HEADER;
    }
 else {
      LOG.info("String_Node_Str");
    }
  }
}
Program: 21049
Project: 21049
Buggy source:
@Override public final Double getFractionConsumed(){
  return rangeTracker.getFractionConsumed();
}

Fixed version (ground truth):
@Override public final Double getFractionConsumed(){
  if (rangeTracker.isDone()) {
    return 1.0;
  }
  return rangeTracker.getFractionConsumed();
}
Program: 21050
Project: 21050
Buggy source:
@Override protected boolean set(@Nullable RespT resp){
  return super.set(resp);
}

Fixed version (ground truth):
@Override public boolean set(@Nullable RespT resp){
  return super.set(resp);
}
Program: 21051
Project: 21051
Buggy source:
/** 
 * <p>Constructor for AbstractRetryingRpcListener.</p>
 * @param retryOptions a {@link com.google.cloud.bigtable.config.RetryOptions} object.
 * @param request a RequestT object.
 * @param retryableRpc a {@link com.google.cloud.bigtable.grpc.async.BigtableAsyncRpc} object.
 * @param callOptions a {@link io.grpc.CallOptions} object.
 * @param retryExecutorService a {@link java.util.concurrent.ScheduledExecutorService} object.
 * @param originalMetadata a {@link io.grpc.Metadata} object.
 */
public AbstractRetryingOperation(RetryOptions retryOptions,RequestT request,BigtableAsyncRpc<RequestT,ResponseT> retryableRpc,CallOptions callOptions,ScheduledExecutorService retryExecutorService,Metadata originalMetadata){
  this.retryOptions=retryOptions;
  this.request=request;
  this.rpc=retryableRpc;
  this.callOptions=callOptions;
  this.retryExecutorService=retryExecutorService;
  this.originalMetadata=originalMetadata;
  this.completionFuture=createCompletionFuture();
}

Fixed version (ground truth):
/** 
 * <p>Constructor for AbstractRetryingRpcListener.</p>
 * @param retryOptions a {@link com.google.cloud.bigtable.config.RetryOptions} object.
 * @param request a RequestT object.
 * @param retryableRpc a {@link com.google.cloud.bigtable.grpc.async.BigtableAsyncRpc} object.
 * @param callOptions a {@link io.grpc.CallOptions} object.
 * @param retryExecutorService a {@link java.util.concurrent.ScheduledExecutorService} object.
 * @param originalMetadata a {@link io.grpc.Metadata} object.
 */
public AbstractRetryingOperation(RetryOptions retryOptions,RequestT request,BigtableAsyncRpc<RequestT,ResponseT> retryableRpc,CallOptions callOptions,ScheduledExecutorService retryExecutorService,Metadata originalMetadata){
  this.retryOptions=retryOptions;
  this.request=request;
  this.rpc=retryableRpc;
  this.callOptions=callOptions;
  this.retryExecutorService=retryExecutorService;
  this.originalMetadata=originalMetadata;
  this.completionFuture=new GrpcFuture<>();
}
Program: 21052
Project: 21052
Buggy source:
/** 
 * This gets called by   {@link ResumingStreamingResultScanner} when a queue is empty via {@link ResponseQueueReader#getNext()}.
 * @param rte a {@link ScanTimeoutException}
 * @throws BigtableRetriesExhaustedException
 */
@Override public void handleTimeout(ScanTimeoutException rte) throws BigtableRetriesExhaustedException {
  if ((clock.currentTimeMillis() - lastResponseMs) < retryOptions.getReadPartialRowTimeoutMillis()) {
    return;
  }
 else {
    retryOnTimeout(rte);
  }
}

Fixed version (ground truth):
/** 
 * This gets called by   {@link ResumingStreamingResultScanner} when a queue is empty via {@link ResponseQueueReader#getNext()}.
 * @param rte a {@link ScanTimeoutException}
 * @throws BigtableRetriesExhaustedException
 */
@Override public void handleTimeout(ScanTimeoutException rte) throws BigtableRetriesExhaustedException {
  if ((clock.currentTimeMillis() - lastResponseMs) >= retryOptions.getReadPartialRowTimeoutMillis()) {
    retryOnTimeout(rte);
  }
}
Program: 21053
Project: 21053
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override protected boolean onOK(Metadata trailers){
  rowMerger.onCompleted();
  return true;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override protected boolean onOK(Metadata trailers){
  rowMerger.onCompleted();
  completionFuture.set("String_Node_Str");
  return true;
}
Program: 21054
Project: 21054
Buggy source:
/** 
 * Given a Scan, build a RowFilter that include matching columns
 * @param scan a {@link org.apache.hadoop.hbase.client.Scan} object.
 * @param hooks a {@link com.google.cloud.bigtable.hbase.adapters.read.ReadHooks} object.
 * @return a {@link com.google.bigtable.v2.RowFilter} object.
 */
public RowFilter buildFilter(Scan scan,ReadHooks hooks){
  RowFilter.Chain.Builder chainBuilder=RowFilter.Chain.newBuilder();
  chainBuilder.addFilters(createColumnFamilyFilter(scan));
  if (scan.getTimeRange() != null && !scan.getTimeRange().isAllTime()) {
    chainBuilder.addFilters(createTimeRangeFilter(scan.getTimeRange()));
  }
  if (scan.getFilter() != null) {
    Optional<RowFilter> userFilter=createUserFilter(scan,hooks);
    if (userFilter.isPresent()) {
      chainBuilder.addFilters(userFilter.get());
    }
  }
  chainBuilder.addFilters(createColumnLimitFilter(scan.getMaxVersions()));
  if (chainBuilder.getFiltersCount() == 1) {
    return chainBuilder.getFilters(0);
  }
 else {
    return RowFilter.newBuilder().setChain(chainBuilder).build();
  }
}

Fixed version (ground truth):
/** 
 * Given a Scan, build a RowFilter that include matching columns
 * @param scan a {@link org.apache.hadoop.hbase.client.Scan} object.
 * @param hooks a {@link com.google.cloud.bigtable.hbase.adapters.read.ReadHooks} object.
 * @return a {@link com.google.bigtable.v2.RowFilter} object.
 */
public RowFilter buildFilter(Scan scan,ReadHooks hooks){
  RowFilter.Chain.Builder chainBuilder=RowFilter.Chain.newBuilder();
  chainBuilder.addFilters(createColumnFamilyFilter(scan));
  if (scan.getTimeRange() != null && !scan.getTimeRange().isAllTime()) {
    chainBuilder.addFilters(createTimeRangeFilter(scan.getTimeRange()));
  }
  chainBuilder.addFilters(createColumnLimitFilter(scan.getMaxVersions()));
  if (scan.getFilter() != null) {
    Optional<RowFilter> userFilter=createUserFilter(scan,hooks);
    if (userFilter.isPresent()) {
      chainBuilder.addFilters(userFilter.get());
    }
  }
  if (chainBuilder.getFiltersCount() == 1) {
    return chainBuilder.getFilters(0);
  }
 else {
    return RowFilter.newBuilder().setChain(chainBuilder).build();
  }
}
Program: 21055
Project: 21055
Buggy source:
@Override public void start(Listener<RespT> responseListener,Metadata headers){
  HeaderCacheElement headerCache=getHeaderSafe();
  if (!headerCache.status.isOk()) {
    responseListener.onClose(headerCache.status,new Metadata());
    return;
  }
  headers.put(AUTHORIZATION_HEADER_KEY,headerCache.header);
  delegate().start(new UnAuthResponseListener<>(responseListener,headerCache),headers);
}

Fixed version (ground truth):
@Override public void start(Listener<RespT> responseListener,Metadata headers){
  HeaderCacheElement headerCache=getHeaderSafe();
  if (!headerCache.status.isOk()) {
    responseListener.onClose(headerCache.status,new Metadata());
    unauthorized=true;
    return;
  }
  headers.put(AUTHORIZATION_HEADER_KEY,headerCache.header);
  delegate().start(new UnAuthResponseListener<>(responseListener,headerCache),headers);
}
Program: 21056
Project: 21056
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public <ReqT,RespT>ClientCall<ReqT,RespT> interceptCall(MethodDescriptor<ReqT,RespT> method,CallOptions callOptions,Channel next){
  return new SimpleForwardingClientCall<ReqT,RespT>(next.newCall(method,callOptions)){
    @Override public void start(    Listener<RespT> responseListener,    Metadata headers){
      HeaderCacheElement headerCache=getHeaderSafe();
      if (!headerCache.status.isOk()) {
        responseListener.onClose(headerCache.status,new Metadata());
        return;
      }
      headers.put(AUTHORIZATION_HEADER_KEY,headerCache.header);
      delegate().start(new UnAuthResponseListener<>(responseListener,headerCache),headers);
    }
  }
;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public <ReqT,RespT>ClientCall<ReqT,RespT> interceptCall(MethodDescriptor<ReqT,RespT> method,CallOptions callOptions,Channel next){
  return new SimpleForwardingClientCall<ReqT,RespT>(next.newCall(method,callOptions)){
    /** 
 * If the header is invalid, this will be set to true. This flag will indicate that delegate().start() was not called. If start() is not called, then don't call delegate().request(), delegate().sendMessage() or delegate().halfClose();
 */
    private boolean unauthorized=false;
    @Override public void start(    Listener<RespT> responseListener,    Metadata headers){
      HeaderCacheElement headerCache=getHeaderSafe();
      if (!headerCache.status.isOk()) {
        responseListener.onClose(headerCache.status,new Metadata());
        unauthorized=true;
        return;
      }
      headers.put(AUTHORIZATION_HEADER_KEY,headerCache.header);
      delegate().start(new UnAuthResponseListener<>(responseListener,headerCache),headers);
    }
    @Override public void request(    int numMessages){
      if (!unauthorized) {
        delegate().request(numMessages);
      }
    }
    @Override public void sendMessage(    ReqT message){
      if (!unauthorized) {
        delegate().sendMessage(message);
      }
    }
    @Override public void halfClose(){
      if (!unauthorized) {
        delegate().halfClose();
      }
    }
    @Override public void cancel(    String message,    Throwable cause){
      if (!unauthorized) {
        delegate().cancel(message,cause);
      }
    }
  }
;
}
Program: 21058
Project: 21058
Buggy source:
@Override public void run(){
  BulkMutationsStats stats=BulkMutationsStats.getInstance();
  long meanLatencyNanos=(long)stats.getMutationTimer().getSnapshot().getMean();
  if (meanLatencyNanos >= highTargetNanos) {
    int current=getCurrentInFlightMaxRpcs();
    int newValue=Math.max(current - throttlingChangeStep,minimumRpcCount);
    if (newValue != current) {
      setCurrentInFlightMaxRpcs(newValue);
      LOG.debug("String_Node_Str",TimeUnit.NANOSECONDS.toMillis(meanLatencyNanos),current,newValue);
    }
  }
 else   if (meanLatencyNanos <= lowTargetNanos && (stats.getThrottlingTimer().getSnapshot().getMean() > TimeUnit.MILLISECONDS.toNanos(1))) {
    int current=getCurrentInFlightMaxRpcs();
    int newValue=Math.max(current + throttlingChangeStep,absoluteMaxInFlightRpcs);
    if (newValue != current) {
      setCurrentInFlightMaxRpcs(newValue);
      LOG.debug("String_Node_Str",TimeUnit.NANOSECONDS.toMillis(meanLatencyNanos),current,newValue);
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  BulkMutationsStats stats=BulkMutationsStats.getInstance();
  long meanLatencyNanos=(long)stats.getMutationTimer().getSnapshot().getMean();
  if (meanLatencyNanos >= highTargetNanos) {
    int current=getCurrentInFlightMaxRpcs();
    int newValue=Math.max(current - throttlingChangeStep,minimumRpcCount);
    if (newValue != current) {
      setCurrentInFlightMaxRpcs(newValue);
      LOG.debug("String_Node_Str",TimeUnit.NANOSECONDS.toMillis(meanLatencyNanos),current,newValue);
    }
  }
 else   if (meanLatencyNanos <= lowTargetNanos && (stats.getThrottlingTimer().getSnapshot().getMean() > TimeUnit.MILLISECONDS.toNanos(1))) {
    int current=getCurrentInFlightMaxRpcs();
    int newValue=Math.min(current + throttlingChangeStep,absoluteMaxInFlightRpcs);
    if (newValue != current) {
      setCurrentInFlightMaxRpcs(newValue);
      LOG.debug("String_Node_Str",TimeUnit.NANOSECONDS.toMillis(meanLatencyNanos),current,newValue);
    }
  }
}
Program: 21059
Project: 21059
Buggy source:
private synchronized static SslContext createSslContext() throws SSLException {
  if (sslBuilder == null) {
    sslBuilder=GrpcSslContexts.forClient();
  }
  return sslBuilder.build();
}

Fixed version (ground truth):
private synchronized static SslContext createSslContext() throws SSLException {
  if (sslBuilder == null) {
    sslBuilder=GrpcSslContexts.forClient().ciphers(null);
  }
  return sslBuilder.build();
}
Program: 21060
Project: 21060
Buggy source:
private Timer getThrottlingTimer(){
  if (mutationTimer == null) {
    mutationTimer=registry.timer("String_Node_Str");
  }
  return mutationTimer;
}

Fixed version (ground truth):
private Timer getThrottlingTimer(){
  if (throttlingTimer == null) {
    throttlingTimer=registry.timer("String_Node_Str");
  }
  return throttlingTimer;
}
Program: 21061
Project: 21061
Buggy source:
@Test public void connectivityTest(){
  String property=System.getProperty("String_Node_Str");
  System.out.println(property);
  if (!"String_Node_Str".equals(property)) {
    return;
  }
  String projectId=System.getProperty("String_Node_Str");
  String instanceId=System.getProperty("String_Node_Str");
  BigtableOptions options=new BigtableOptions.Builder().setProjectId(projectId).setInstanceId(instanceId).setUserAgent("String_Node_Str").build();
  try (BigtableSession bs=new BigtableSession(options)){
    ListTablesRequest request=ListTablesRequest.newBuilder().setParent(options.getInstanceName().getInstanceName()).build();
    bs.getTableAdminClient().listTables(request);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Test public void connectivityTest(){
  String property=System.getProperty("String_Node_Str");
  if (!"String_Node_Str".equals(property)) {
    return;
  }
  String projectId=System.getProperty("String_Node_Str");
  String instanceId=System.getProperty("String_Node_Str");
  BigtableOptions options=new BigtableOptions.Builder().setProjectId(projectId).setInstanceId(instanceId).setUserAgent("String_Node_Str").build();
  try (BigtableSession bs=new BigtableSession(options)){
    ListTablesRequest request=ListTablesRequest.newBuilder().setParent(options.getInstanceName().getInstanceName()).build();
    bs.getTableAdminClient().listTables(request);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 21062
Project: 21062
Buggy source:
private void checkHeader(Metadata metadata){
  System.out.println("String_Node_Str");
  Assert.assertEquals(TABLE_NAME,metadata.get(GoogleCloudResourcePrefixInterceptor.GRPC_RESOURCE_PREFIX_KEY));
}

Fixed version (ground truth):
private void checkHeader(Metadata metadata){
  Assert.assertEquals(TABLE_NAME,metadata.get(GoogleCloudResourcePrefixInterceptor.GRPC_RESOURCE_PREFIX_KEY));
}
Program: 21063
Project: 21063
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override public Result get(Get get) throws IOException {
  LOG.trace("String_Node_Str");
  Timer.Context timerContext=metrics.getTimer.time();
  try (com.google.cloud.bigtable.grpc.scanner.ResultScanner<FlatRow> scanner=client.readFlatRows(hbaseAdapter.adapt(get))){
    return Adapters.FLAT_ROW_ADAPTER.adaptResponse(scanner.next());
  }
 catch (  Throwable t) {
    throw logAndCreateIOException("String_Node_Str",get.getRow(),t);
  }
 finally {
    timerContext.close();
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public Result get(Get get) throws IOException {
  LOG.trace("String_Node_Str");
  Timer.Context timerContext=metrics.getTimer.time();
  Result response=null;
  try (com.google.cloud.bigtable.grpc.scanner.ResultScanner<FlatRow> scanner=client.readFlatRows(hbaseAdapter.adapt(get))){
    response=Adapters.FLAT_ROW_ADAPTER.adaptResponse(scanner.next());
    if (scanner.next() != null) {
      throw new IllegalStateException("String_Node_Str");
    }
  }
 catch (  Throwable t) {
    throw logAndCreateIOException("String_Node_Str",get.getRow(),t);
  }
 finally {
    timerContext.close();
  }
  return response;
}
Program: 21064
Project: 21064
Buggy source:
/** 
 * @return the default bigtable {@link Connection} implementation class found in the classpath.
 */
public static Class<? extends Connection> getConnectionClass(){
  return CONNECTION_CLASS;
}

Fixed version (ground truth):
/** 
 * @return the default bigtable {@link Connection} implementation class found in the classpath.
 */
public static Class<? extends Connection> getConnectionClass(){
  Preconditions.checkState(CONNECTION_CLASS != null,"String_Node_Str");
  return CONNECTION_CLASS;
}
Program: 21065
Project: 21065
Buggy source:
/** 
 * <p>configure.</p>
 * @param projectId a {@link java.lang.String} object.
 * @param instanceId a {@link java.lang.String} object.
 * @return a {@link org.apache.hadoop.conf.Configuration} object.
 */
public static Configuration configure(String projectId,String instanceId){
  Configuration config=new Configuration(false);
  config.set(BigtableOptionsFactory.PROJECT_ID_KEY,projectId);
  config.set(BigtableOptionsFactory.INSTANCE_ID_KEY,instanceId);
  return config;
}

Fixed version (ground truth):
/** 
 * <p>Configure and return an existing   {@link org.apache.hadoop.conf.Configuration}.</p>
 * @param conf a {@link org.apache.hadoop.conf.Configuration} object to configure.
 * @param projectId a {@link java.lang.String} object.
 * @param instanceId a {@link java.lang.String} object.
 * @return the modified {@link org.apache.hadoop.conf.Configuration} object.
 */
public static Configuration configure(Configuration conf,String projectId,String instanceId){
  conf.set(BigtableOptionsFactory.PROJECT_ID_KEY,projectId);
  conf.set(BigtableOptionsFactory.INSTANCE_ID_KEY,instanceId);
  conf.set(HConnection.HBASE_CLIENT_CONNECTION_IMPL,getConnectionClass().getCanonicalName());
  return conf;
}
Program: 21066
Project: 21066
Buggy source:
/** 
 * <p>connect.</p>
 * @param conf a {@link org.apache.hadoop.conf.Configuration} object.
 * @return a {@link org.apache.hadoop.hbase.client.Connection} object.
 */
public static Connection connect(Configuration conf){
  Preconditions.checkState(CONNECTION_CLASS != null,"String_Node_Str");
  try {
    return CONNECTION_CLASS.getConstructor(Configuration.class).newInstance(conf);
  }
 catch (  Exception e) {
    throw new IllegalStateException("String_Node_Str" + CONNECTION_CLASS.getCanonicalName(),e);
  }
}

Fixed version (ground truth):
/** 
 * <p>connect.</p>
 * @param conf a {@link org.apache.hadoop.conf.Configuration} object.
 * @return a {@link org.apache.hadoop.hbase.client.Connection} object.
 */
public static Connection connect(Configuration conf){
  try {
    return getConnectionClass().getConstructor(Configuration.class).newInstance(conf);
  }
 catch (  Exception e) {
    throw new IllegalStateException("String_Node_Str" + CONNECTION_CLASS.getCanonicalName(),e);
  }
}
Program: 21067
Project: 21067
Buggy source:
/** 
 * This gets called by   {@link ResumingStreamingResultScanner} when a queue is empty via {@link ResponseQueueReader#getNext()}.
 * @param rte a {@link ScanTimeoutException}
 * @throws BigtableRetriesExhaustedException
 */
public void handleTimeout(ScanTimeoutException rte) throws BigtableRetriesExhaustedException {
  if ((clock.currentTimeMillis() - lastResponseMs) < retryOptions.getReadPartialRowTimeoutMillis()) {
    return;
  }
 else {
    retryOnTimeout(rte);
  }
}

Fixed version (ground truth):
/** 
 * This gets called by   {@link ResumingStreamingResultScanner} when a queue is empty via {@link ResponseQueueReader#getNext()}.
 * @param rte a {@link ScanTimeoutException}
 * @throws BigtableRetriesExhaustedException
 */
@Override public void handleTimeout(ScanTimeoutException rte) throws BigtableRetriesExhaustedException {
  if ((clock.currentTimeMillis() - lastResponseMs) < retryOptions.getReadPartialRowTimeoutMillis()) {
    return;
  }
 else {
    retryOnTimeout(rte);
  }
}
Program: 21068
Project: 21068
Buggy source:
@Override public void run(){
  this.rowMerger=new RowMerger(rowObserver);
  super.run();
}

Fixed version (ground truth):
@Override public void run(){
  lastResponseMs=clock.currentTimeMillis();
  this.rowMerger=new RowMerger(rowObserver);
  super.run();
}
Program: 21069
Project: 21069
Buggy source:
/** 
 * The amount of milliseconds to wait before issuing a client side timeout for short RPCs.
 * @param shortRpcTimeoutMs
 * @return this for chaining
 */
public Builder setShortRpcTimeoutMs(int shortRpcTimeoutMs){
}

Fixed version (ground truth):
/** 
 * The amount of milliseconds to wait before issuing a client side timeout for short RPCs.
 * @param shortRpcTimeoutMs
 * @return this for chaining
 */
public Builder setShortRpcTimeoutMs(int shortRpcTimeoutMs){
  Preconditions.checkArgument(shortRpcTimeoutMs > 0,"String_Node_Str");
  this.shortRpcTimeoutMs=shortRpcTimeoutMs;
  return this;
}
Program: 21070
Project: 21070
Buggy source:
private static void setClientCallOptions(Configuration configuration,BigtableOptions.Builder bigtableOptionsBuilder){
  CallOptionsConfig.Builder clientCallOptionsBuilder=new CallOptionsConfig.Builder();
  clientCallOptionsBuilder.setUseTimeout(configuration.getBoolean(BIGTABLE_USE_TIMEOUTS_KEY,USE_TIMEOUT_DEFAULT));
  if (configuration.get(BIGTABLE_RPC_TIMEOUT_MS_KEY) != null) {
    clientCallOptionsBuilder.setShortRpcTimeoutMs(configuration.getInt(BIGTABLE_RPC_TIMEOUT_MS_KEY,SHORT_TIMEOUT_MS_DEFAULT));
  }
 else {
    clientCallOptionsBuilder.setShortRpcTimeoutMs(configuration.getInt(HConstants.HBASE_CLIENT_OPERATION_TIMEOUT,SHORT_TIMEOUT_MS_DEFAULT));
  }
  clientCallOptionsBuilder.setLongRpcTimeoutMs(configuration.getInt(HConstants.HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD,LONG_TIMEOUT_MS_DEFAULT));
  bigtableOptionsBuilder.setCallOptionsConfig(clientCallOptionsBuilder.build());
}

Fixed version (ground truth):
private static void setClientCallOptions(Configuration configuration,BigtableOptions.Builder bigtableOptionsBuilder){
  CallOptionsConfig.Builder clientCallOptionsBuilder=new CallOptionsConfig.Builder();
  clientCallOptionsBuilder.setUseTimeout(configuration.getBoolean(BIGTABLE_USE_TIMEOUTS_KEY,USE_TIMEOUT_DEFAULT));
  if (configuration.get(BIGTABLE_RPC_TIMEOUT_MS_KEY) != null) {
    clientCallOptionsBuilder.setShortRpcTimeoutMs(configuration.getInt(BIGTABLE_RPC_TIMEOUT_MS_KEY,SHORT_TIMEOUT_MS_DEFAULT));
  }
 else {
    clientCallOptionsBuilder.setShortRpcTimeoutMs(configuration.getInt(HConstants.HBASE_CLIENT_OPERATION_TIMEOUT,SHORT_TIMEOUT_MS_DEFAULT));
  }
  if (configuration.get(BIGTABLE_LONG_RPC_TIMEOUT_MS_KEY) != null) {
    clientCallOptionsBuilder.setLongRpcTimeoutMs(configuration.getInt(BIGTABLE_LONG_RPC_TIMEOUT_MS_KEY,LONG_TIMEOUT_MS_DEFAULT));
  }
 else {
    clientCallOptionsBuilder.setLongRpcTimeoutMs(configuration.getInt(HConstants.HBASE_CLIENT_SCANNER_TIMEOUT_PERIOD,LONG_TIMEOUT_MS_DEFAULT));
  }
  bigtableOptionsBuilder.setCallOptionsConfig(clientCallOptionsBuilder.build());
}
Program: 21071
Project: 21071
Buggy source:
/** 
 * @return false if there are any outstanding {@link MutateRowRequest} that still need to be sent.
 */
public synchronized boolean isFlushed(){
  return currentBatch == null;
}

Fixed version (ground truth):
/** 
 * @return false if there are any outstanding {@link MutateRowRequest} that still need to be sent.
 */
public boolean isFlushed(){
  return currentBatch == null;
}
Program: 21072
Project: 21072
Buggy source:
@VisibleForTesting void onRpcCompletion(long id){
  resourceLimiter.markCanBeCompleted(id);
  lock.lock();
  try {
    outstandingRequests.remove(id);
    if (isFlushed()) {
      flushedCondition.signal();
    }
  }
  finally {
    lock.unlock();
  }
  resetNoSuccessWarningDeadline();
}

Fixed version (ground truth):
@VisibleForTesting void onRpcCompletion(long id){
  resourceLimiter.markCanBeCompleted(id);
  lock.lock();
  try {
    outstandingRequests.remove(id);
    if (isFlushed()) {
      flushedCondition.signal();
      isFlushed=true;
    }
  }
  finally {
    lock.unlock();
  }
  resetNoSuccessWarningDeadline();
}
Program: 21073
Project: 21073
Buggy source:
/** 
 * <p>onRetryCompletion.</p>
 * @param id a long.
 */
public void onRetryCompletion(long id){
  lock.lock();
  try {
    outstandingRetries.remove(id);
    if (isFlushed()) {
      flushedCondition.signal();
    }
  }
  finally {
    lock.unlock();
  }
  resetNoSuccessWarningDeadline();
}

Fixed version (ground truth):
/** 
 * <p>onRetryCompletion.</p>
 * @param id a long.
 */
public void onRetryCompletion(long id){
  lock.lock();
  try {
    outstandingRetries.remove(id);
    if (isFlushed()) {
      flushedCondition.signal();
      isFlushed=true;
    }
  }
  finally {
    lock.unlock();
  }
  resetNoSuccessWarningDeadline();
}
Program: 21074
Project: 21074
Buggy source:
/** 
 * Register a new RPC operation. Blocks until the requested resources are available. This method must be paired with a call to   {@code addCallback}.
 * @param heapSize The serialized size of the RPC
 * @return An operation id
 * @throws java.lang.InterruptedException if any.
 */
public long registerOperationWithHeapSize(long heapSize) throws InterruptedException {
  long id=resourceLimiter.registerOperationWithHeapSize(heapSize);
  lock.lock();
  try {
    outstandingRequests.add(id);
  }
  finally {
    lock.unlock();
  }
  return id;
}

Fixed version (ground truth):
/** 
 * Register a new RPC operation. Blocks until the requested resources are available. This method must be paired with a call to   {@code addCallback}.
 * @param heapSize The serialized size of the RPC
 * @return An operation id
 * @throws java.lang.InterruptedException if any.
 */
public long registerOperationWithHeapSize(long heapSize) throws InterruptedException {
  long id=resourceLimiter.registerOperationWithHeapSize(heapSize);
  lock.lock();
  try {
    outstandingRequests.add(id);
    isFlushed=false;
  }
  finally {
    lock.unlock();
  }
  return id;
}
Program: 21075
Project: 21075
Buggy source:
/** 
 * <p>hasInflightRequests.</p>
 * @return true if there are any outstanding requests being tracked by this throttler
 */
public boolean hasInflightRequests(){
  lock.lock();
  try {
    return outstandingRequests.size() > 0;
  }
  finally {
    lock.unlock();
  }
}

Fixed version (ground truth):
/** 
 * <p>hasInflightRequests.</p>
 * @return true if there are any outstanding requests being tracked by this throttler
 */
public boolean hasInflightRequests(){
  return !isFlushed;
}
Program: 21076
Project: 21076
Buggy source:
/** 
 * Closes the   {@link ResultScanner},   {@link Table}, and   {@link Connection}.
 */
@Override public void close() throws IOException {
  scanner.close();
  session.close();
  long totalOps=getRowsReadCount();
  long elapsedTimeMs=System.currentTimeMillis() - workStart;
  long operationsPerSecond=totalOps * 1000 / elapsedTimeMs;
  READER_LOG.info("String_Node_Str",this,totalOps,elapsedTimeMs,operationsPerSecond);
}

Fixed version (ground truth):
/** 
 * Closes the   {@link ResultScanner},   {@link Table}, and   {@link Connection}.
 */
@Override public void close() throws IOException {
  scanner.close();
  session.close();
  long totalOps=getRowsReadCount();
  long elapsedTimeMs=System.currentTimeMillis() - workStart;
  long operationsPerSecond=elapsedTimeMs == 0 ? 0 : (totalOps * 1000 / elapsedTimeMs);
  READER_LOG.info("String_Node_Str",this,totalOps,elapsedTimeMs,operationsPerSecond);
}
Program: 21077
Project: 21077
Buggy source:
@Override public void run(){
  if (!wasCanceled.get()) {
    timerContext.close();
    wasCanceled.set(true);
  }
  if (!listener.hasStatusBeenRecieved()) {
    readRowsCall.cancel("String_Node_Str",null);
  }
}

Fixed version (ground truth):
@Override public synchronized void run(){
  if (!wasCanceled.get()) {
    timerContext.close();
    wasCanceled.set(true);
  }
  if (!listener.hasStatusBeenRecieved()) {
    readRowsCall.cancel("String_Node_Str",null);
  }
}