nus-yam/ex-repair huggingface dataset:
Program: 21078
Project: 21078
Buggy source:
private ResultScanner<Row> streamRows(ReadRowsRequest request){
  final Timer.Context timerContext=readRowsAsync.getRpcMetrics().timeRpc();
  final AtomicBoolean wasCanceled=new AtomicBoolean(false);
  expandPoolIfNecessary(this.bigtableOptions.getChannelCount());
  final ClientCall<ReadRowsRequest,ReadRowsResponse> readRowsCall=readRowsAsync.newCall(CallOptions.DEFAULT);
  ResponseQueueReader reader=new ResponseQueueReader(retryOptions.getReadPartialRowTimeoutMillis(),retryOptions.getStreamingBufferSize());
  final StreamObserverAdapter<ReadRowsResponse> listener=new StreamObserverAdapter<>(readRowsCall,new RowMerger(reader));
  readRowsAsync.start(readRowsCall,request,listener,createMetadata(request.getTableName()));
  CancellationToken cancellationToken=new CancellationToken();
  cancellationToken.addListener(new Runnable(){
    @Override public void run(){
      if (!wasCanceled.get()) {
        timerContext.close();
        wasCanceled.set(true);
      }
      if (!listener.hasStatusBeenRecieved()) {
        readRowsCall.cancel("String_Node_Str",null);
      }
    }
  }
,MoreExecutors.directExecutor());
  return new StreamingBigtableResultScanner(reader,cancellationToken);
}

Fixed version (ground truth):
private ResultScanner<Row> streamRows(ReadRowsRequest request){
  final Timer.Context timerContext=readRowsAsync.getRpcMetrics().timeRpc();
  final AtomicBoolean wasCanceled=new AtomicBoolean(false);
  expandPoolIfNecessary(this.bigtableOptions.getChannelCount());
  final ClientCall<ReadRowsRequest,ReadRowsResponse> readRowsCall=readRowsAsync.newCall(CallOptions.DEFAULT);
  ResponseQueueReader reader=new ResponseQueueReader(retryOptions.getReadPartialRowTimeoutMillis(),retryOptions.getStreamingBufferSize());
  final StreamObserverAdapter<ReadRowsResponse> listener=new StreamObserverAdapter<>(readRowsCall,new RowMerger(reader));
  readRowsAsync.start(readRowsCall,request,listener,createMetadata(request.getTableName()));
  CancellationToken cancellationToken=new CancellationToken();
  cancellationToken.addListener(new Runnable(){
    @Override public synchronized void run(){
      if (!wasCanceled.get()) {
        timerContext.close();
        wasCanceled.set(true);
      }
      if (!listener.hasStatusBeenRecieved()) {
        readRowsCall.cancel("String_Node_Str",null);
      }
    }
  }
,MoreExecutors.directExecutor());
  return new StreamingBigtableResultScanner(reader,cancellationToken);
}
Program: 21079
Project: 21079
Buggy source:
public void update(Row result) throws IOException {
  updateLastFoundKey(result.getKey());
  rowCount++;
  currentErrorBackoff=null;
  timeoutRetryCount=null;
}

