nus-yam/ex-repair huggingface dataset:
Program: 92956
Project: 92956
Buggy source:
public int getLeaderId(final String topicName,final int partitionId){
  final List<Partition> partitions=getTopicPartitions(topicName);
  for (  final Partition partition : partitions) {
    if (partition.getPartition() == partitionId) {
      return partition.getLeader();
    }
  }
  throw Errors.partitionNotFoundException();
}

Fixed version (ground truth):
public int getLeaderId(final String topicName,final int partitionId){
  final List<Partition> partitions=getTopicPartitions(topicName);
  if (partitions.size() == 0) {
    throw Errors.topicNotFoundException();
  }
  for (  final Partition partition : partitions) {
    if (partition.getPartition() == partitionId) {
      return partition.getLeader();
    }
  }
  throw Errors.partitionNotFoundException();
}
Program: 92957
Project: 92957
Buggy source:
/** 
 * Lists all TableNames in the instance. <p>Sample code: <pre>  {@code}try(TableAdminClient client =  TableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]")))  client.listTables(); } }</pre>
 * @param tableId
 * @return List<TableName>
 */
public List<TableName> listTables(){
  ListTablesResponse listResp=this.stub.listTablesCallable().call(composeListTableRequest());
  return convertToTableNames(listResp);
}

Fixed version (ground truth):
/** 
 * Lists all TableNames in the instance. <p>Sample code: <pre>  {@code}try(TableAdminClient client =  TableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]")))  client.listTables(); } }</pre>
 */
public List<TableName> listTables(){
  ListTablesResponse listResp=this.stub.listTablesCallable().call(composeListTableRequest());
  return convertToTableNames(listResp);
}
Program: 92958
Project: 92958
Buggy source:
/** 
 * Gets the instanceName this client is associated to
 * @return InstanceName
 */
public InstanceName getInstanceName(){
  return instanceName;
}

Fixed version (ground truth):
/** 
 * Gets the instanceName this client is associated to
 */
public InstanceName getInstanceName(){
  return instanceName;
}
Program: 92959
Project: 92959
Buggy source:
/** 
 * Creates a new table with the specified configuration <p>Sample code: <pre>  {@code}try(TableAdminClient client =  TableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]")))  CreateTable createTableReq = TableAdminRequests.createTable("tableId") .addFamily("cf2", GCRULES.maxVersions(10)) client.createTable(createTableReq); } }</pre>
 * @param createTable
 * @return Table - the newly created table
 * @see CreateTable for createTable configurations
 */
public Table createTable(CreateTable createTable){
  com.google.bigtable.admin.v2.Table table=this.stub.createTableCallable().call(createTable.toProto(instanceName));
  return TableAdminResponses.convertTable(table);
}

Fixed version (ground truth):
/** 
 * Creates a new table with the specified configuration <p>Sample code: <pre>  {@code}try(TableAdminClient client =  TableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]")))  CreateTable createTableReq = TableAdminRequests.createTable("tableId") .addFamily("cf2", GCRULES.maxVersions(10)) client.createTable(createTableReq); } }</pre>
 * @param createTable
 * @return the newly created table
 * @see CreateTable for createTable configurations
 */
public Table createTable(CreateTable createTable){
  com.google.bigtable.admin.v2.Table table=this.stub.createTableCallable().call(createTable.toProto(instanceName));
  return TableAdminResponses.convertTable(table);
}
Program: 92960
Project: 92960
Buggy source:
/** 
 * Helper method to transform ApiFuture<Empty> to ApiFuture<Void>
 * @param future
 * @return ApiFuture<Void>
 */