Fixed version (ground truth):
public void update(Row result){
  updateLastFoundKey(result.getKey());
  rowCount++;
  currentErrorBackoff=null;
  timeoutRetryCount=null;
}
Program: 21080
Project: 21080
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override public Row next() throws IOException {
  while (true) {
    try {
      Row result=currentDelegate.next();
      if (result == null) {
        close();
      }
 else {
        retryHandler.update(result);
      }
      return result;
    }
 catch (    ScanTimeoutException rte) {
      closeRpcContext();
      closeCurrentDelegate();
      ReadRowsRequest newRequest=retryHandler.handleScanTimeout(rte);
      currentDelegate=scannerFactory.createScanner(newRequest);
      this.rpcContext=rpcMetrics.timeRpc();
    }
catch (    IOExceptionWithStatus ioe) {
      closeRpcContext();
      closeCurrentDelegate();
      ReadRowsRequest newRequest=retryHandler.handleIOException(ioe);
      currentDelegate=scannerFactory.createScanner(newRequest);
      this.rpcContext=rpcMetrics.timeRpc();
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public Row next() throws IOException {
  while (true) {
    try {
      Row result=currentDelegate.next();
      if (result != null) {
        retryHandler.update(result);
      }
      return result;
    }
 catch (    ScanTimeoutException rte) {
      closeRpcContext();
      closeCurrentDelegate();
      ReadRowsRequest newRequest=retryHandler.handleScanTimeout(rte);
      currentDelegate=scannerFactory.createScanner(newRequest);
      this.rpcContext=rpcMetrics.timeRpc();
    }
catch (    IOExceptionWithStatus ioe) {
      closeRpcContext();
      closeCurrentDelegate();
      ReadRowsRequest newRequest=retryHandler.handleIOException(ioe);
      currentDelegate=scannerFactory.createScanner(newRequest);
      this.rpcContext=rpcMetrics.timeRpc();
    }
  }
}
Program: 21081
Project: 21081
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override public void close() throws IOException {
  closeRpcContext();
  closeOperationContext();
  currentDelegate.close();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public synchronized void close() throws IOException {
  closeRpcContext();
  closeOperationContext();
  currentDelegate.close();
}
Program: 21082
Project: 21082
Buggy source:
@Test public void testDelete() throws IOException {
  Delete original=new Delete(toBytes("String_Node_Str"));
  Assert.assertEquals(0,original.compareTo(CoderTestUtil.encodeAndDecode(underTest,original)));
}

Fixed version (ground truth):
@Test public void testDelete() throws IOException {
}
Program: 21083
Project: 21083
Buggy source:
@Test public void testPut() throws IOException {
  Put original=new Put(toBytes("String_Node_Str")).addColumn(toBytes("String_Node_Str"),toBytes("String_Node_Str"),toBytes("String_Node_Str"));
  Assert.assertEquals(0,original.compareTo(CoderTestUtil.encodeAndDecode(underTest,original)));
}

Fixed version (ground truth):
@Test public void testPut() throws IOException {
}
Program: 21084
Project: 21084
Buggy source:
/** 
 * Extracts the byte array from the given   {@link com.google.protobuf.ByteString} without copy.
 * @param buf A buffer from which to extract the array. This buffer must be an instance of a{@code LiteralByteString} in order to be efficient. {@link com.google.protobuf.ByteString#toByteArray()}will be called for all other implementations, including subclasses.
 * @return an array of byte.
 */
public static byte[] zeroCopyGetBytes(final ByteString buf){
  return buf.toByteArray();
}

Fixed version (ground truth):
/** 
 * Extracts the byte array from the given   {@link com.google.protobuf.ByteString} without copy.
 * @param buf A buffer from which to extract the array.
 * @return an array of byte.
 */
public static byte[] zeroCopyGetBytes(final ByteString buf){
  return buf.toByteArray();
}
Program: 21085
Project: 21085
Buggy source:
/** 
 * Extracts the byte array from the given   {@link ByteString} without copy.
 * @param buf A buffer from which to extract the array.  This buffer must beactually an instance of a  {@code LiteralByteString}.
 * @return byte[] representation
 */
public static byte[] zeroCopyGetBytes(final ByteString buf){
  return buf.toByteArray();
}

Fixed version (ground truth):
/** 
 * Extracts the byte array from the given   {@link ByteString} without copy.
 * @param buf A buffer from which to extract the array.
 * @return byte[] representation
 */
public static byte[] zeroCopyGetBytes(final ByteString buf){
  return buf.toByteArray();
}
Program: 21086
Project: 21086
Buggy source:
/** 
 * Calls   {@link BigtableAsyncRpc#call(Object,Listener,CallOptions)} with this as the listener sothat retries happen correctly.
 */
@Override public void run(){
  Metadata metadata=new Metadata();
  metadata.merge(originalMetadata);
  this.call=rpc.call(request,this,callOptions,metadata);
}

Fixed version (ground truth):
/** 
 * Calls   {@link BigtableAsyncRpc#call(Object,Listener,CallOptions,Metadata)} with this as thelistener so that retries happen correctly.
 */
@Override public void run(){
  Metadata metadata=new Metadata();
  metadata.merge(originalMetadata);
  this.call=rpc.call(request,this,callOptions,metadata);
}
Program: 21087
Project: 21087
Buggy source:
/** 
 * Calls   {@link ResultScanner#next()}.
 */
@Override public boolean advance() throws IOException {
  current=scanIterator.next(scanner);
  rowsRead.addAndGet(scanIterator.getRowCount(current));
  boolean isComplete=!scanIterator.isCompletionMarker(current);
  if (!isComplete) {
    rangeTracker.tryReturnRecordAt(true,ByteKey.of(scanIterator.getLatestKey(current)));
  }
  return isComplete;
}

Fixed version (ground truth):
/** 
 * Calls   {@link ResultScanner#next()}.
 */
@Override public boolean advance() throws IOException {
  current=scanIterator.next(scanner);
  rowsRead.addAndGet(scanIterator.getRowCount(current));
  boolean isComplete=scanIterator.isCompletionMarker(current);
  if (!isComplete) {
    rangeTracker.tryReturnRecordAt(true,ByteKey.of(scanIterator.getLatestKey(current)));
  }
  return !isComplete;
}
Program: 21088
Project: 21088
Buggy source:
public BigtableInstanceName(String projectId,String instanceId){
  Preconditions.checkArgument(!Strings.isNullOrEmpty(projectId),"String_Node_Str");
  Preconditions.checkArgument(!Strings.isNullOrEmpty(instanceId),"String_Node_Str");
  this.instanceName=String.format(BIGTABLE_V2_INSTANCE_FMT,instanceId);
}

Fixed version (ground truth):
public BigtableInstanceName(String projectId,String instanceId){
  Preconditions.checkArgument(!Strings.isNullOrEmpty(projectId),"String_Node_Str");
  Preconditions.checkArgument(!Strings.isNullOrEmpty(instanceId),"String_Node_Str");
  this.instanceName=String.format(BIGTABLE_V2_INSTANCE_FMT,projectId,instanceId);
}
Program: 21090
Project: 21090
Buggy source:
@Override public void onNext(ReadRowsResponse readRowsResponse){
  if (complete) {
    onError(new IllegalStateException("String_Node_Str"));
    return;
  }
  if (!readRowsResponse.getLastScannedRowKey().isEmpty()) {
    state.handleLastScannedRowKey(readRowsResponse.getLastScannedRowKey());
  }
  for (  ReadRowsResponse.CellChunk chunk : readRowsResponse.getChunksList()) {
    try {
      state.validateChunk(rowInProgress,previousKey,chunk);
    }
 catch (    RuntimeException e) {
      onError(e);
      return;
    }
    try {
      if (isReset(chunk)) {
        rowInProgress=null;
        state=RowMergerState.NewRow;
        continue;
      }
      if (rowInProgress == null) {
        rowInProgress=new RowInProgress();
        rowInProgress.updateCurrentKey(chunk);
      }
      if (chunk.getValueSize() > 0) {
        rowInProgress.addPartialCellChunk(chunk);
        state=RowMergerState.CellInProgress;
      }
 else       if (rowInProgress.hasChunkInProgess()) {
        rowInProgress.addPartialCellChunk(chunk);
        rowInProgress.completeMultiChunkCell();
        state=RowMergerState.RowInProgress;
      }
 else {
        rowInProgress.addFullChunk(chunk);
        state=RowMergerState.RowInProgress;
      }
      if (isCommit(chunk)) {
        observer.onNext(rowInProgress.createRow());
        previousKey=rowInProgress.getRowKey();
        rowInProgress=null;
        state=RowMergerState.NewRow;
      }
    }
 catch (    IOException e) {
      onError(e);
    }
  }
}

Fixed version (ground truth):
@Override public void onNext(ReadRowsResponse readRowsResponse){
  if (complete) {
    onError(new IllegalStateException("String_Node_Str"));
    return;
  }
  if (!readRowsResponse.getLastScannedRowKey().isEmpty()) {
    state.handleLastScannedRowKey(readRowsResponse.getLastScannedRowKey());
  }
  for (  ReadRowsResponse.CellChunk chunk : readRowsResponse.getChunksList()) {
    try {
      state.validateChunk(rowInProgress,previousKey,chunk);
    }
 catch (    Exception e) {
      onError(e);
      return;
    }
    try {
      if (isReset(chunk)) {
        rowInProgress=null;
        state=RowMergerState.NewRow;
        continue;
      }
      if (rowInProgress == null) {
        rowInProgress=new RowInProgress();
        rowInProgress.updateCurrentKey(chunk);
      }
      if (chunk.getValueSize() > 0) {
        rowInProgress.addPartialCellChunk(chunk);
        state=RowMergerState.CellInProgress;
      }
 else       if (rowInProgress.hasChunkInProgess()) {
        rowInProgress.addPartialCellChunk(chunk);
        rowInProgress.completeMultiChunkCell();
        state=RowMergerState.RowInProgress;
      }
 else {
        rowInProgress.addFullChunk(chunk);
        state=RowMergerState.RowInProgress;
      }
      if (isCommit(chunk)) {
        observer.onNext(rowInProgress.createRow());
        previousKey=rowInProgress.getRowKey();
        rowInProgress=null;
        state=RowMergerState.NewRow;
      }
    }
 catch (    IOException e) {
      onError(e);
    }
  }
}
Program: 21091
Project: 21091
Buggy source:
@Override public synchronized void run(){
  ListenableFuture<MutateRowsResponse> future=null;
  try {
    if (retryId == null) {
      retryId=this.asyncExecutor.getRpcThrottler().registerRetry();
    }
    future=asyncExecutor.mutateRowsAsync(currentRequestManager.build());
  }
 catch (  InterruptedException e) {
    future=Futures.<MutateRowsResponse>immediateFailedFuture(e);
  }
 finally {
    addCallback(future);
  }
}

Fixed version (ground truth):
@Override public synchronized void run(){
  ListenableFuture<MutateRowsResponse> future=null;
  try {
    if (retryId == null) {
      retryId=Long.valueOf(this.asyncExecutor.getRpcThrottler().registerRetry());
    }
    future=asyncExecutor.mutateRowsAsync(currentRequestManager.build());
  }
 catch (  InterruptedException e) {
    future=Futures.<MutateRowsResponse>immediateFailedFuture(e);
  }
 finally {
    addCallback(future);
  }
}
Program: 21092
Project: 21092
Buggy source:
@Override public synchronized void run(){
  ListenableFuture<MutateRowsResponse> future=null;
  try {
    if (retryId == null) {
      retryId=this.asyncExecutor.getRpcThrottler().registerRetry();
    }
    future=asyncExecutor.mutateRowsAsync(currentRequestManager.build());
  }
 catch (  InterruptedException e) {
    future=Futures.<MutateRowsResponse>immediateFailedFuture(e);
  }
 finally {
    addCallback(future);
  }
}

Fixed version (ground truth):
@Override public synchronized void run(){
  ListenableFuture<MutateRowsResponse> future=null;
  try {
    if (retryId == null) {
      retryId=Long.valueOf(this.asyncExecutor.getRpcThrottler().registerRetry());
    }
    future=asyncExecutor.mutateRowsAsync(currentRequestManager.build());
  }
 catch (  InterruptedException e) {
    future=Futures.<MutateRowsResponse>immediateFailedFuture(e);
  }
 finally {
    addCallback(future);
  }
}
Program: 21093
Project: 21093
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Test public void testSampleRowKeys() throws Exception {
  List<SampleRowKeysResponse> sampleRowKeys=new ArrayList<>();
  int count=(int)(AbstractSource.COUNT_MAX_SPLIT_COUNT * 3 - 5);
  byte[][] keys=Bytes.split("String_Node_Str".getBytes(),"String_Node_Str".getBytes(),count - 2);
  long tabletSize=2L * 1024L * 1024L* 1024L;
  long boundary=0;
  for (  byte[] currentKey : keys) {
    boundary+=tabletSize;
    sampleRowKeys.add(SampleRowKeysResponse.newBuilder().setRowKey(ByteString.copyFrom(currentKey)).setOffsetBytes(boundary).build());
  }
  CloudBigtableScanConfiguration config=new CloudBigtableScanConfiguration("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",new Scan());
  CloudBigtableIO.Source source=(Source)CloudBigtableIO.read(config);
  source.setSampleRowKeys(sampleRowKeys);
  List<CloudBigtableIO.SourceWithKeys> splits=source.getSplits(20000);
  Assert.assertTrue(splits.size() <= CloudBigtableIO.AbstractSource.COUNT_MAX_SPLIT_COUNT);
  Iterator<SourceWithKeys> iter=splits.iterator();
  SourceWithKeys last=iter.next();
  while (iter.hasNext()) {
    SourceWithKeys current=iter.next();
    Assert.assertTrue(Bytes.equals(current.getStartRow(),last.getStopRow()));
    if (iter.hasNext()) {
      Assert.assertTrue(Bytes.compareTo(current.getStartRow(),current.getStopRow()) < 0);
    }
    Assert.assertTrue(current.getEstimatedSize() >= tabletSize);
    last=current;
  }
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Test public void testSampleRowKeys() throws Exception {
  List<SampleRowKeysResponse> sampleRowKeys=new ArrayList<>();
  int count=(int)(AbstractSource.COUNT_MAX_SPLIT_COUNT * 3 - 5);
  byte[][] keys=Bytes.split("String_Node_Str".getBytes(),"String_Node_Str".getBytes(),count - 2);
  long tabletSize=2L * 1024L * 1024L* 1024L;
  long boundary=0;
  for (  byte[] currentKey : keys) {
    boundary+=tabletSize;
    try {
      sampleRowKeys.add(SampleRowKeysResponse.newBuilder().setRowKey(ByteString.copyFrom(currentKey)).setOffsetBytes(boundary).build());
    }
 catch (    NoClassDefFoundError e) {
      e.printStackTrace();
      return;
    }
  }
  CloudBigtableScanConfiguration config=new CloudBigtableScanConfiguration("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",new Scan());
  CloudBigtableIO.Source source=(Source)CloudBigtableIO.read(config);
  source.setSampleRowKeys(sampleRowKeys);
  List<CloudBigtableIO.SourceWithKeys> splits=source.getSplits(20000);
  Assert.assertTrue(splits.size() <= CloudBigtableIO.AbstractSource.COUNT_MAX_SPLIT_COUNT);
  Iterator<SourceWithKeys> iter=splits.iterator();
  SourceWithKeys last=iter.next();
  while (iter.hasNext()) {
    SourceWithKeys current=iter.next();
    Assert.assertTrue(Bytes.equals(current.getStartRow(),last.getStopRow()));
    if (iter.hasNext()) {
      Assert.assertTrue(Bytes.compareTo(current.getStartRow(),current.getStopRow()) < 0);
    }
    Assert.assertTrue(current.getEstimatedSize() >= tabletSize);
    last=current;
  }
}
Program: 21094
Project: 21094
Buggy source:
/** 
 * Splits the region based on the start and stop key. Uses  {@link Bytes#split(byte[],byte[],int)} under the covers.
 */
private List<BoundedSource<ResultOutputType>> split(long regionSize,long desiredBundleSizeBytes,byte[] startKey,byte[] stopKey){
  if (regionSize < desiredBundleSizeBytes || stopKey.length == 0) {
    BoundedSource<ResultOutputType> source=createSourceWithKeys(startKey,stopKey,regionSize);
    return Collections.singletonList(source);
  }
 else {
    Preconditions.checkState(desiredBundleSizeBytes > 0);
    if (stopKey.length > 0) {
      Preconditions.checkState(Bytes.compareTo(startKey,stopKey) <= 0,"String_Node_Str",Bytes.toStringBinary(startKey),Bytes.toStringBinary(stopKey));
      Preconditions.checkState(regionSize > 0,"String_Node_Str",regionSize);
    }
    int splitCount=(int)Math.ceil((double)(regionSize) / (double)(desiredBundleSizeBytes));
    byte[][] splitKeys=Bytes.split(startKey,stopKey,splitCount - 1);
    Preconditions.checkState(splitCount + 1 == splitKeys.length);
    List<BoundedSource<ResultOutputType>> result=new ArrayList<>();
    for (int i=0; i < splitCount; i++) {
      result.add(createSourceWithKeys(splitKeys[i],splitKeys[i + 1],regionSize));
    }
    return result;
  }
}

Fixed version (ground truth):
/** 
 * Splits the region based on the start and stop key. Uses  {@link Bytes#split(byte[],byte[],int)} under the covers.
 */
private List<BoundedSource<ResultOutputType>> split(long regionSize,long desiredBundleSizeBytes,byte[] startKey,byte[] stopKey){
  Preconditions.checkState(desiredBundleSizeBytes > 0);
  int splitCount=(int)Math.ceil((double)(regionSize) / (double)(desiredBundleSizeBytes));
  if (splitCount < 2 || stopKey.length == 0) {
    return Collections.singletonList(createSourceWithKeys(startKey,stopKey,regionSize));
  }
 else {
    if (stopKey.length > 0) {
      Preconditions.checkState(Bytes.compareTo(startKey,stopKey) <= 0,"String_Node_Str",Bytes.toStringBinary(startKey),Bytes.toStringBinary(stopKey));
      Preconditions.checkState(regionSize > 0,"String_Node_Str",regionSize);
    }
    byte[][] splitKeys=Bytes.split(startKey,stopKey,splitCount - 1);
    Preconditions.checkState(splitCount + 1 == splitKeys.length);
    List<BoundedSource<ResultOutputType>> result=new ArrayList<>();
    for (int i=0; i < splitCount; i++) {
      result.add(createSourceWithKeys(splitKeys[i],splitKeys[i + 1],regionSize));
    }
    return result;
  }
}
Program: 21095
Project: 21095
Buggy source:
@VisibleForTesting protected Connection createConnection(Configuration config) throws IOException {
  return new BigtableConnection(config);
}

Fixed version (ground truth):
@VisibleForTesting protected Connection createConnection(Configuration config) throws IOException {
  return new BigtableConnection(config){
    @Override public void close() throws IOException {
      LOG.info("String_Node_Str" + "String_Node_Str");
    }
  }
;
}
Program: 21096
Project: 21096
Buggy source:
/** 
 * Construct an Bigtable GC expression from the given column descriptor.
 */
public static String buildGarbageCollectionExpression(HColumnDescriptor columnDescriptor){
  int maxVersions=columnDescriptor.getMaxVersions();
  int minVersions=columnDescriptor.getMinVersions();
  int ttlSeconds=columnDescriptor.getTimeToLive();
  long bigtableTtl=BigtableConstants.BIGTABLE_TIMEUNIT.convert(ttlSeconds,TimeUnit.SECONDS);
  Preconditions.checkState(minVersions < maxVersions,"String_Node_Str");
  StringBuilder buffer=new StringBuilder();
  if (ttlSeconds != HColumnDescriptor.DEFAULT_TTL) {
    if (minVersions != HColumnDescriptor.DEFAULT_MIN_VERSIONS) {
      buffer.append(String.format("String_Node_Str",bigtableTtl,minVersions));
    }
 else {
      buffer.append(String.format("String_Node_Str",bigtableTtl));
    }
  }
  if (buffer.length() != 0) {
    buffer.append("String_Node_Str");
  }
  buffer.append(String.format("String_Node_Str",maxVersions));
  return buffer.toString();
}

Fixed version (ground truth):
/** 
 * Construct an Bigtable GC expression from the given column descriptor.
 */
public static String buildGarbageCollectionExpression(HColumnDescriptor columnDescriptor){
  int maxVersions=columnDescriptor.getMaxVersions();
  int minVersions=columnDescriptor.getMinVersions();
  int ttlSeconds=columnDescriptor.getTimeToLive();
  long bigtableTtl=BigtableConstants.BIGTABLE_TIMEUNIT.convert(ttlSeconds,TimeUnit.SECONDS);
  Preconditions.checkState(minVersions < maxVersions,"String_Node_Str");
  StringBuilder buffer=new StringBuilder();
  if (ttlSeconds != HColumnDescriptor.DEFAULT_TTL) {
    if (minVersions != HColumnDescriptor.DEFAULT_MIN_VERSIONS) {
      buffer.append(String.format("String_Node_Str",bigtableTtl,minVersions));
    }
 else {
      buffer.append(String.format("String_Node_Str",bigtableTtl));
    }
  }
  if (buffer.length() != 0) {
    buffer.append("String_Node_Str");
  }
  if (maxVersions != Integer.MAX_VALUE) {
    buffer.append(String.format("String_Node_Str",maxVersions));
  }
  return buffer.toString();
}
Program: 21098
Project: 21098
Buggy source:
@Test public void testBlankExpression(){
  expectedException.expectMessage("String_Node_Str");
  expectedException.expect(IllegalArgumentException.class);
  adapter.adapt("String_Node_Str",asColumnFamily("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testBlankExpression(){
  HColumnDescriptor descriptor=adapter.adapt("String_Node_Str",asColumnFamily("String_Node_Str"));
  Assert.assertEquals(Integer.MAX_VALUE,descriptor.getMaxVersions());
  Assert.assertEquals("String_Node_Str",ColumnDescriptorAdapter.buildGarbageCollectionExpression(descriptor));
}
Program: 21099
Project: 21099
Buggy source:
/** 
 * Performs a   {@link BigtableDataClient#checkAndMutateRowAsync(CheckAndMutateRowRequest))} on the{@link CheckAndMutateRowRequest}. This method may block if  {@link HeapSizeManager#registerOperationWithHeapSize(long)} blocks.
 * @param request The {@link CheckAndMutateRowRequest} to send.
 * @return a {@link ListenableFuture} which can be listened to for completion events.
 */
public ListenableFuture<CheckAndMutateRowResponse> checkAndMutateRowAsync(CheckAndMutateRowRequest request) throws InterruptedException {
  return call(CHECK_AND_MUTATE_ASYNC,request);
}

Fixed version (ground truth):
/** 
 * Performs a   {@link BigtableDataClient#checkAndMutateRowAsync(CheckAndMutateRowRequest)} on the{@link CheckAndMutateRowRequest}. This method may block if  {@link HeapSizeManager#registerOperationWithHeapSize(long)} blocks.
 * @param request The {@link CheckAndMutateRowRequest} to send.
 * @return a {@link ListenableFuture} which can be listened to for completion events.
 */
public ListenableFuture<CheckAndMutateRowResponse> checkAndMutateRowAsync(CheckAndMutateRowRequest request) throws InterruptedException {
  return call(CHECK_AND_MUTATE_ASYNC,request);
}
Program: 21101
Project: 21101
Buggy source:
/** 
 * Send the operations to the async executor asynchronously.  The conversion from hbase object to cloud bigtable proto and the async call both take time (microseconds worth) that could be parallelized, or at least removed from the user's thread.
 */
private void offer(Mutation mutation) throws IOException {
  try {
    initializeAsyncMutators();
    long operationId=heapSizeManager.registerOperationWithHeapSize(mutation.heapSize());
    MutationOperation operation=new MutationOperation(mutation,operationId,false);
    if (executorService == null || options.getAsyncMutatorCount() > 0) {
      mutationsToBeSent.add(operation);
    }
 else {
      operation.run();
    }
  }
 catch (  InterruptedException e) {
    Thread.interrupted();
    throw new IOException("String_Node_Str" + Bytes.toString(mutation.getRow()),e);
  }
}

Fixed version (ground truth):
/** 
 * Send the operations to the async executor asynchronously.  The conversion from hbase object to cloud bigtable proto and the async call both take time (microseconds worth) that could be parallelized, or at least removed from the user's thread.
 */
private void offer(Mutation mutation) throws IOException {
  try {
    initializeAsyncMutators();
    long operationId=heapSizeManager.registerOperationWithHeapSize(mutation.heapSize());
    MutationOperation operation=new MutationOperation(mutation,operationId,false);
    if (executorService != null && options.getAsyncMutatorCount() > 0) {
      mutationsToBeSent.add(operation);
    }
 else {
      operation.run();
    }
  }
 catch (  InterruptedException e) {
    Thread.interrupted();
    throw new IOException("String_Node_Str" + Bytes.toString(mutation.getRow()),e);
  }
}
Program: 21102
Project: 21102
Buggy source:
private BigtableBufferedMutator createMutator(Configuration configuration) throws IOException {
  HeapSizeManager heapSizeManager=new HeapSizeManager(AsyncExecutor.ASYNC_MUTATOR_MAX_MEMORY_DEFAULT,AsyncExecutor.MAX_INFLIGHT_RPCS_DEFAULT){
    @Override public <T>FutureCallback<T> addCallback(    ListenableFuture<T> future,    Long id){
      FutureCallback<T> callback=super.addCallback(future,id);
      callbacks.add(callback);
      return callback;
    }
  }
;
  configuration.set(BigtableOptionsFactory.PROJECT_ID_KEY,"String_Node_Str");
  configuration.set(BigtableOptionsFactory.ZONE_KEY,"String_Node_Str");
  configuration.set(BigtableOptionsFactory.CLUSTER_KEY,"String_Node_Str");
  BigtableOptions options=BigtableOptionsFactory.fromConfiguration(configuration);
  HBaseRequestAdapter adapter=new HBaseRequestAdapter(options.getClusterName(),TableName.valueOf("String_Node_Str"),configuration);
  if (options.getAsyncMutatorCount() > 0) {
    executorService=Executors.newCachedThreadPool();
  }
  return new BigtableBufferedMutator(client,adapter,configuration,options,listener,heapSizeManager,executorService);
}

Fixed version (ground truth):
private BigtableBufferedMutator createMutator(Configuration configuration) throws IOException {
  HeapSizeManager heapSizeManager=new HeapSizeManager(AsyncExecutor.ASYNC_MUTATOR_MAX_MEMORY_DEFAULT,AsyncExecutor.MAX_INFLIGHT_RPCS_DEFAULT){
    @Override public <T>FutureCallback<T> addCallback(    ListenableFuture<T> future,    Long id){
      FutureCallback<T> callback=super.addCallback(future,id);
      callbacks.add(callback);
      return callback;
    }
  }
;
  configuration.set(BigtableOptionsFactory.PROJECT_ID_KEY,"String_Node_Str");
  configuration.set(BigtableOptionsFactory.ZONE_KEY,"String_Node_Str");
  configuration.set(BigtableOptionsFactory.CLUSTER_KEY,"String_Node_Str");
  BigtableOptions options=BigtableOptionsFactory.fromConfiguration(configuration);
  HBaseRequestAdapter adapter=new HBaseRequestAdapter(options.getClusterName(),TableName.valueOf("String_Node_Str"),configuration);
  executorService=Executors.newCachedThreadPool();
  return new BigtableBufferedMutator(client,adapter,configuration,options,listener,heapSizeManager,executorService);
}
Program: 21103
Project: 21103
Buggy source:
/** 
 * Waits for a completion and then marks it as complete.
 */
private void waitForCompletions(long timeoutMs){
  try {
    Long completedOperation=this.completedOperationIds.pollFirst(timeoutMs,TimeUnit.MILLISECONDS);
    if (completedOperation != null) {
      markCanBeCompleted(completedOperation);
    }
  }
 catch (  InterruptedException e) {
  }
}

Fixed version (ground truth):
/** 
 * Waits for a completion and then marks it as complete.
 * @throws InterruptedException
 */
private void waitForCompletions(long timeoutMs) throws InterruptedException {
  Long completedOperation=this.completedOperationIds.pollFirst(timeoutMs,TimeUnit.MILLISECONDS);
  if (completedOperation != null) {
    markOperationComplete(completedOperation);
  }
}
Program: 21104
Project: 21104
Buggy source:
public synchronized void flush() throws InterruptedException {
  boolean performedWarning=false;
  while (!pendingOperationsWithSize.isEmpty()) {
    cleanupFinishedOperations();
    if (pendingOperationsWithSize.isEmpty()) {
      break;
    }
    if (!performedWarning && lastOperationChange + INTERVAL_NO_SUCCESS_WARNING < System.currentTimeMillis()) {
      long lastUpdated=(System.currentTimeMillis() - lastOperationChange) / 1000;
      LOG.warn("String_Node_Str" + "String_Node_Str",lastUpdated,pendingOperationsWithSize.size());
      performedWarning=true;
      waitForCompletions(FINISH_WAIT_MILLIS);
    }
  }
  if (performedWarning) {
    LOG.info("String_Node_Str");
  }
}

Fixed version (ground truth):
public synchronized void flush() throws InterruptedException {
  boolean performedWarning=false;
  cleanupFinishedOperations();
  while (!pendingOperationsWithSize.isEmpty()) {
    if (!performedWarning && lastOperationChange + INTERVAL_NO_SUCCESS_WARNING < System.currentTimeMillis()) {
      long lastUpdated=(System.currentTimeMillis() - lastOperationChange) / 1000;
      LOG.warn("String_Node_Str" + "String_Node_Str",lastUpdated,pendingOperationsWithSize.size());
      performedWarning=true;
    }
    waitForCompletions(FINISH_WAIT_MILLIS);
    cleanupFinishedOperations();
  }
  if (performedWarning) {
    LOG.info("String_Node_Str");
  }
}
Program: 21105
Project: 21105
Buggy source:
@Override public Object apply(GeneratedMessage response){
  if (response instanceof com.google.bigtable.v1.Row) {
    return Adapters.ROW_ADAPTER.adaptResponse((com.google.bigtable.v1.Row)response);
  }
 else {
    return new Result();
  }
}

Fixed version (ground truth):
@Override public com.google.bigtable.v1.Row apply(List<com.google.bigtable.v1.Row> rows){
  if (rows.isEmpty()) {
    return null;
  }
 else {
    return rows.get(0);
  }
}
Program: 21106
Project: 21106
Buggy source:
/** 
 * Implementation of   {@link org.apache.hadoop.hbase.client.HTable#batch(List)}
 */
public Object[] batch(List<? extends Row> actions) throws IOException {
  LOG.trace("String_Node_Str");
  Result[] results=new Result[actions.size()];
  try {
    batch(actions,results);
  }
 catch (  InterruptedException e) {
    LOG.error("String_Node_Str",e);
    throw new IOException("String_Node_Str",e);
  }
  return results;
}

Fixed version (ground truth):
public Result[] batch(List<? extends Row> actions) throws IOException {
  try {
    Result[] results=new Result[actions.size()];
    batch(actions,results);
    return results;
  }
 catch (  InterruptedException e) {
    LOG.error("String_Node_Str",e);
    throw new IOException("String_Node_Str",e);
  }
}
Program: 21107
Project: 21107
Buggy source:
@Override public void onFailure(Throwable throwable){
  try {
    if (callback != null) {
      callback.update(NO_REGION,row.getRow(),null);
    }
  }
  finally {
    resultsArray[index]=null;
    resultFuture.setException(throwable);
  }
}

Fixed version (ground truth):
@Override public final void onFailure(Throwable throwable){
  resultsArray[index]=null;
  resultFuture.setException(throwable);
  if (callback != null) {
    callback.update(NO_REGION,row.getRow(),null);
  }
}
Program: 21108
Project: 21108
Buggy source:
public RpcResultFutureCallback(Row row,Batch.Callback<R> callback,int index,Object[] resultsArray,SettableFuture<Object> resultFuture,Function<T,Object> adapter){
  this.row=row;
  this.callback=callback;
  this.index=index;
  this.resultsArray=resultsArray;
  this.resultFuture=resultFuture;
  this.adapter=adapter;
}

Fixed version (ground truth):
public RpcResultFutureCallback(Row row,Batch.Callback<T> callback,int index,Object[] resultsArray,SettableFuture<Result> resultFuture){
  this.row=row;
  this.callback=callback;
  this.index=index;
  this.resultsArray=resultsArray;
  this.resultFuture=resultFuture;
}
Program: 21109
Project: 21109
Buggy source:
/** 
 * Implementation of   {@link org.apache.hadoop.hbase.client.HTable#exists(List)}.
 */
public Boolean[] exists(List<Get> gets) throws IOException {
  LOG.trace("String_Node_Str");
  Result[] getResults=(Result[])batch(gets);
  Boolean[] exists=new Boolean[getResults.length];
  for (int index=0; index < getResults.length; index++) {
    exists[index]=!getResults[index].isEmpty();
  }
  return exists;
}

Fixed version (ground truth):
/** 
 * Implementation of   {@link org.apache.hadoop.hbase.client.Table#existsAll(List)}.
 */
public Boolean[] exists(List<Get> gets) throws IOException {
  Result[] getResults=batch(gets);
  Boolean[] exists=new Boolean[getResults.length];
  for (int index=0; index < getResults.length; index++) {
    exists[index]=!getResults[index].isEmpty();
  }
  return exists;
}
Program: 21110
Project: 21110
Buggy source:
/** 
 * Implementation of  {@link org.apache.hadoop.hbase.client.HTable#batchCallback(List,Object[],Batch.Callback)}
 */
public <R>void batchCallback(List<? extends Row> actions,Object[] results,Batch.Callback<R> callback) throws IOException, InterruptedException {
  LOG.trace("String_Node_Str");
  Preconditions.checkArgument(results.length == actions.size(),"String_Node_Str");
  List<ListenableFuture<Object>> resultFutures=issueRowRequests(actions,results);
  try {
    Futures.successfulAsList(resultFutures).get();
  }
 catch (  ExecutionException e) {
    LOG.error("String_Node_Str",e);
    throw new IOException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Implementation of  {@link org.apache.hadoop.hbase.client.HTable#batchCallback(List,Object[],Batch.Callback)}
 */
public <R>void batchCallback(List<? extends Row> actions,Object[] results,Batch.Callback<R> callback) throws IOException, InterruptedException {
  Preconditions.checkArgument(results.length == actions.size(),"String_Node_Str");
  try {
    Futures.successfulAsList(issueAsyncRowRequests(actions,results,callback)).get();
  }
 catch (  ExecutionException e) {
    LOG.error("String_Node_Str",e);
    throw new IOException("String_Node_Str",e);
  }
}
Program: 21111
Project: 21111
Buggy source:
@Override public void onSuccess(T t){
  try {
    Object result=adapter.apply(t);
    resultsArray[index]=result;
    if (callback != null) {
      callback.update(NO_REGION,row.getRow(),unchecked(result));
    }
    resultFuture.set(result);
  }
 catch (  Throwable throwable) {
    resultFuture.setException(throwable);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public final void onSuccess(GeneratedMessage message){
  try {
    Result result=Result.EMPTY_RESULT;
    if (message instanceof com.google.bigtable.v1.Row) {
      result=Adapters.ROW_ADAPTER.adaptResponse((com.google.bigtable.v1.Row)message);
    }
    resultsArray[index]=result;
    resultFuture.set(result);
    if (callback != null) {
      callback.update(NO_REGION,row.getRow(),(T)result);
    }
  }
 catch (  Throwable throwable) {
    resultFuture.setException(throwable);
  }
}
Program: 21112
Project: 21112
Buggy source:
@Override public Object[] batch(List<? extends Row> actions) throws IOException, InterruptedException {
  LOG.trace("String_Node_Str");
  return batchExecutor.batch(actions);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Deprecated @Override public Object[] batch(List<? extends Row> actions) throws IOException, InterruptedException {
  LOG.trace("String_Node_Str");
  return batchExecutor.batch(actions);
}
Program: 21113
Project: 21113
Buggy source:
@Override public <R>Object[] batchCallback(List<? extends Row> actions,Batch.Callback<R> callback) throws IOException, InterruptedException {
  LOG.trace("String_Node_Str");
  return batchExecutor.batchCallback(actions,callback);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Deprecated @Override public <R>Object[] batchCallback(List<? extends Row> actions,Batch.Callback<R> callback) throws IOException, InterruptedException {
  LOG.trace("String_Node_Str");
  Object[] results=new Object[actions.size()];
  batchExecutor.batchCallback(actions,results,callback);
  return results;
}
Program: 21114
Project: 21114
Buggy source:
/** 
 * Indicates whether or not the Jetty ALPN jar is installed in the boot classloader.
 */
private static boolean isJettyAlpnConfigured(){
  try {
    Class.forName("String_Node_Str",true,null);
    return true;
  }
 catch (  ClassNotFoundException e) {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Indicates whether or not the Jetty ALPN jar is installed in the boot classloader.
 */
private static boolean isJettyAlpnConfigured(){
  final String alpnClassName="String_Node_Str";
  try {
    Class.forName(alpnClassName,true,null);
    return true;
  }
 catch (  ClassNotFoundException|NoClassDefFoundError e) {
    return false;
  }
catch (  Exception e) {
    LOG.warn("String_Node_Str",e,alpnClassName);
    return false;
  }
}
Program: 21115
Project: 21115
Buggy source:
@Test public void testRetriesExhausted() throws Exception {
  IOException ioException=new IOException("String_Node_Str");
  Mockito.when(credentials.refreshAccessToken()).thenThrow(ioException);
  final int startTime=100000000;
  setTimeInMillieconds(startTime);
  underTest=new RefreshingOAuth2CredentialsInterceptor(executorService,credentials,retryOptions,logger);
  final int maxElaspedBackoffMillis=retryOptions.getMaxElaspedBackoffMillis();
  underTest.sleeper=new Sleeper(){
    @Override public void sleep(    long ms) throws InterruptedException {
      long now=getTimeInMilliseconds() + ms;
      setTimeInMillieconds(now);
      Assert.assertTrue(String.format("String_Node_Str",now,startTime + maxElaspedBackoffMillis * 2),now < startTime + maxElaspedBackoffMillis * 2);
    }
  }
;
  HeaderCacheElement header=underTest.refreshCredentialsWithRetry();
  Assert.assertNull(header.header);
  Assert.assertSame(ioException,header.exception);
  long timeInMillis=getTimeInMilliseconds();
  Assert.assertTrue(timeInMillis > startTime + maxElaspedBackoffMillis);
  verify(logger,atLeast(1)).warn(any(String.class),eq(ioException));
}

Fixed version (ground truth):
@Test public void testRetriesExhausted() throws Exception {
  IOException ioException=new IOException("String_Node_Str");
  Mockito.when(credentials.refreshAccessToken()).thenThrow(ioException);
  final int startTime=100000000;
  setTimeInMillieconds(startTime);
  final int maxElaspedBackoffMillis=retryOptions.getMaxElaspedBackoffMillis();
  final int max_end=startTime + maxElaspedBackoffMillis * 10;
  underTest=new RefreshingOAuth2CredentialsInterceptor(executorService,credentials,retryOptions,logger);
  underTest.sleeper=new Sleeper(){
    @Override public void sleep(    long ms) throws InterruptedException {
      long now=getTimeInMilliseconds() + ms;
      setTimeInMillieconds(now);
      Assert.assertTrue(String.format("String_Node_Str",now,max_end),now < max_end);
    }
  }
;
  HeaderCacheElement header=underTest.refreshCredentialsWithRetry();
  Assert.assertNull(header.header);
  Assert.assertSame(ioException,header.exception);
  long timeInMillis=getTimeInMilliseconds();
  Assert.assertTrue(timeInMillis > startTime + maxElaspedBackoffMillis);
  verify(logger,atLeast(1)).warn(any(String.class),eq(ioException));
}
Program: 21116
Project: 21116
Buggy source:
@Override public void sleep(long ms) throws InterruptedException {
  long now=getTimeInMilliseconds() + ms;
  setTimeInMillieconds(now);
  Assert.assertTrue(String.format("String_Node_Str",now,startTime + maxElaspedBackoffMillis * 2),now < startTime + maxElaspedBackoffMillis * 2);
}

Fixed version (ground truth):
@Override public void sleep(long ms) throws InterruptedException {
  long now=getTimeInMilliseconds() + ms;
  setTimeInMillieconds(now);
  Assert.assertTrue(String.format("String_Node_Str",now,max_end),now < max_end);
}
Program: 21117
Project: 21117
Buggy source:
@Override public void run(){
  readRowsCall.cancel();
}

Fixed version (ground truth):
@Override public void run(){
  returnToPool(channel);
  readRowsCall.cancel();
}
Program: 21118
Project: 21118
Buggy source:
private ClientCall.Listener<ReadRowsResponse> createClientCallListener(final StreamingBigtableResultScanner resultScanner){
  return new ClientCall.Listener<ReadRowsResponse>(){
    @Override public void onMessage(    ReadRowsResponse readRowResponse){
      resultScanner.addResult(readRowResponse);
    }
    @Override public void onClose(    Status status,    Metadata trailers){
      if (status.isOk()) {
        resultScanner.complete();
      }
 else {
        resultScanner.setError(status.asRuntimeException());
      }
    }
  }
;
}

Fixed version (ground truth):
private ClientCall.Listener<ReadRowsResponse> createClientCallListener(final Channel channel,final StreamingBigtableResultScanner resultScanner){
  return new ClientCall.Listener<ReadRowsResponse>(){
    @Override public void onMessage(    ReadRowsResponse readRowResponse){
      resultScanner.addResult(readRowResponse);
    }
    @Override public void onClose(    Status status,    Metadata trailers){
      returnToPool(channel);
      if (status.isOk()) {
        resultScanner.complete();
      }
 else {
        resultScanner.setError(status.asRuntimeException());
      }
    }
  }
;
}
Program: 21119
Project: 21119
Buggy source:
private ResultScanner<Row> streamRows(ReadRowsRequest request){
  PooledChannel reservedChannel=channelPool.reserveChannel();
  final ClientCall<ReadRowsRequest,ReadRowsResponse> readRowsCall=reservedChannel.newCall(BigtableServiceGrpc.METHOD_READ_ROWS,CallOptions.DEFAULT);
  CancellationToken cancellationToken=new CancellationToken();
  cancellationToken.addListener(new Runnable(){
    @Override public void run(){
      readRowsCall.cancel();
    }
  }
,executorService);
  int timeout=retryOptions.getReadPartialRowTimeoutMillis();
  int streamingBufferSize=retryOptions.getStreamingBufferSize();
  int batchRequestSize=retryOptions.getStreamingBatchSize();
  ResponseQueueReader responseQueueReader=new ResponseQueueReader(timeout,streamingBufferSize,batchRequestSize,batchRequestSize,readRowsCall);
  StreamingBigtableResultScanner resultScanner=new StreamingBigtableResultScanner(reservedChannel,responseQueueReader,cancellationToken);
  clientCallService.asyncServerStreamingCall(readRowsCall,request,createClientCallListener(resultScanner));
  if (batchRequestSize > 1) {
    readRowsCall.request(batchRequestSize - 1);
  }
  return resultScanner;
}

Fixed version (ground truth):
private ResultScanner<Row> streamRows(ReadRowsRequest request){
  boolean isGet=request.getTargetCase() == ReadRowsRequest.TargetCase.ROW_KEY;
  Channel channel=isGet ? channelPool : channelPool.reserveChannel();
  ClientCall<ReadRowsRequest,ReadRowsResponse> readRowsCall=channel.newCall(BigtableServiceGrpc.METHOD_READ_ROWS,CallOptions.DEFAULT);
  CancellationToken cancellationToken=createCancellationToken(channel,readRowsCall);
  int timeout=retryOptions.getReadPartialRowTimeoutMillis();
  int streamingBufferSize=retryOptions.getStreamingBufferSize();
  int batchRequestSize=retryOptions.getStreamingBatchSize();
  ResponseQueueReader responseQueueReader=new ResponseQueueReader(timeout,streamingBufferSize,batchRequestSize,batchRequestSize,readRowsCall);
  StreamingBigtableResultScanner resultScanner=new StreamingBigtableResultScanner(responseQueueReader,cancellationToken);
  clientCallService.asyncServerStreamingCall(readRowsCall,request,createClientCallListener(channel,resultScanner));
  if (batchRequestSize > 1) {
    readRowsCall.request(batchRequestSize - 1);
  }
  return resultScanner;
}
Program: 21120
Project: 21120
Buggy source:
@Override public void onClose(Status status,Metadata trailers){
  if (status.isOk()) {
    resultScanner.complete();
  }
 else {
    resultScanner.setError(status.asRuntimeException());
  }
}

Fixed version (ground truth):
@Override public void onClose(Status status,Metadata trailers){
  returnToPool(channel);
  if (status.isOk()) {
    resultScanner.complete();
  }
 else {
    resultScanner.setError(status.asRuntimeException());
  }
}
Program: 21121
Project: 21121
Buggy source:
public void setError(Throwable error){
  reservedChannel.returnToPool();
  add(ResultQueueEntry.<ReadRowsResponse>newThrowable(error));
}

Fixed version (ground truth):
public void setError(Throwable error){
  add(ResultQueueEntry.<ReadRowsResponse>newThrowable(error));
}
Program: 21122
Project: 21122
Buggy source:
public StreamingBigtableResultScanner(PooledChannel reservedChannel,ResponseQueueReader responseQueueReader,CancellationToken cancellationToken){
  Preconditions.checkArgument(cancellationToken != null,"String_Node_Str");
  this.reservedChannel=reservedChannel;
  this.cancellationToken=cancellationToken;
  this.responseQueueReader=responseQueueReader;
}

Fixed version (ground truth):
public StreamingBigtableResultScanner(ResponseQueueReader responseQueueReader,CancellationToken cancellationToken){
  Preconditions.checkArgument(cancellationToken != null,"String_Node_Str");
  this.cancellationToken=cancellationToken;
  this.responseQueueReader=responseQueueReader;
}
Program: 21123
Project: 21123
Buggy source:
public void complete(){
  reservedChannel.returnToPool();
  add(ResultQueueEntry.<ReadRowsResponse>newCompletionMarker());
}

Fixed version (ground truth):
public void complete(){
  add(ResultQueueEntry.<ReadRowsResponse>newCompletionMarker());
}
Program: 21124
Project: 21124
Buggy source:
@Override public void close() throws IOException {
  cancellationToken.cancel();
  reservedChannel.returnToPool();
}

Fixed version (ground truth):
@Override public void close() throws IOException {
  cancellationToken.cancel();
}
Program: 21125
Project: 21125
Buggy source:
@Before public void setup(){
  MockitoAnnotations.initMocks(this);
  underTest=new BigtableDataGrpcClient(channel,executorService,retryExecutorService,RetryOptionsUtil.createTestRetryOptions(nanoClock),clientCallService);
  when(channel.newCall(any(MethodDescriptor.class),any(CallOptions.class))).thenReturn(clientCall);
}

Fixed version (ground truth):
@Before public void setup(){
  MockitoAnnotations.initMocks(this);
  underTest=new BigtableDataGrpcClient(channelPool,executorService,retryExecutorService,RetryOptionsUtil.createTestRetryOptions(nanoClock),clientCallService);
  when(channelPool.newCall(any(MethodDescriptor.class),any(CallOptions.class))).thenReturn(clientCall);
  when(channelPool.reserveChannel()).thenReturn(pooledChannel);
  when(pooledChannel.newCall(any(MethodDescriptor.class),any(CallOptions.class))).thenReturn(clientCall);
}
Program: 21126
Project: 21126
Buggy source:
@Test public void testComplete() throws IOException, InterruptedException {
  scanner.complete();
  verify(reader,times(1)).add(eq(ResultQueueEntry.<ReadRowsResponse>newCompletionMarker()));
  assertChannelReturned(1);
  scanner.close();
}

Fixed version (ground truth):
@Test public void testComplete() throws IOException, InterruptedException {
  scanner.complete();
  verify(reader,times(1)).add(eq(ResultQueueEntry.<ReadRowsResponse>newCompletionMarker()));
  scanner.close();
}
Program: 21127
Project: 21127
Buggy source:
@Test public void cancellationIsSignalled() throws IOException, InterruptedException {
  scanner.close();
  assertChannelReturned(1);
  verify(cancellationToken,times(1)).cancel();
}

Fixed version (ground truth):
@Test public void cancellationIsSignalled() throws IOException, InterruptedException {
  scanner.close();
  verify(cancellationToken,times(1)).cancel();
}