@VisibleForTesting static ApiFuture<Void> transformToVoid(ApiFuture<Empty> future){
  return ApiFutures.transform(future,new ApiFunction<Empty,Void>(){
    @Override public Void apply(    Empty empty){
      return null;
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Helper method to transform ApiFuture<Empty> to ApiFuture<Void>
 * @param future
 */
@VisibleForTesting static ApiFuture<Void> transformToVoid(ApiFuture<Empty> future){
  return ApiFutures.transform(future,new ApiFunction<Empty,Void>(){
    @Override public Void apply(    Empty empty){
      return null;
    }
  }
);
}
Program: 92961
Project: 92961
Buggy source:
/** 
 * Creates, Updates and drops ColumnFamilies as per the request. <p>Sample code: <pre>  {@code}try(TableAdminClient client =  TableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]")))  ModifyFamilies modifyFamiliesReq = TableAdminRequests.modifyFamilies(tableId) .addFamily("mf1") .addFamily( "mf2", GCRULES.maxAge(Duration.ofSeconds(1000, 20000))) .updateFamily( "mf1", GCRULES .union() .rule(GCRULES.maxAge(Duration.ofSeconds(100))) .rule(GCRULES.maxVersions(1))) .addFamily( "mf3", GCRULES .intersection() .rule(GCRULES.maxAge(Duration.ofSeconds(2000))) .rule(GCRULES.maxVersions(10))) .dropFamily("mf1") client.modifyFamilies(modifyFamiliesReq); } }</pre>
 * @param modifyFamily
 * @return Table - Modified table
 * @see ModifyFamilies for modifyFamily options
 */
public Table modifyFamilies(ModifyFamilies modifyFamily){
  ModifyColumnFamiliesRequest modReq=modifyFamily.toProto(instanceName);
  com.google.bigtable.admin.v2.Table table=this.stub.modifyColumnFamiliesCallable().call(modReq);
  return TableAdminResponses.convertTable(table);
}

Fixed version (ground truth):
/** 
 * Creates, Updates and drops ColumnFamilies as per the request. <p>Sample code: <pre>  {@code}try(TableAdminClient client =  TableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]")))  ModifyFamilies modifyFamiliesReq = TableAdminRequests.modifyFamilies(tableId) .addFamily("mf1") .addFamily( "mf2", GCRULES.maxAge(Duration.ofSeconds(1000, 20000))) .updateFamily( "mf1", GCRULES .union() .rule(GCRULES.maxAge(Duration.ofSeconds(100))) .rule(GCRULES.maxVersions(1))) .addFamily( "mf3", GCRULES .intersection() .rule(GCRULES.maxAge(Duration.ofSeconds(2000))) .rule(GCRULES.maxVersions(10))) .dropFamily("mf1") client.modifyFamilies(modifyFamiliesReq); } }</pre>
 * @param modifyFamily
 * @return the modified table
 * @see ModifyFamilies for modifyFamily options
 */
public Table modifyFamilies(ModifyFamilies modifyFamily){
  ModifyColumnFamiliesRequest modReq=modifyFamily.toProto(instanceName);
  com.google.bigtable.admin.v2.Table table=this.stub.modifyColumnFamiliesCallable().call(modReq);
  return TableAdminResponses.convertTable(table);
}
Program: 92962
Project: 92962
Buggy source:
/** 
 * Lists all TableNames in the instance asynchronously <p>Sample code: <pre>  {@code}try(TableAdminClient client =  TableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]")))  client.listTablesAsync(); } }</pre>
 * @param tableId
 * @return List<TableName>
 */
public ApiFuture<List<TableName>> listTablesAsync(){
  ApiFuture<ListTablesResponse> listResp=this.stub.listTablesCallable().futureCall(composeListTableRequest());
  return ApiFutures.transform(listResp,new ApiFunction<ListTablesResponse,List<TableName>>(){
    @Override public List<TableName> apply(    ListTablesResponse input){
      return convertToTableNames(input);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Lists all TableNames in the instance asynchronously <p>Sample code: <pre>  {@code}try(TableAdminClient client =  TableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]")))  client.listTablesAsync(); } }</pre>
 */
public ApiFuture<List<TableName>> listTablesAsync(){
  ApiFuture<ListTablesResponse> listResp=this.stub.listTablesCallable().futureCall(composeListTableRequest());
  return ApiFutures.transform(listResp,new ApiFunction<ListTablesResponse,List<TableName>>(){
    @Override public List<TableName> apply(    ListTablesResponse input){
      return convertToTableNames(input);
    }
  }
);
}
Program: 92963
Project: 92963
Buggy source:
/** 
 * Drops all data in the table asynchronously <p>Sample code: <pre>  {@code}try(TableAdminClient client =  TableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]")))  client.dropAllRowsAsync("tableId"); } }</pre>
 * @param tableId
 * @return ApiFuture<Void>
 */
public ApiFuture<Void> dropAllRowsAsync(String tableId){
  return transformToVoid(this.stub.dropRowRangeCallable().futureCall(composeDropRowRangeRequest(tableId,null,true)));
}

Fixed version (ground truth):
/** 
 * Drops all data in the table asynchronously <p>Sample code: <pre>  {@code}try(TableAdminClient client =  TableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]")))  client.dropAllRowsAsync("tableId"); } }</pre>
 * @param tableId
 */
public ApiFuture<Void> dropAllRowsAsync(String tableId){
  return transformToVoid(this.stub.dropRowRangeCallable().futureCall(composeDropRowRangeRequest(tableId,null,true)));
}
Program: 92964
Project: 92964
Buggy source:
/** 
 * Helper method to build an instance of DeleteTableRequest
 * @param tableId
 * @return DeleteTableRequest
 */
@VisibleForTesting DeleteTableRequest composeDeleteTableRequest(String tableId){
  return DeleteTableRequest.newBuilder().setName(getTableName(tableId)).build();
}

Fixed version (ground truth):
/** 
 * Helper method to build an instance of DeleteTableRequest
 * @param tableId
 */
@VisibleForTesting DeleteTableRequest composeDeleteTableRequest(String tableId){
  return DeleteTableRequest.newBuilder().setName(getTableName(tableId)).build();
}
Program: 92965
Project: 92965
Buggy source:
/** 
 * Helper method to build an instance of ListTablesRequest
 * @return ListTablesRequest
 */
@VisibleForTesting ListTablesRequest composeListTableRequest(){
  return ListTablesRequest.newBuilder().setParent(instanceName.toString()).build();
}

Fixed version (ground truth):
/** 
 * Helper method to build an instance of ListTablesRequest
 */
@VisibleForTesting ListTablesRequest composeListTableRequest(){
  return ListTablesRequest.newBuilder().setParent(instanceName.toString()).build();
}
Program: 92966
Project: 92966
Buggy source:
/** 
 * Creates a new table with the specified configuration asynchronously <p>Sample code: <pre>  {@code}try(TableAdminClient client =  TableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]")))  CreateTable createTableReq = TableAdminRequests.createTable("tableId") .addFamily("cf2", GCRULES.maxVersions(10)) client.createTableAsync(createTableReq); } }</pre>
 * @param createTable
 * @return ApiFuture<Table> - the newly created table
 * @see CreateTable for createTable configurations
 */
public ApiFuture<Table> createTableAsync(CreateTable createTable){
  return transformToTableResponse(this.stub.createTableCallable().futureCall(createTable.toProto(instanceName)));
}

Fixed version (ground truth):
/** 
 * Creates a new table with the specified configuration asynchronously <p>Sample code: <pre>  {@code}try(TableAdminClient client =  TableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]")))  CreateTable createTableReq = TableAdminRequests.createTable("tableId") .addFamily("cf2", GCRULES.maxVersions(10)) client.createTableAsync(createTableReq); } }</pre>
 * @param createTable
 * @return the newly created table
 * @see CreateTable for createTable configurations
 */
public ApiFuture<Table> createTableAsync(CreateTable createTable){
  return transformToTableResponse(this.stub.createTableCallable().futureCall(createTable.toProto(instanceName)));
}
Program: 92967
Project: 92967
Buggy source:
/** 
 * Helper method to build an instance of DropRowRangeRequest
 * @param tableId
 * @param rowKeyPrefix
 * @param boolean dropAll
 * @return DropRowRangeRequest
 */
@VisibleForTesting DropRowRangeRequest composeDropRowRangeRequest(String tableId,ByteString rowKeyPrefix,boolean dropAll){
  Builder dropRowReq=DropRowRangeRequest.newBuilder().setName(getTableName(tableId));
  if (dropAll) {
    dropRowReq.setDeleteAllDataFromTable(true);
  }
 else {
    dropRowReq.setRowKeyPrefix(rowKeyPrefix);
  }
  return dropRowReq.build();
}

Fixed version (ground truth):
/** 
 * Helper method to build an instance of DropRowRangeRequest
 * @param tableId
 * @param rowKeyPrefix
 * @param boolean dropAll
 */
@VisibleForTesting DropRowRangeRequest composeDropRowRangeRequest(String tableId,ByteString rowKeyPrefix,boolean dropAll){
  Builder dropRowReq=DropRowRangeRequest.newBuilder().setName(getTableName(tableId));
  if (dropAll) {
    dropRowReq.setDeleteAllDataFromTable(true);
  }
 else {
    dropRowReq.setRowKeyPrefix(rowKeyPrefix);
  }
  return dropRowReq.build();
}
Program: 92968
Project: 92968
Buggy source:
/** 
 * Generates a token to verify the replication status of table mutations invoked before this call asynchronously Token expires in 90 days <p>Sample code: <pre>  {@code}try(TableAdminClient client =  TableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]")))  ConsistencyToken consistencyToken = client.generateConsistencyToken("tableId"); } }</pre>
 * @param tableId
 * @return ApiFuture<ConsistencyToken>
 */
public ApiFuture<ConsistencyToken> generateConsistencyTokenAsync(String tableId){
  ApiFuture<GenerateConsistencyTokenResponse> tokenResp=this.stub.generateConsistencyTokenCallable().futureCall(composeGenerateConsistencyTokenRequest(tableId));
  return ApiFutures.transform(tokenResp,new ApiFunction<GenerateConsistencyTokenResponse,ConsistencyToken>(){
    @Override public ConsistencyToken apply(    GenerateConsistencyTokenResponse input){
      return TableAdminResponses.convertTokenResponse(input);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Generates a token to verify the replication status of table mutations invoked before this call asynchronously Token expires in 90 days <p>Sample code: <pre>  {@code}try(TableAdminClient client =  TableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]")))  ConsistencyToken consistencyToken = client.generateConsistencyToken("tableId"); } }</pre>
 * @param tableId
 */
public ApiFuture<ConsistencyToken> generateConsistencyTokenAsync(String tableId){
  ApiFuture<GenerateConsistencyTokenResponse> tokenResp=this.stub.generateConsistencyTokenCallable().futureCall(composeGenerateConsistencyTokenRequest(tableId));
  return ApiFutures.transform(tokenResp,new ApiFunction<GenerateConsistencyTokenResponse,ConsistencyToken>(){
    @Override public ConsistencyToken apply(    GenerateConsistencyTokenResponse input){
      return TableAdminResponses.convertTokenResponse(input);
    }
  }
);
}
Program: 92969
Project: 92969
Buggy source:
/** 
 * Generates a token to verify the replication status of table mutations invoked before this call. Token expires in 90 days <p>Sample code: <pre>  {@code}try(TableAdminClient client =  TableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]")))  ConsistencyToken consistencyToken = client.generateConsistencyToken("tableId"); } }</pre>
 * @param tableId
 * @return ConsistencyToken
 */
public ConsistencyToken generateConsistencyToken(String tableId){
  return TableAdminResponses.convertTokenResponse(this.stub.generateConsistencyTokenCallable().call(composeGenerateConsistencyTokenRequest(tableId)));
}

Fixed version (ground truth):
/** 
 * Generates a token to verify the replication status of table mutations invoked before this call. Token expires in 90 days <p>Sample code: <pre>  {@code}try(TableAdminClient client =  TableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]")))  ConsistencyToken consistencyToken = client.generateConsistencyToken("tableId"); } }</pre>
 * @param tableId
 */
public ConsistencyToken generateConsistencyToken(String tableId){
  return TableAdminResponses.convertTokenResponse(this.stub.generateConsistencyTokenCallable().call(composeGenerateConsistencyTokenRequest(tableId)));
}
Program: 92970
Project: 92970
Buggy source:
/** 
 * Helper method to construct the table name in format: projects/{project}/instances/{instance}/tables/{tableId}
 * @param tableId
 * @return String - unique table name
 */
@VisibleForTesting String getTableName(String tableId){
  return TableName.of(instanceName.getProject(),instanceName.getInstance(),tableId).toString();
}

Fixed version (ground truth):
/** 
 * Helper method to construct the table name in format: projects/{project}/instances/{instance}/tables/{tableId}
 * @param tableId
 * @return unique table name
 */
@VisibleForTesting String getTableName(String tableId){
  return TableName.of(instanceName.getProject(),instanceName.getInstance(),tableId).toString();
}
Program: 92971
Project: 92971
Buggy source:
/** 
 * Gets the Table by tableId <p>Sample code: <pre>  {@code}try(TableAdminClient client =  TableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]")))  client.getTableAsync("tableId"); } }</pre>
 * @param tableId
 * @return ApiFuture<Table>
 */
public ApiFuture<Table> getTableAsync(String tableId){
  return transformToTableResponse(this.stub.getTableCallable().futureCall(composeGetTableRequest(tableId)));
}

Fixed version (ground truth):
/** 
 * Gets the Table by tableId <p>Sample code: <pre>  {@code}try(TableAdminClient client =  TableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]")))  client.getTableAsync("tableId"); } }</pre>
 * @param tableId
 */
public ApiFuture<Table> getTableAsync(String tableId){
  return transformToTableResponse(this.stub.getTableCallable().futureCall(composeGetTableRequest(tableId)));
}
Program: 92972
Project: 92972
Buggy source:
/** 
 * Helper method to transform ApiFuture<com.google.bigtable.admin.v2.Table> to ApiFuture<Table>
 * @param future
 * @return ApiFuture<Table>
 */
@VisibleForTesting static ApiFuture<Table> transformToTableResponse(ApiFuture<com.google.bigtable.admin.v2.Table> future){
  return ApiFutures.transform(future,new ApiFunction<com.google.bigtable.admin.v2.Table,Table>(){
    @Override public Table apply(    com.google.bigtable.admin.v2.Table table){
      return TableAdminResponses.convertTable(table);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Helper method to transform ApiFuture<com.google.bigtable.admin.v2.Table> to ApiFuture<Table>
 * @param future
 */
@VisibleForTesting static ApiFuture<Table> transformToTableResponse(ApiFuture<com.google.bigtable.admin.v2.Table> future){
  return ApiFutures.transform(future,new ApiFunction<com.google.bigtable.admin.v2.Table,Table>(){
    @Override public Table apply(    com.google.bigtable.admin.v2.Table table){
      return TableAdminResponses.convertTable(table);
    }
  }
);
}
Program: 92973
Project: 92973
Buggy source:
/** 
 * Checks replication consistency for the specified token consistency token asynchronously <p>Sample code: <pre>  {@code}try(TableAdminClient client =  TableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]")))  boolean consistent = client.isConsistentAsync("tableId", token); } }</pre>
 * @param tableId
 * @param token
 * @return ApiFuture<Boolean>
 */
public ApiFuture<Boolean> isConsistentAsync(String tableId,ConsistencyToken token){
  ApiFuture<CheckConsistencyResponse> checkConsResp=stub.checkConsistencyCallable().futureCall(token.toProto(getTableName(tableId)));
  return ApiFutures.transform(checkConsResp,new ApiFunction<CheckConsistencyResponse,Boolean>(){
    @Override public Boolean apply(    CheckConsistencyResponse input){
      return input.getConsistent();
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Checks replication consistency for the specified token consistency token asynchronously <p>Sample code: <pre>  {@code}try(TableAdminClient client =  TableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]")))  boolean consistent = client.isConsistentAsync("tableId", token); } }</pre>
 * @param tableId
 * @param token
 */
public ApiFuture<Boolean> isConsistentAsync(String tableId,ConsistencyToken token){
  ApiFuture<CheckConsistencyResponse> checkConsResp=stub.checkConsistencyCallable().futureCall(token.toProto(getTableName(tableId)));
  return ApiFutures.transform(checkConsResp,new ApiFunction<CheckConsistencyResponse,Boolean>(){
    @Override public Boolean apply(    CheckConsistencyResponse input){
      return input.getConsistent();
    }
  }
);
}
Program: 92974
Project: 92974
Buggy source:
/** 
 * Creates, Updates and drops ColumnFamilies as per the request asynchronously <p>Sample code: <pre>  {@code}try(TableAdminClient client =  TableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]")))  ModifyFamilies modifyFamiliesReq = TableAdminRequests.modifyFamilies(tableId) .addFamily("mf1") .addFamily( "mf2", GCRULES.maxAge(Duration.ofSeconds(1000, 20000))) .updateFamily( "mf1", GCRULES .union() .rule(GCRULES.maxAge(Duration.ofSeconds(100))) .rule(GCRULES.maxVersions(1))) .addFamily( "mf3", GCRULES .intersection() .rule(GCRULES.maxAge(Duration.ofSeconds(2000))) .rule(GCRULES.maxVersions(10))) .dropFamily("mf1") client.modifyFamilies(modifyFamiliesReq); } }</pre>
 * @param modifyFamily
 * @return ApiFuture<Table> - Modified table
 * @see ModifyFamilies for modifyFamily options
 */
public ApiFuture<Table> modifyFamiliesAsync(ModifyFamilies modifyFamily){
  ModifyColumnFamiliesRequest modReq=modifyFamily.toProto(instanceName);
  return transformToTableResponse(this.stub.modifyColumnFamiliesCallable().futureCall(modReq));
}

Fixed version (ground truth):
/** 
 * Creates, Updates and drops ColumnFamilies as per the request asynchronously <p>Sample code: <pre>  {@code}try(TableAdminClient client =  TableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]")))  ModifyFamilies modifyFamiliesReq = TableAdminRequests.modifyFamilies(tableId) .addFamily("mf1") .addFamily( "mf2", GCRULES.maxAge(Duration.ofSeconds(1000, 20000))) .updateFamily( "mf1", GCRULES .union() .rule(GCRULES.maxAge(Duration.ofSeconds(100))) .rule(GCRULES.maxVersions(1))) .addFamily( "mf3", GCRULES .intersection() .rule(GCRULES.maxAge(Duration.ofSeconds(2000))) .rule(GCRULES.maxVersions(10))) .dropFamily("mf1") client.modifyFamilies(modifyFamiliesReq); } }</pre>
 * @param modifyFamily
 * @return Modified table
 * @see ModifyFamilies for modifyFamily options
 */
public ApiFuture<Table> modifyFamiliesAsync(ModifyFamilies modifyFamily){
  ModifyColumnFamiliesRequest modReq=modifyFamily.toProto(instanceName);
  return transformToTableResponse(this.stub.modifyColumnFamiliesCallable().futureCall(modReq));
}
Program: 92975
Project: 92975
Buggy source:
/** 
 * Gets the Table by tableId <p>Sample code: <pre>  {@code}try(TableAdminClient client =  TableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]")))  client.getTable("tableId"); } }</pre>
 * @param tableId
 * @return Table
 */
public Table getTable(String tableId){
  com.google.bigtable.admin.v2.Table table=this.stub.getTableCallable().call(composeGetTableRequest(tableId));
  return TableAdminResponses.convertTable(table);
}

Fixed version (ground truth):
/** 
 * Gets the Table by tableId <p>Sample code: <pre>  {@code}try(TableAdminClient client =  TableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]")))  client.getTable("tableId"); } }</pre>
 * @param tableId
 */
public Table getTable(String tableId){
  com.google.bigtable.admin.v2.Table table=this.stub.getTableCallable().call(composeGetTableRequest(tableId));
  return TableAdminResponses.convertTable(table);
}
Program: 92976
Project: 92976
Buggy source:
/** 
 * Helper method to build an instance of GetTableRequest
 * @param tableId
 * @return GetTableRequest
 */
@VisibleForTesting GetTableRequest composeGetTableRequest(String tableId){
  return GetTableRequest.newBuilder().setName(getTableName(tableId)).build();
}

Fixed version (ground truth):
/** 
 * Helper method to build an instance of GetTableRequest
 * @param tableId
 */
@VisibleForTesting GetTableRequest composeGetTableRequest(String tableId){
  return GetTableRequest.newBuilder().setName(getTableName(tableId)).build();
}
Program: 92977
Project: 92977
Buggy source:
/** 
 * Helper method to convert ListTablesResponse to List<TableName>
 * @param listTablesResponse
 * @return List<TableName>
 */
@VisibleForTesting static List<TableName> convertToTableNames(ListTablesResponse listTablesResponse){
  List<TableName> tableNames=new ArrayList<>();
  for (  com.google.bigtable.admin.v2.Table table : listTablesResponse.getTablesList()) {
    tableNames.add(TableName.parse(table.getName()));
  }
  return tableNames;
}

Fixed version (ground truth):
/** 
 * Helper method to convert ListTablesResponse to List<TableName>
 * @param listTablesResponse
 */
@VisibleForTesting static List<TableName> convertToTableNames(ListTablesResponse listTablesResponse){
  List<TableName> tableNames=new ArrayList<>();
  for (  com.google.bigtable.admin.v2.Table table : listTablesResponse.getTablesList()) {
    tableNames.add(TableName.parse(table.getName()));
  }
  return tableNames;
}
Program: 92978
Project: 92978
Buggy source:
/** 
 * Helper method to build an instance of GenerateConsistencyTokenRequest
 * @param tableId
 * @return GenerateConsistencyTokenRequest
 */
@VisibleForTesting GenerateConsistencyTokenRequest composeGenerateConsistencyTokenRequest(String tableId){
  return GenerateConsistencyTokenRequest.newBuilder().setName(getTableName(tableId)).build();
}

Fixed version (ground truth):
/** 
 * Helper method to build an instance of GenerateConsistencyTokenRequest
 * @param tableId
 */
@VisibleForTesting GenerateConsistencyTokenRequest composeGenerateConsistencyTokenRequest(String tableId){
  return GenerateConsistencyTokenRequest.newBuilder().setName(getTableName(tableId)).build();
}
Program: 92979
Project: 92979
Buggy source:
/** 
 * Checks replication consistency for the specified token consistency token <p>Sample code: <pre>  {@code}try(TableAdminClient client =  TableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]")))  boolean consistent = client.isConsistent("tableId", token); } }</pre>
 * @param tableId
 * @param token
 * @return boolean
 */
public boolean isConsistent(String tableId,ConsistencyToken token){
  return stub.checkConsistencyCallable().call(token.toProto(getTableName(tableId))).getConsistent();
}

Fixed version (ground truth):
/** 
 * Checks replication consistency for the specified token consistency token <p>Sample code: <pre>  {@code}try(TableAdminClient client =  TableAdminClient.create(InstanceName.of("[PROJECT]", "[INSTANCE]")))  boolean consistent = client.isConsistent("tableId", token); } }</pre>
 * @param tableId
 * @param token
 */
public boolean isConsistent(String tableId,ConsistencyToken token){
  return stub.checkConsistencyCallable().call(token.toProto(getTableName(tableId))).getConsistent();
}
Program: 92980
Project: 92980
Buggy source:
/** 
 * Adds a new GCRule
 * @param rule
 * @return UnionRule
 */
public UnionRule rule(@Nonnull GCRule rule){
  rulesList.add(rule);
  return this;
}

Fixed version (ground truth):
/** 
 * Adds a new GCRule
 * @param rule
 */
public UnionRule rule(@Nonnull GCRule rule){
  rulesList.add(rule);
  return this;
}
Program: 92981
Project: 92981
Buggy source:
/** 
 * Creates a new instance of the IntersectionRule
 * @return UnionRule
 */
public UnionRule union(){
  return new UnionRule();
}

Fixed version (ground truth):
/** 
 * Creates a new instance of the IntersectionRule
 */
public UnionRule union(){
  return new UnionRule();
}
Program: 92982
Project: 92982
Buggy source:
/** 
 * Creates an empty default rule
 * @return DefaultRule
 */
public DefaultRule defaultRule(){
  return new DefaultRule();
}

Fixed version (ground truth):
/** 
 * Creates an empty default rule
 */
public DefaultRule defaultRule(){
  return new DefaultRule();
}
Program: 92983
Project: 92983
Buggy source:
/** 
 * Creates a new instance of the VersionRule
 * @param maxVersion - maximum number of cell versions to keep
 * @return VersionRule
 */
public VersionRule maxVersions(int maxVersion){
  return new VersionRule(maxVersion);
}

Fixed version (ground truth):
/** 
 * Creates a new instance of the VersionRule
 * @param maxVersion - maximum number of cell versions to keep
 */
public VersionRule maxVersions(int maxVersion){
  return new VersionRule(maxVersion);
}
Program: 92984
Project: 92984
Buggy source:
/** 
 * Gets the configured maximum age
 * @return Duration
 */
public Duration getMaxAge(){
  return Duration.ofSeconds(builder.getSeconds(),builder.getNanos());
}

Fixed version (ground truth):
/** 
 * Gets the configured maximum age
 */
public Duration getMaxAge(){
  return Duration.ofSeconds(builder.getSeconds(),builder.getNanos());
}
Program: 92985
Project: 92985
Buggy source:
/** 
 * Creates a new instance of the DurationRule
 * @param duration - age expressed as duration
 * @return DurationRule
 */
public DurationRule maxAge(Duration duration){
  return new DurationRule(duration);
}

Fixed version (ground truth):
/** 
 * Creates a new instance of the DurationRule
 * @param duration - age expressed as duration
 */
public DurationRule maxAge(Duration duration){
  return new DurationRule(duration);
}
Program: 92986
Project: 92986
Buggy source:
/** 
 * Creates a new instance of the IntersectionRule
 * @return IntersectionRule
 */
public IntersectionRule intersection(){
  return new IntersectionRule();
}

Fixed version (ground truth):
/** 
 * Creates a new instance of the IntersectionRule
 */
public IntersectionRule intersection(){
  return new IntersectionRule();
}
Program: 92987
Project: 92987
Buggy source:
/** 
 * Gets the list of child rules
 * @return List<GCRule>
 */
public List<GCRule> getRulesList(){
  return rulesList;
}

Fixed version (ground truth):
/** 
 * Gets the list of child rules
 */
public List<GCRule> getRulesList(){
  return rulesList;
}
Program: 92988
Project: 92988
Buggy source:
/** 
 * Creates an instance representing the value of   {@code microseconds}.
 * @throws IllegalArgumentException if the timestamp is outside the representable range
 */
public static Timestamp ofTimeMicroseconds(long microseconds){
  long seconds=TimeUnit.MICROSECONDS.toSeconds(microseconds);
  int nanos=(int)TimeUnit.MICROSECONDS.toNanos(microseconds - TimeUnit.SECONDS.toMicros(seconds));
  checkArgument(Timestamps.isValid(seconds,nanos),"String_Node_Str",seconds,nanos);
  return new Timestamp(seconds,nanos);
}

Fixed version (ground truth):
/** 
 * Creates an instance representing the value of   {@code microseconds}.
 * @throws IllegalArgumentException if the timestamp is outside the representable range
 */
public static Timestamp ofTimeMicroseconds(long microseconds){
}
Program: 92989
Project: 92989
Buggy source:
/** 
 * Creates a new QuerySnapshot representing the results of a Query with added documents. 
 */
public static QuerySnapshot withDocuments(final Query query,Instant readTime,final List<QueryDocumentSnapshot> documents){
  return new QuerySnapshot(query,readTime){
    volatile List<DocumentChange> documentChanges;
    @Nonnull @Override public List<QueryDocumentSnapshot> getDocuments(){
      return Collections.unmodifiableList(documents);
    }
    @Nonnull @Override public List<DocumentChange> getDocumentChanges(){
      if (documentChanges == null) {
synchronized (documents) {
          if (documentChanges == null) {
            documentChanges=new ArrayList<>();
            for (int i=0; i < documents.size(); ++i) {
              documentChanges.add(new DocumentChange(documents.get(0),Type.ADDED,-1,i));
            }
          }
        }
      }
      return Collections.unmodifiableList(documentChanges);
    }
    @Override public int size(){
      return documents.size();
    }
    @Override public boolean equals(    Object o){
      if (this == o) {
        return true;
      }
      if (o == null || getClass() != o.getClass()) {
        return false;
      }
      QuerySnapshot that=(QuerySnapshot)o;
      return Objects.equals(query,that.query) && Objects.equals(this.size(),that.size()) && Objects.equals(this.getDocuments(),that.getDocuments());
    }
    @Override public int hashCode(){
      return Objects.hash(query,this.getDocuments());
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Creates a new QuerySnapshot representing the results of a Query with added documents. 
 */
public static QuerySnapshot withDocuments(final Query query,Instant readTime,final List<QueryDocumentSnapshot> documents){
  return new QuerySnapshot(query,readTime){
    volatile List<DocumentChange> documentChanges;
    @Nonnull @Override public List<QueryDocumentSnapshot> getDocuments(){
      return Collections.unmodifiableList(documents);
    }
    @Nonnull @Override public List<DocumentChange> getDocumentChanges(){
      if (documentChanges == null) {
synchronized (documents) {
          if (documentChanges == null) {
            documentChanges=new ArrayList<>();
            for (int i=0; i < documents.size(); ++i) {
              documentChanges.add(new DocumentChange(documents.get(i),Type.ADDED,-1,i));
            }
          }
        }
      }
      return Collections.unmodifiableList(documentChanges);
    }
    @Override public int size(){
      return documents.size();
    }
    @Override public boolean equals(    Object o){
      if (this == o) {
        return true;
      }
      if (o == null || getClass() != o.getClass()) {
        return false;
      }
      QuerySnapshot that=(QuerySnapshot)o;
      return Objects.equals(query,that.query) && Objects.equals(this.size(),that.size()) && Objects.equals(this.getDocuments(),that.getDocuments());
    }
    @Override public int hashCode(){
      return Objects.hash(query,this.getDocuments());
    }
  }
;
}
Program: 92990
Project: 92990
Buggy source:
@Test public void getResult() throws Exception {
  doAnswer(queryResponse(DOCUMENT_NAME + "String_Node_Str",DOCUMENT_NAME + "String_Node_Str")).when(firestoreMock).streamRequest(runQuery.capture(),streamObserverCapture.capture(),Matchers.<ServerStreamingCallable>any());
  QuerySnapshot result=query.get().get();
  assertEquals(query,result.getQuery());
  assertFalse(result.isEmpty());
  assertEquals(2,result.size());
  assertEquals(2,result.getDocuments().size());
  Iterator<QueryDocumentSnapshot> iterator=result.iterator();
  assertEquals("String_Node_Str",iterator.next().getId());
  assertEquals("String_Node_Str",iterator.next().getId());
  assertFalse(iterator.hasNext());
  assertEquals(Instant.ofEpochSecond(1,2),result.getReadTime());
  assertEquals(Arrays.asList(LocalFirestoreHelper.SINGLE_FIELD_OBJECT,LocalFirestoreHelper.SINGLE_FIELD_OBJECT),result.toObjects(LocalFirestoreHelper.SINGLE_FIELD_OBJECT.getClass()));
  assertEquals(2,result.getDocumentChanges().size());
}

Fixed version (ground truth):
@Test public void getResult() throws Exception {
  doAnswer(queryResponse(DOCUMENT_NAME + "String_Node_Str",DOCUMENT_NAME + "String_Node_Str")).when(firestoreMock).streamRequest(runQuery.capture(),streamObserverCapture.capture(),Matchers.<ServerStreamingCallable>any());
  QuerySnapshot result=query.get().get();
  assertEquals(query,result.getQuery());
  assertFalse(result.isEmpty());
  assertEquals(2,result.size());
  assertEquals(2,result.getDocuments().size());
  Iterator<QueryDocumentSnapshot> docIterator=result.iterator();
  assertEquals("String_Node_Str",docIterator.next().getId());
  assertEquals("String_Node_Str",docIterator.next().getId());
  assertFalse(docIterator.hasNext());
  Iterator<DocumentChange> changeIterator=result.getDocumentChanges().iterator();
  DocumentChange documentChange=changeIterator.next();
  assertEquals("String_Node_Str",documentChange.getDocument().getId());
  assertEquals(DocumentChange.Type.ADDED,documentChange.getType());
  assertEquals(-1,documentChange.getOldIndex());
  assertEquals(0,documentChange.getNewIndex());
  documentChange=changeIterator.next();
  assertEquals("String_Node_Str",documentChange.getDocument().getId());
  assertEquals(DocumentChange.Type.ADDED,documentChange.getType());
  assertEquals(-1,documentChange.getOldIndex());
  assertEquals(1,documentChange.getNewIndex());
  assertFalse(changeIterator.hasNext());
  assertEquals(Instant.ofEpochSecond(1,2),result.getReadTime());
  assertEquals(Arrays.asList(LocalFirestoreHelper.SINGLE_FIELD_OBJECT,LocalFirestoreHelper.SINGLE_FIELD_OBJECT),result.toObjects(LocalFirestoreHelper.SINGLE_FIELD_OBJECT.getClass()));
  assertEquals(2,result.getDocumentChanges().size());
}
Program: 92991
Project: 92991
Buggy source:
/** 
 * Process a new response from inner/upstream callable. The message will be fed to the reframer and the output will be delivered to the downstream   {@link ResponseObserver}. <p>If the delivery loop is stopped, this will restart it.
 */
@Override protected void onResponseImpl(InnerT response){
synchronized (lock) {
    Preconditions.checkState(awaitingInner,"String_Node_Str");
    awaitingInner=false;
    reframer.push(response);
  }
  deliver();
}

Fixed version (ground truth):
/** 
 * Process a new response from inner/upstream callable. The message will be fed to the reframer and the output will be delivered to the downstream   {@link ResponseObserver}. <p>If the delivery loop is stopped, this will restart it.
 */
@Override protected void onResponseImpl(InnerT response){
  boolean shoudCancelStream=false;
synchronized (lock) {
    Preconditions.checkState(awaitingInner,"String_Node_Str");
    awaitingInner=false;
    try {
      reframer.push(response);
    }
 catch (    Throwable t) {
      if (error == null) {
        shoudCancelStream=true;
        error=t;
      }
    }
  }
  if (shoudCancelStream) {
    innerController.cancel();
  }
  deliver();
}
Program: 92992
Project: 92992
Buggy source:
/** 
 * Tries to kick off the delivery loop, wrapping it in error handling. 
 */
private void deliver(){
synchronized (lock) {
    if (inDelivery) {
      missed=true;
      return;
    }
    inDelivery=true;
  }
  try {
    unsafeDeliver();
  }
 catch (  Throwable t) {
    final boolean forceClose;
synchronized (lock) {
      forceClose=!closed;
      closed=true;
    }
    if (forceClose) {
      outerResponseObserver.onError(t);
    }
  }
}

Fixed version (ground truth):
/** 
 * Tries to kick off the delivery loop, wrapping it in error handling. 
 */
private void deliver(){
synchronized (lock) {
    if (inDelivery) {
      missed=true;
      return;
    }
    inDelivery=true;
  }
  try {
    unsafeDeliver();
  }
 catch (  Throwable t) {
    final boolean forceClose;
synchronized (lock) {
      forceClose=!closed;
      closed=true;
    }
    if (forceClose) {
      outerResponseObserver.onError(t);
      innerController.cancel();
    }
  }
}
Program: 92993
Project: 92993
Buggy source:
private void deliver(){
  if (delivering || closed)   return;
  delivering=true;
  try {
    while (error == null && numPending > 0 && !queue.isEmpty()) {
      numPending--;
      observer.onResponse(queue.poll());
    }
    if (error != null || queue.isEmpty()) {
      if (error != null) {
        observer.onError(error);
      }
 else {
        observer.onComplete();
      }
      closed=true;
    }
  }
  finally {
    delivering=false;
  }
}

Fixed version (ground truth):
private void deliver(){
  if (delivering || closed)   return;
  delivering=true;
  try {
    while (error == null && numPending > 0 && !queue.isEmpty()) {
      numPending--;
      numDelivered++;
      observer.onResponse(queue.poll());
    }
    if (error != null || queue.isEmpty()) {
      if (error != null) {
        observer.onError(error);
      }
 else {
        observer.onComplete();
      }
      closed=true;
    }
  }
  finally {
    delivering=false;
  }
}
Program: 92994
Project: 92994
Buggy source:
@Override public void call(RequestT request,ResponseObserver<ResponseT> responseObserver,ApiCallContext context){
  Preconditions.checkNotNull(request);
  Preconditions.checkNotNull(responseObserver);
  this.actualRequest=request;
  this.actualObserver=responseObserver;
  this.context=context;
  StreamControllerStash<ResponseT> controller=new StreamControllerStash<>(responseList,responseObserver);
  controller.start();
}

Fixed version (ground truth):
@Override public void call(RequestT request,ResponseObserver<ResponseT> responseObserver,ApiCallContext context){
  Preconditions.checkNotNull(request);
  Preconditions.checkNotNull(responseObserver);
  this.actualRequest=request;
  this.actualObserver=responseObserver;
  this.context=context;
  StreamControllerStash<ResponseT> controller=new StreamControllerStash<>(responseList,responseObserver);
  calls.add(controller);
  controller.start();
}
Program: 92995
Project: 92995
Buggy source:
private ValueRangeFilter(BoundType startBound,ByteString start,BoundType endBound,ByteString end){
  super(startBound,start,endBound,end);
}

Fixed version (ground truth):
private ValueRangeFilter(){
  super();
}
Program: 92996
Project: 92996
Buggy source:
private QualifierRangeFilter(String family,BoundType startBound,ByteString start,BoundType endBound,ByteString end){
  super(startBound,start,endBound,end);
  this.family=Preconditions.checkNotNull(family);
}

Fixed version (ground truth):
private QualifierRangeFilter(String family){
  super();
  this.family=family;
}
Program: 92997
Project: 92997
Buggy source:
private TimestampRangeFilter(BoundType startBound,Long start,BoundType endBound,Long end){
  super(startBound,start,endBound,end);
}

Fixed version (ground truth):
private TimestampRangeFilter(){
  super();
}
Program: 92998
Project: 92998
Buggy source:
/** 
 * Creates a new   {@link Range} with the specified inclusive start and the current end. 
 */
public R startClosed(String start){
  return newInstanceSafe(BoundType.CLOSED,wrap(start),endBound,end);
}

Fixed version (ground truth):
/** 
 * Creates a new   {@link Range} with the specified inclusive start and the current end. 
 */
public R startClosed(String start){
  return startClosed(wrap(start));
}
Program: 92999
Project: 92999
Buggy source:
/** 
 * Creates a new   {@link Range} with the specified inclusive end and the current start. 
 */
public R endClosed(String end){
  return newInstanceSafe(startBound,start,BoundType.CLOSED,wrap(end));
}

Fixed version (ground truth):
/** 
 * Creates a new   {@link Range} with the specified inclusive end and the current start. 
 */
public R endClosed(String end){
  return endClosed(wrap(end));
}
Program: 93000
Project: 93000
Buggy source:
/** 
 * Creates a new   {@link Range} with the specified exclusive end and the current start. 
 */
public R endOpen(String end){
  return newInstanceSafe(startBound,start,BoundType.OPEN,wrap(end));
}

Fixed version (ground truth):
/** 
 * Creates a new   {@link Range} with the specified exclusive end and the current start. 
 */
public R endOpen(String end){
  return endOpen(wrap(end));
}
Program: 93001
Project: 93001
Buggy source:
/** 
 * Creates a new   {@link Range} with the specified inclusive start and the specified exclusiveend.
 */
public R of(String startClosed,String endOpen){
  return newInstanceSafe(BoundType.CLOSED,wrap(startClosed),BoundType.OPEN,wrap(endOpen));
}

Fixed version (ground truth):
/** 
 * Creates a new   {@link Range} with the specified inclusive start and the specified exclusiveend.
 */
public R of(String startClosed,String endOpen){
  return of(wrap(startClosed),wrap(endOpen));
}
Program: 93002
Project: 93002
Buggy source:
/** 
 * Creates a new   {@link Range} with an unbounded start and the current end. 
 */
public R startUnbounded(){
  return newInstanceSafe(BoundType.UNBOUNDED,null,endBound,end);
}

Fixed version (ground truth):
/** 
 * Creates a new   {@link Range} with an unbounded start and the current end. 
 */
public R startUnbounded(){
  this.start=null;
  this.startBound=BoundType.UNBOUNDED;
  return thisT();
}
Program: 93003
Project: 93003
Buggy source:
/** 
 * Creates a new   {@link Range} with the specified exclusive start and the current end. 
 */
public R startOpen(String start){
  return newInstanceSafe(BoundType.OPEN,wrap(start),endBound,end);
}

Fixed version (ground truth):
/** 
 * Creates a new   {@link Range} with the specified exclusive start and the current end. 
 */
public R startOpen(String start){
  return startOpen(wrap(start));
}
Program: 93004
Project: 93004
Buggy source:
/** 
 * Creates a new   {@link Range} with the current start and an unbounded end. 
 */
public R endUnbounded(){
  return newInstanceSafe(startBound,start,BoundType.UNBOUNDED,null);
}

Fixed version (ground truth):
/** 
 * Creates a new   {@link Range} with the current start and an unbounded end. 
 */
public R endUnbounded(){
  this.end=null;
  this.endBound=BoundType.UNBOUNDED;
  return thisT();
}
Program: 93005
Project: 93005
Buggy source:
@Override public TableResult getNextPage(){
  return new TableResult(schema,totalRows,pageNoSchema.getNextPage());
}

Fixed version (ground truth):
@Override public TableResult getNextPage(){
  if (pageNoSchema.hasNextPage()) {
    return new TableResult(schema,totalRows,pageNoSchema.getNextPage());
  }
  return null;
}
Program: 93006
Project: 93006
Buggy source:
TableResult(final Schema schema,long totalRows,Page<FieldValueList> pageNoSchema){
  this.schema=schema;
  this.totalRows=totalRows;
  this.pageNoSchema=checkNotNull(pageNoSchema);
}

Fixed version (ground truth):
TableResult(Schema schema,long totalRows,Page<FieldValueList> pageNoSchema){
  this.schema=schema;
  this.totalRows=totalRows;
  this.pageNoSchema=checkNotNull(pageNoSchema);
}
Program: 93007
Project: 93007
Buggy source:
private Iterable<FieldValueList> addSchema(Iterable<FieldValueList> iter){
  if (schema == null) {
    return iter;
  }
  return Iterables.transform(pageNoSchema.getValues(),new Function<FieldValueList,FieldValueList>(){
    @Override public FieldValueList apply(    FieldValueList list){
      return list.withSchema(schema.getFields());
    }
  }
);
}

Fixed version (ground truth):
private Iterable<FieldValueList> addSchema(Iterable<FieldValueList> iter){
  if (schema == null) {
    return iter;
  }
  return Iterables.transform(iter,new Function<FieldValueList,FieldValueList>(){
    @Override public FieldValueList apply(    FieldValueList list){
      return list.withSchema(schema.getFields());
    }
  }
);
}
Program: 93008
Project: 93008
Buggy source:
@Override public ManagedChannel newChannel(String host,int port){
  NettyChannelBuilder builder=NettyChannelBuilder.forAddress(host,port).sslContext(newSslContext()).intercept(interceptors).maxMessageSize(MAX_MESSAGE_SIZE);
  if (userAgent != null) {
    builder.userAgent(userAgent);
  }
  return builder.build();
}

Fixed version (ground truth):
@Override public ManagedChannel newChannel(String host,int port){
  NettyChannelBuilder builder=NettyChannelBuilder.forAddress(host,port).sslContext(newSslContext()).intercept(interceptors).maxHeaderListSize(MAX_HEADER_LIST_SIZE).maxMessageSize(MAX_MESSAGE_SIZE);
  if (userAgent != null) {
    builder.userAgent(userAgent);
  }
  return builder.build();
}
Program: 93009
Project: 93009
Buggy source:
/** 
 * Downloads this blob to the given file path.
 * @param path destination
 * @throws StorageException upon failure
 */
public void downloadTo(Path path) throws StorageException {
  try (OutputStream outputStream=Files.newOutputStream(path);ReadChannel reader=reader()){
    WritableByteChannel channel=Channels.newChannel(outputStream);
    ByteBuffer bytes=ByteBuffer.allocate(DEFAULT_CHUNK_SIZE);
    while (reader.read(bytes) > 0) {
      bytes.flip();
      channel.write(bytes);
      bytes.clear();
    }
  }
 catch (  IOException e) {
    throw new StorageException(e);
  }
}

Fixed version (ground truth):
/** 
 * Downloads this blob to the given file path. This method is replaced with   {@link #downloadTo(Path,BlobSourceOption)}, but is kept here for binary compatibility with the older versions of the client library.
 * @param path destination
 * @throws StorageException upon failure
 */
public void downloadTo(Path path){
  downloadTo(path,new BlobSourceOption[0]);
}