nus-yam/ex-repair huggingface dataset:
Program: 6092
Project: 6092
Buggy source:
private LineageRecord getLineage(Id.NamespacedId namespacedId,String path) throws IOException, UnauthenticatedException, NotFoundException, BadRequestException {
  URL lineageURL=config.resolveNamespacedURLV3(namespacedId.getNamespace(),path);
  HttpResponse response=restClient.execute(HttpRequest.get(lineageURL).build(),config.getAccessToken(),HttpURLConnection.HTTP_BAD_REQUEST,HttpURLConnection.HTTP_NOT_FOUND);
  if (response.getResponseCode() == HttpURLConnection.HTTP_BAD_REQUEST) {
    throw new BadRequestException(response.getResponseBodyAsString());
  }
  if (response.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) {
    throw new NotFoundException(namespacedId);
  }
  return GSON.fromJson(response.getResponseBodyAsString(),LineageRecord.class);
}

Fixed version (ground truth):
private LineageRecord getLineage(Id.NamespacedId namespacedId,String path) throws IOException, UnauthenticatedException, NotFoundException, BadRequestException {
  URL lineageURL=config.resolveNamespacedURLV3(namespacedId.getNamespace(),path);
  HttpResponse response=restClient.execute(HttpRequest.get(lineageURL).build(),config.getAccessToken(),HttpURLConnection.HTTP_BAD_REQUEST,HttpURLConnection.HTTP_NOT_FOUND);
  if (response.getResponseCode() == HttpURLConnection.HTTP_BAD_REQUEST) {
    throw new BadRequestException(response.getResponseBodyAsString());
  }
  if (response.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) {
    throw new NotFoundException(response.getResponseBodyAsString());
  }
  return GSON.fromJson(response.getResponseBodyAsString(),LineageRecord.class);
}
Program: 6093
Project: 6093
Buggy source:
@Override public void deleteSecureData(String namespace,String name) throws IOException {
  context.getAdmin().deleteSecureData(namespace,name);
}

Fixed version (ground truth):
@Override public void deleteSecureData(String namespace,String name) throws Exception {
  context.getAdmin().deleteSecureData(namespace,name);
}
Program: 6094
Project: 6094
Buggy source:
@Override public SecureStoreData getSecureData(String namespace,String name) throws IOException {
  return context.getSecureData(namespace,name);
}

Fixed version (ground truth):
@Override public SecureStoreData getSecureData(String namespace,String name) throws Exception {
  return context.getSecureData(namespace,name);
}
Program: 6095
Project: 6095
Buggy source:
@Override public void putSecureData(String namespace,String name,byte[] data,String description,Map<String,String> properties) throws IOException {
  context.getAdmin().putSecureData(namespace,name,data,description,properties);
}

Fixed version (ground truth):
@Override public void putSecureData(String namespace,String name,byte[] data,String description,Map<String,String> properties) throws Exception {
  context.getAdmin().putSecureData(namespace,name,data,description,properties);
}
Program: 6096
Project: 6096
Buggy source:
@Override public List<SecureStoreMetadata> listSecureData(String namespace) throws IOException {
  return context.listSecureData(namespace);
}

Fixed version (ground truth):
@Override public List<SecureStoreMetadata> listSecureData(String namespace) throws Exception {
  return context.listSecureData(namespace);
}
Program: 6097
Project: 6097
Buggy source:
private void revoke(RevokeRequest revokeRequest) throws IOException, UnauthenticatedException, FeatureDisabledException, UnauthorizedException, NotFoundException {
  URL url=config.resolveURLV3(AUTHORIZATION_BASE + "String_Node_Str");
  HttpRequest request=HttpRequest.post(url).withBody(GSON.toJson(revokeRequest)).build();
  executePrivilegeRequest(revokeRequest.getEntity(),request);
}

Fixed version (ground truth):
private void revoke(RevokeRequest revokeRequest) throws IOException, UnauthenticatedException, FeatureDisabledException, UnauthorizedException, NotFoundException {
  URL url=config.resolveURLV3(AUTHORIZATION_BASE + "String_Node_Str");
  HttpRequest request=HttpRequest.post(url).withBody(GSON.toJson(revokeRequest)).build();
  executePrivilegeRequest(request);
}
Program: 6098
Project: 6098
Buggy source:
@Override public void grant(EntityId entity,Principal principal,Set<Action> actions) throws IOException, UnauthenticatedException, FeatureDisabledException, UnauthorizedException, NotFoundException {
  GrantRequest grantRequest=new GrantRequest(entity,principal,actions);
  URL url=config.resolveURLV3(AUTHORIZATION_BASE + "String_Node_Str");
  HttpRequest request=HttpRequest.post(url).withBody(GSON.toJson(grantRequest)).build();
  executePrivilegeRequest(entity,request);
}

Fixed version (ground truth):
@Override public void grant(EntityId entity,Principal principal,Set<Action> actions) throws IOException, UnauthenticatedException, FeatureDisabledException, UnauthorizedException, NotFoundException {
  GrantRequest grantRequest=new GrantRequest(entity,principal,actions);
  URL url=config.resolveURLV3(AUTHORIZATION_BASE + "String_Node_Str");
  HttpRequest request=HttpRequest.post(url).withBody(GSON.toJson(grantRequest)).build();
  executePrivilegeRequest(request);
}
Program: 6099
Project: 6099
Buggy source:
private HttpResponse executePrivilegeRequest(EntityId entityId,HttpRequest request) throws FeatureDisabledException, UnauthenticatedException, IOException, NotFoundException, UnauthorizedException {
  HttpResponse httpResponse=doExecuteRequest(request,HttpURLConnection.HTTP_NOT_FOUND);
  if (HttpURLConnection.HTTP_NOT_FOUND == httpResponse.getResponseCode()) {
    throw new NotFoundException(entityId);
  }
  return httpResponse;
}

Fixed version (ground truth):
private HttpResponse executePrivilegeRequest(HttpRequest request) throws FeatureDisabledException, UnauthenticatedException, IOException, NotFoundException, UnauthorizedException {
  HttpResponse httpResponse=doExecuteRequest(request,HttpURLConnection.HTTP_NOT_FOUND);
  if (HttpURLConnection.HTTP_NOT_FOUND == httpResponse.getResponseCode()) {
    throw new NotFoundException(httpResponse.getResponseBodyAsString());
  }
  return httpResponse;
}
Program: 6100
Project: 6100
Buggy source:
private LineageRecord getLineage(Id.NamespacedId namespacedId,String path) throws IOException, UnauthenticatedException, NotFoundException, BadRequestException {
  URL lineageURL=config.resolveNamespacedURLV3(namespacedId.getNamespace(),path);
  HttpResponse response=restClient.execute(HttpRequest.get(lineageURL).build(),config.getAccessToken(),HttpURLConnection.HTTP_BAD_REQUEST,HttpURLConnection.HTTP_NOT_FOUND);
  if (response.getResponseCode() == HttpURLConnection.HTTP_BAD_REQUEST) {
    throw new BadRequestException(response.getResponseBodyAsString());
  }
  if (response.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) {
    throw new NotFoundException(namespacedId);
  }
  return GSON.fromJson(response.getResponseBodyAsString(),LineageRecord.class);
}

Fixed version (ground truth):
private LineageRecord getLineage(Id.NamespacedId namespacedId,String path) throws IOException, UnauthenticatedException, NotFoundException, BadRequestException {
  URL lineageURL=config.resolveNamespacedURLV3(namespacedId.getNamespace(),path);
  HttpResponse response=restClient.execute(HttpRequest.get(lineageURL).build(),config.getAccessToken(),HttpURLConnection.HTTP_BAD_REQUEST,HttpURLConnection.HTTP_NOT_FOUND);
  if (response.getResponseCode() == HttpURLConnection.HTTP_BAD_REQUEST) {
    throw new BadRequestException(response.getResponseBodyAsString());
  }
  if (response.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) {
    throw new NotFoundException(response.getResponseBodyAsString());
  }
  return GSON.fromJson(response.getResponseBodyAsString(),LineageRecord.class);
}
Program: 6101
Project: 6101
Buggy source:
@AfterClass public static void finish() throws Exception {
  if (--startCount != 0) {
    return;
  }
  if (cConf.getBoolean(Constants.Security.Authorization.ENABLED)) {
    InstanceId instance=new InstanceId(cConf.get(Constants.INSTANCE_NAME));
    Principal principal=new Principal(System.getProperty("String_Node_Str"),Principal.PrincipalType.USER);
    authorizerInstantiator.get().grant(instance,principal,ImmutableSet.of(Action.ADMIN));
    authorizerInstantiator.get().grant(NamespaceId.DEFAULT,principal,ImmutableSet.of(Action.ADMIN));
  }
  namespaceAdmin.delete(Id.Namespace.DEFAULT);
  authorizerInstantiator.close();
  streamCoordinatorClient.stopAndWait();
  metricsQueryService.stopAndWait();
  metricsCollectionService.startAndWait();
  schedulerService.stopAndWait();
  if (exploreClient != null) {
    Closeables.closeQuietly(exploreClient);
  }
  if (exploreExecutorService != null) {
    exploreExecutorService.stopAndWait();
  }
  datasetService.stopAndWait();
  dsOpService.stopAndWait();
  txService.stopAndWait();
}

Fixed version (ground truth):
@AfterClass public static void finish() throws Exception {
  if (--nestedStartCount != 0) {
    return;
  }
  if (cConf.getBoolean(Constants.Security.Authorization.ENABLED)) {
    InstanceId instance=new InstanceId(cConf.get(Constants.INSTANCE_NAME));
    Principal principal=new Principal(System.getProperty("String_Node_Str"),Principal.PrincipalType.USER);
    authorizerInstantiator.get().grant(instance,principal,ImmutableSet.of(Action.ADMIN));
    authorizerInstantiator.get().grant(NamespaceId.DEFAULT,principal,ImmutableSet.of(Action.ADMIN));
  }
  namespaceAdmin.delete(Id.Namespace.DEFAULT);
  authorizerInstantiator.close();
  streamCoordinatorClient.stopAndWait();
  metricsQueryService.stopAndWait();
  metricsCollectionService.startAndWait();
  schedulerService.stopAndWait();
  if (exploreClient != null) {
    Closeables.closeQuietly(exploreClient);
  }
  if (exploreExecutorService != null) {
    exploreExecutorService.stopAndWait();
  }
  datasetService.stopAndWait();
  dsOpService.stopAndWait();
  txService.stopAndWait();
}
Program: 6105
Project: 6105
Buggy source:
public BasicActionContext(CustomActionContext context){
  this.context=context;
}

Fixed version (ground truth):
public BasicActionContext(CustomActionContext context){
  this.context=context;
  this.arguments=new BasicSettableArguments(context.getRuntimeArguments());
}
Program: 6106
Project: 6106
Buggy source:
@Override public SettableArguments getArguments(){
  return new BasicSettableArguments(context.getRuntimeArguments());
}

Fixed version (ground truth):
@Override public SettableArguments getArguments(){
  return arguments;
}
Program: 6107
Project: 6107
Buggy source:
@Override public void run(){
  checkpoint();
}

Fixed version (ground truth):
@Override public void run(){
  try {
    checkpoint();
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e);
  }
}
Program: 6108
Project: 6108
Buggy source:
@Override public void run(){
  try {
    if (writeListMap.isEmpty()) {
      int messages=0;
      long limitKey=System.currentTimeMillis() / eventBucketIntervalMs;
synchronized (messageTable) {
        SortedSet<Long> rowKeySet=messageTable.rowKeySet();
        if (!rowKeySet.isEmpty()) {
          long oldestBucketKey=rowKeySet.first();
          Map<String,Entry<Long,List<KafkaLogEvent>>> row=messageTable.row(oldestBucketKey);
          for (Iterator<Map.Entry<String,Entry<Long,List<KafkaLogEvent>>>> it=row.entrySet().iterator(); it.hasNext(); ) {
            Map.Entry<String,Entry<Long,List<KafkaLogEvent>>> mapEntry=it.next();
            if (limitKey < (mapEntry.getValue().getKey() + maxNumberOfBucketsInTable)) {
              break;
            }
            writeListMap.putAll(mapEntry.getKey(),mapEntry.getValue().getValue());
            messages+=mapEntry.getValue().getValue().size();
            it.remove();
          }
        }
      }
      LOG.trace("String_Node_Str",messages);
      for (Iterator<Map.Entry<String,Collection<KafkaLogEvent>>> it=writeListMap.asMap().entrySet().iterator(); it.hasNext(); ) {
        Map.Entry<String,Collection<KafkaLogEvent>> mapEntry=it.next();
        List<KafkaLogEvent> list=(List<KafkaLogEvent>)mapEntry.getValue();
        Collections.sort(list);
        logFileWriter.append(list);
        it.remove();
      }
    }
  }
 catch (  Throwable e) {
    LOG.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    if (writeListMap.isEmpty()) {
      int messages=0;
      long limitKey=System.currentTimeMillis() / eventBucketIntervalMs;
synchronized (messageTable) {
        SortedSet<Long> rowKeySet=messageTable.rowKeySet();
        if (!rowKeySet.isEmpty()) {
          long oldestBucketKey=rowKeySet.first();
          Map<String,Entry<Long,List<KafkaLogEvent>>> row=messageTable.row(oldestBucketKey);
          for (Iterator<Map.Entry<String,Entry<Long,List<KafkaLogEvent>>>> it=row.entrySet().iterator(); it.hasNext(); ) {
            Map.Entry<String,Entry<Long,List<KafkaLogEvent>>> mapEntry=it.next();
            if (limitKey < (mapEntry.getValue().getKey() + maxNumberOfBucketsInTable)) {
              break;
            }
            writeListMap.putAll(mapEntry.getKey(),mapEntry.getValue().getValue());
            messages+=mapEntry.getValue().getValue().size();
            it.remove();
          }
        }
      }
      LOG.trace("String_Node_Str",messages);
    }
    for (Iterator<Map.Entry<String,Collection<KafkaLogEvent>>> it=writeListMap.asMap().entrySet().iterator(); it.hasNext(); ) {
      Map.Entry<String,Collection<KafkaLogEvent>> mapEntry=it.next();
      List<KafkaLogEvent> list=(List<KafkaLogEvent>)mapEntry.getValue();
      Collections.sort(list);
      logFileWriter.append(list);
      it.remove();
    }
  }
 catch (  Throwable e) {
    LOG.error("String_Node_Str",e);
  }
}
Program: 6109
Project: 6109
Buggy source:
private <T>T execute(TransactionExecutor.Function<Table,T> func){
  try {
    Table table=tableUtil.getMetaTable();
    if (table instanceof TransactionAware) {
      TransactionExecutor txExecutor=Transactions.createTransactionExecutor(transactionExecutorFactory,(TransactionAware)table);
      return txExecutor.execute(func,table);
    }
 else {
      throw new RuntimeException(String.format("String_Node_Str" + "String_Node_Str" + "String_Node_Str",table));
    }
  }
 catch (  Exception e) {
    throw new RuntimeException(String.format("String_Node_Str",Constants.Stream.View.STORE_TABLE),e);
  }
}

Fixed version (ground truth):
private <T>T execute(TransactionExecutor.Function<Table,T> func){
  try {
    Table table=tableUtil.getMetaTable();
    if (table instanceof TransactionAware) {
      TransactionExecutor txExecutor=Transactions.createTransactionExecutor(transactionExecutorFactory,(TransactionAware)table);
      return txExecutor.execute(func,table);
    }
 else {
      throw new RuntimeException(String.format("String_Node_Str" + "String_Node_Str" + "String_Node_Str",table));
    }
  }
 catch (  Exception e) {
    throw new RuntimeException(String.format("String_Node_Str",tableUtil.getMetaTableName()),e);
  }
}
Program: 6111
Project: 6111
Buggy source:
public BasicActionContext(CustomActionContext context){
  this.context=context;
}

Fixed version (ground truth):
public BasicActionContext(CustomActionContext context){
  this.context=context;
  this.arguments=new BasicSettableArguments(context.getRuntimeArguments());
}
Program: 6112
Project: 6112
Buggy source:
@Override public SettableArguments getArguments(){
  return new BasicSettableArguments(context.getRuntimeArguments());
}

Fixed version (ground truth):
@Override public SettableArguments getArguments(){
  return arguments;
}
Program: 6113
Project: 6113
Buggy source:
private PluginProperties substituteMacroFields(Plugin plugin,MacroEvaluator macroEvaluator){
  Map<String,String> properties=new HashMap<>();
  Map<String,PluginPropertyField> pluginPropertyFieldMap=plugin.getPluginClass().getProperties();
  MacroParser macroParser=new MacroParser(macroEvaluator);
  for (  Map.Entry<String,PluginPropertyField> pluginEntry : pluginPropertyFieldMap.entrySet()) {
    if (pluginEntry.getValue().isMacroSupported()) {
      String macroValue=plugin.getProperties().getProperties().get(pluginEntry.getKey());
      properties.put(pluginEntry.getKey(),macroParser.parse(macroValue));
    }
 else {
      properties.put(pluginEntry.getKey(),plugin.getProperties().getProperties().get(pluginEntry.getKey()));
    }
  }
  return PluginProperties.builder().addAll(properties).build();
}

Fixed version (ground truth):
private PluginProperties substituteMacroFields(Plugin plugin,MacroEvaluator macroEvaluator){
  Map<String,String> properties=new HashMap<>();
  Map<String,PluginPropertyField> pluginPropertyFieldMap=plugin.getPluginClass().getProperties();
  MacroParser macroParser=new MacroParser(macroEvaluator);
  for (  Map.Entry<String,String> property : plugin.getProperties().getProperties().entrySet()) {
    PluginPropertyField field=pluginPropertyFieldMap.get(property.getKey());
    if (field != null && field.isMacroSupported()) {
      properties.put(property.getKey(),macroParser.parse(property.getValue()));
    }
 else {
      properties.put(property.getKey(),property.getValue());
    }
  }
  return PluginProperties.builder().addAll(properties).build();
}
Program: 6114
Project: 6114
Buggy source:
private Dag(SetMultimap<String,String> outgoingConnections,SetMultimap<String,String> incomingConnections){
  this.outgoingConnections=HashMultimap.create(outgoingConnections);
  this.incomingConnections=HashMultimap.create(incomingConnections);
  this.sources=new HashSet<>();
  this.sinks=new HashSet<>();
  this.nodes=new HashSet<>();
  init();
}

Fixed version (ground truth):
protected Dag(SetMultimap<String,String> outgoingConnections,SetMultimap<String,String> incomingConnections){
  this.outgoingConnections=HashMultimap.create(outgoingConnections);
  this.incomingConnections=HashMultimap.create(incomingConnections);
  this.sources=new HashSet<>();
  this.sinks=new HashSet<>();
  this.nodes=new HashSet<>();
  init();
}
Program: 6115
Project: 6115
Buggy source:
private Set<String> traverse(String stage,Set<String> alreadySeen,Set<String> stopNodes){
  if (!alreadySeen.add(stage)) {
    return alreadySeen;
  }
  Collection<String> outputs=outgoingConnections.get(stage);
  if (outputs.isEmpty()) {
    return alreadySeen;
  }
  for (  String output : outputs) {
    if (stopNodes.contains(output)) {
      alreadySeen.add(output);
      continue;
    }
    alreadySeen.addAll(traverse(output,alreadySeen,stopNodes));
  }
  return alreadySeen;
}

Fixed version (ground truth):
private Set<String> traverse(String stage,Set<String> alreadySeen,Set<String> stopNodes,SetMultimap<String,String> connections){
  if (!alreadySeen.add(stage)) {
    return alreadySeen;
  }
  Collection<String> outputs=connections.get(stage);
  if (outputs.isEmpty()) {
    return alreadySeen;
  }
  for (  String output : outputs) {
    if (stopNodes.contains(output)) {
      alreadySeen.add(output);
      continue;
    }
    alreadySeen.addAll(traverse(output,alreadySeen,stopNodes,connections));
  }
  return alreadySeen;
}
Program: 6116
Project: 6116
Buggy source:
/** 
 * Return all stages accessible from the specified stage, without going past any node in stopNodes.
 * @param stages the stages to start at
 * @param stopNodes set of nodes to stop traversal on
 * @return all stages accessible from that stage
 */
public Set<String> accessibleFrom(Set<String> stages,Set<String> stopNodes){
  Set<String> accessible=new HashSet<>();
  for (  String stage : stages) {
    accessible.addAll(traverse(stage,accessible,stopNodes));
  }
  return accessible;
}

Fixed version (ground truth):
/** 
 * Return all stages accessible from the starting stages, without going past any node in stopNodes.
 * @param stages the stages to start at
 * @param stopNodes set of nodes to stop traversal on
 * @return all stages accessible from that stage
 */
public Set<String> accessibleFrom(Set<String> stages,Set<String> stopNodes){
  Set<String> accessible=new HashSet<>();
  for (  String stage : stages) {
    accessible.addAll(traverseForwards(stage,accessible,stopNodes));
  }
  return accessible;
}
Program: 6119
Project: 6119
Buggy source:
/** 
 * Split this dag into multiple dags. Each subdag will contain at most a single reduce node.
 * @return list of subdags.
 */
public List<Dag> split(){
  List<Dag> dags=new ArrayList<>();
  Set<String> remainingNodes=new HashSet<>();
  remainingNodes.addAll(nodes);
  Set<String> possibleNewSources=Sets.union(sources,connectors);
  Set<String> possibleNewSinks=Sets.union(sinks,connectors);
  for (  String reduceNode : reduceNodes) {
    Dag subdag=subsetAround(reduceNode,possibleNewSources,possibleNewSinks);
    remainingNodes.removeAll(subdag.getNodes());
    dags.add(subdag);
  }
  Set<String> remainingSources=Sets.intersection(remainingNodes,possibleNewSources);
  dags.add(subsetFrom(remainingSources,possibleNewSinks));
  return dags;
}

Fixed version (ground truth):
/** 
 * Split this dag into multiple dags. Each subdag will contain at most a single reduce node.
 * @return list of subdags.
 */
public List<Dag> split(){
  List<Dag> dags=new ArrayList<>();
  Set<String> remainingNodes=new HashSet<>();
  remainingNodes.addAll(nodes);
  Set<String> possibleNewSources=Sets.union(sources,connectors);
  Set<String> possibleNewSinks=Sets.union(sinks,connectors);
  for (  String reduceNode : reduceNodes) {
    Dag subdag=subsetAround(reduceNode,possibleNewSources,possibleNewSinks);
    remainingNodes.removeAll(subdag.getNodes());
    dags.add(subdag);
  }
  Set<String> remainingSources=Sets.intersection(remainingNodes,possibleNewSources);
  if (!remainingSources.isEmpty()) {
    dags.add(subsetFrom(remainingSources,possibleNewSinks));
  }
  return dags;
}
Program: 6120
Project: 6120
Buggy source:
@Override public void drop(Id.DatasetInstance datasetInstanceId,DatasetTypeMeta typeMeta,DatasetSpecification spec) throws Exception {
  InternalDatasetDropParams dropParams=new InternalDatasetDropParams(typeMeta,spec);
  HttpRequest request=HttpRequest.post(resolve(datasetInstanceId,"String_Node_Str")).withBody(GSON.toJson(dropParams)).build();
  HttpResponse response=HttpRequests.execute(request,httpRequestConfig);
  verifyResponse(response);
}

Fixed version (ground truth):
@Override public void drop(Id.DatasetInstance datasetInstanceId,DatasetTypeMeta typeMeta,DatasetSpecification spec) throws Exception {
  InternalDatasetDropParams dropParams=new InternalDatasetDropParams(typeMeta,spec);
  HttpRequest request=HttpRequest.post(resolve(datasetInstanceId,"String_Node_Str")).withBody(GSON.toJson(dropParams)).build();
  HttpResponse response=HttpRequests.execute(request);
  verifyResponse(response);
}
Program: 6121
Project: 6121
Buggy source:
@Override public DatasetSpecification update(Id.DatasetInstance datasetInstanceId,DatasetTypeMeta typeMeta,DatasetProperties props,DatasetSpecification existing) throws Exception {
  InternalDatasetCreationParams updateParams=new InternalDatasetUpdateParams(typeMeta,existing,props);
  HttpRequest request=HttpRequest.post(resolve(datasetInstanceId,"String_Node_Str")).withBody(GSON.toJson(updateParams)).build();
  HttpResponse response=HttpRequests.execute(request,httpRequestConfig);
  verifyResponse(response);
  return ObjectResponse.fromJsonBody(response,DatasetSpecification.class).getResponseObject();
}

Fixed version (ground truth):
@Override public DatasetSpecification update(Id.DatasetInstance datasetInstanceId,DatasetTypeMeta typeMeta,DatasetProperties props,DatasetSpecification existing) throws Exception {
  InternalDatasetCreationParams updateParams=new InternalDatasetUpdateParams(typeMeta,existing,props);
  HttpRequest request=HttpRequest.post(resolve(datasetInstanceId,"String_Node_Str")).withBody(GSON.toJson(updateParams)).build();
  HttpResponse response=HttpRequests.execute(request);
  verifyResponse(response);
  return ObjectResponse.fromJsonBody(response,DatasetSpecification.class).getResponseObject();
}
Program: 6122
Project: 6122
Buggy source:
@Override public DatasetSpecification create(Id.DatasetInstance datasetInstanceId,DatasetTypeMeta typeMeta,DatasetProperties props) throws Exception {
  InternalDatasetCreationParams creationParams=new InternalDatasetCreationParams(typeMeta,props);
  HttpRequest request=HttpRequest.post(resolve(datasetInstanceId,"String_Node_Str")).withBody(GSON.toJson(creationParams)).build();
  HttpResponse response=HttpRequests.execute(request,httpRequestConfig);
  verifyResponse(response);
  return ObjectResponse.fromJsonBody(response,DatasetSpecification.class).getResponseObject();
}

Fixed version (ground truth):
@Override public DatasetSpecification create(Id.DatasetInstance datasetInstanceId,DatasetTypeMeta typeMeta,DatasetProperties props) throws Exception {
  InternalDatasetCreationParams creationParams=new InternalDatasetCreationParams(typeMeta,props);
  HttpRequest request=HttpRequest.post(resolve(datasetInstanceId,"String_Node_Str")).withBody(GSON.toJson(creationParams)).build();
  HttpResponse response=HttpRequests.execute(request);
  verifyResponse(response);
  return ObjectResponse.fromJsonBody(response,DatasetSpecification.class).getResponseObject();
}
Program: 6123
Project: 6123
Buggy source:
@Inject public RemoteDatasetOpExecutor(CConfiguration cConf,final DiscoveryServiceClient discoveryClient){
  this.cConf=cConf;
  this.endpointStrategySupplier=Suppliers.memoize(new Supplier<EndpointStrategy>(){
    @Override public EndpointStrategy get(){
      return new RandomEndpointStrategy(discoveryClient.discover(Constants.Service.DATASET_EXECUTOR));
    }
  }
);
  int httpTimeoutMs=cConf.getInt(Constants.HTTP_CLIENT_TIMEOUT_MS);
  this.httpRequestConfig=new HttpRequestConfig(httpTimeoutMs,httpTimeoutMs);
}

Fixed version (ground truth):
@Inject public RemoteDatasetOpExecutor(CConfiguration cConf,final DiscoveryServiceClient discoveryClient){
  this.cConf=cConf;
  this.endpointStrategySupplier=Suppliers.memoize(new Supplier<EndpointStrategy>(){
    @Override public EndpointStrategy get(){
      return new RandomEndpointStrategy(discoveryClient.discover(Constants.Service.DATASET_EXECUTOR));
    }
  }
);
}
Program: 6124
Project: 6124
Buggy source:
private DatasetAdminOpResponse executeAdminOp(Id.DatasetInstance datasetInstanceId,String opName) throws IOException, HandlerException, ConflictException {
  HttpResponse httpResponse=HttpRequests.execute(HttpRequest.post(resolve(datasetInstanceId,opName)).build(),httpRequestConfig);
  verifyResponse(httpResponse);
  return GSON.fromJson(new String(httpResponse.getResponseBody()),DatasetAdminOpResponse.class);
}

Fixed version (ground truth):
private DatasetAdminOpResponse executeAdminOp(Id.DatasetInstance datasetInstanceId,String opName) throws IOException, HandlerException, ConflictException {
  HttpResponse httpResponse=HttpRequests.execute(HttpRequest.post(resolve(datasetInstanceId,opName)).build());
  verifyResponse(httpResponse);
  return GSON.fromJson(new String(httpResponse.getResponseBody()),DatasetAdminOpResponse.class);
}
Program: 6125
Project: 6125
Buggy source:
@Override protected void startUp() throws Exception {
  scheduler=Executors.newSingleThreadScheduledExecutor(Threads.createDaemonThreadFactory("String_Node_Str"));
  long retention=cConf.getLong(Constants.Metrics.RETENTION_SECONDS + "String_Node_Str",Constants.Metrics.DEFAULT_RETENTION_HOURS);
  scheduler.schedule(createCleanupTask(retention),1,TimeUnit.SECONDS);
}

Fixed version (ground truth):
@Override protected void startUp() throws Exception {
  scheduler=Executors.newSingleThreadScheduledExecutor(Threads.createDaemonThreadFactory("String_Node_Str"));
  long retentionSecs=cConf.getLong(Constants.Metrics.RETENTION_SECONDS + "String_Node_Str",TimeUnit.HOURS.toSeconds(Constants.Metrics.DEFAULT_RETENTION_HOURS));
  scheduler.schedule(createCleanupTask(retentionSecs),1,TimeUnit.SECONDS);
}
Program: 6126
Project: 6126
Buggy source:
/** 
 * Notifies the given job execution completed.
 * @param jobId the unique id that identifies the job.
 * @param succeeded {@code true} if the job execution completed successfully.
 */
void jobEnded(Integer jobId,boolean succeeded) throws TransactionFailureException {
  JobTransaction jobTransaction=jobTransactions.remove(jobId);
  if (jobTransaction == null) {
    LOG.error("String_Node_Str",jobId);
    return;
  }
  stageToJob.keySet().removeAll(jobTransaction.getStageIds());
  jobTransaction.completed(succeeded);
}

Fixed version (ground truth):
/** 
 * Notifies the given job execution completed.
 * @param jobId the unique id that identifies the job.
 * @param succeeded {@code true} if the job execution completed successfully.
 */
void jobEnded(Integer jobId,boolean succeeded) throws TransactionFailureException {
  JobTransaction jobTransaction=jobTransactions.remove(jobId);
  if (jobTransaction == null) {
    LOG.error("String_Node_Str",jobId);
    return;
  }
  LOG.debug("String_Node_Str",jobTransaction);
  stageToJob.keySet().removeAll(jobTransaction.getStageIds());
  jobTransaction.completed(succeeded);
}
Program: 6127
Project: 6127
Buggy source:
private TransactionalDatasetContext(Transaction transaction,DynamicDatasetCache datasetCache,boolean asyncCommit){
  this.transaction=transaction;
  this.datasetCache=datasetCache;
  this.datasets=Collections.synchronizedSet(new HashSet<Dataset>());
  this.discardDatasets=Collections.synchronizedSet(new HashSet<Dataset>());
  this.completion=asyncCommit ? new CountDownLatch(1) : null;
}

Fixed version (ground truth):
private TransactionalDatasetContext(Transaction transaction,DynamicDatasetCache datasetCache,TransactionType transactionType){
  this.transaction=transaction;
  this.datasetCache=datasetCache;
  this.datasets=Collections.synchronizedSet(new HashSet<Dataset>());
  this.discardDatasets=Collections.synchronizedSet(new HashSet<Dataset>());
  this.transactionType=transactionType;
  this.completion=new CountDownLatch(1);
}
Program: 6128
Project: 6128
Buggy source:
@Override public boolean commitOnJobEnded(){
  return completion != null;
}

Fixed version (ground truth):
@Override public boolean commitOnJobEnded(){
  return transactionType == TransactionType.IMPLICIT_COMMIT_ON_JOB_END;
}
Program: 6129
Project: 6129
Buggy source:
/** 
 * Executes the given   {@link TxRunnable} with a long {@link Transaction}. All Spark RDD operations performed inside the given   {@link TxRunnable} will be using the same {@link Transaction}.
 * @param runnable the runnable to be executed in the transaction
 * @throws TransactionFailureException if there is failure during execution. The actual cause of the failuremaybe wrapped inside the  {@link TransactionFailureException} (bothuser exception from the  {@link TxRunnable#run(DatasetContext)} methodor transaction exception from Tephra).
 */
@Override public void execute(TxRunnable runnable) throws TransactionFailureException {
  executeLong(wrap(runnable),false);
}

Fixed version (ground truth):
/** 
 * Executes the given runnable with transactionally. If there is an opened transaction that can be used, then the runnable will be executed with that existing transaction. Otherwise, a new long transaction will be created to exeucte the given runnable.
 * @param runnable The {@link TxRunnable} to be executed inside a transaction
 * @param transactionType The {@link TransactionType} of the Spark transaction.
 */
void execute(SparkTxRunnable runnable,TransactionType transactionType) throws TransactionFailureException {
  TransactionalDatasetContext txDatasetContext=activeDatasetContext.get();
  boolean needCommit=false;
  if (txDatasetContext != null) {
    TransactionType currentTransactionType=txDatasetContext.getTransactionType();
    if (currentTransactionType == TransactionType.EXPLICIT && transactionType == TransactionType.EXPLICIT) {
      throw new TransactionFailureException("String_Node_Str" + txDatasetContext.getTransaction());
    }
    if (currentTransactionType == TransactionType.IMPLICIT_COMMIT_ON_JOB_END) {
      if (txDatasetContext.isJobStarted()) {
        try {
          txDatasetContext.awaitCompletion();
          txDatasetContext=null;
        }
 catch (        InterruptedException e) {
          Thread.currentThread().interrupt();
          return;
        }
      }
 else       if (transactionType != TransactionType.IMPLICIT_COMMIT_ON_JOB_END) {
        txDatasetContext.setTransactionType(transactionType);
        needCommit=true;
      }
    }
  }
  if (txDatasetContext == null) {
    txDatasetContext=new TransactionalDatasetContext(txClient.startLong(),datasetCache,transactionType);
    activeDatasetContext.set(txDatasetContext);
    needCommit=transactionType != TransactionType.IMPLICIT_COMMIT_ON_JOB_END;
  }
  Transaction transaction=txDatasetContext.getTransaction();
  try {
    runnable.run(txDatasetContext);
    txDatasetContext.flush();
    if (needCommit) {
      if (!txClient.commit(transaction)) {
        throw new TransactionFailureException("String_Node_Str" + transaction);
      }
      activeDatasetContext.remove();
      txDatasetContext.postCommit();
      txDatasetContext.discardDatasets();
    }
  }
 catch (  Throwable t) {
    activeDatasetContext.remove();
    Transactions.invalidateQuietly(txClient,transaction);
    throw Transactions.asTransactionFailure(t);
  }
}
Program: 6130
Project: 6130
Buggy source:
void close();

Fixed version (ground truth):
@Override void close();
Program: 6131
Project: 6131
Buggy source:
/** 
 * Closes the scanner and releases any resources.
 */
void close();

Fixed version (ground truth):
/** 
 * Closes the scanner and releases any resources.
 */
@Override void close();
Program: 6138
Project: 6138
Buggy source:
/** 
 * Used to read the records written by this sink.
 * @param tableManager dataset manager used to get the sink dataset to read from
 */
public static List<StructuredRecord> readOutput(DataSetManager<Table> tableManager) throws Exception {
  Table table=tableManager.get();
  Scanner scanner=table.scan(null,null);
  try {
    List<StructuredRecord> records=new ArrayList<>();
    Row row;
    while ((row=scanner.next()) != null) {
      Schema schema=Schema.parseJson(row.getString(SCHEMA_COL));
      String recordStr=row.getString(RECORD_COL);
      records.add(StructuredRecordStringConverter.fromJsonString(recordStr,schema));
    }
    return records;
  }
  finally {
    scanner.close();
  }
}

Fixed version (ground truth):
/** 
 * Used to read the records written by this sink.
 * @param tableManager dataset manager used to get the sink dataset to read from
 */
public static List<StructuredRecord> readOutput(DataSetManager<Table> tableManager) throws Exception {
  Table table=tableManager.get();
  try (Scanner scanner=table.scan(null,null)){
    List<StructuredRecord> records=new ArrayList<>();
    Row row;
    while ((row=scanner.next()) != null) {
      Schema schema=Schema.parseJson(row.getString(SCHEMA_COL));
      String recordStr=row.getString(RECORD_COL);
      records.add(StructuredRecordStringConverter.fromJsonString(recordStr,schema));
    }
    return records;
  }
 }
Program: 6139
Project: 6139
Buggy source:
protected void getPartitions(@Nullable PartitionFilter filter,PartitionConsumer consumer,boolean decodeMetadata){
  byte[] startKey=generateStartKey(filter);
  byte[] endKey=generateStopKey(filter);
  Scanner scanner=partitionsTable.scan(startKey,endKey);
  try {
    while (true) {
      Row row=scanner.next();
      if (row == null) {
        break;
      }
      PartitionKey key;
      try {
        key=parseRowKey(row.getRow(),partitioning);
      }
 catch (      IllegalArgumentException e) {
        if (!ignoreInvalidRowsSilently) {
          LOG.debug(String.format("String_Node_Str",getName(),Bytes.toStringBinary(row.getRow())));
        }
        continue;
      }
      if (filter != null && !filter.match(key)) {
        continue;
      }
      byte[] pathBytes=row.get(RELATIVE_PATH);
      if (pathBytes != null) {
        consumer.consume(key,Bytes.toString(pathBytes),decodeMetadata ? metadataFromRow(row) : null);
      }
    }
  }
  finally {
    scanner.close();
  }
}

Fixed version (ground truth):
protected void getPartitions(@Nullable PartitionFilter filter,PartitionConsumer consumer,boolean decodeMetadata){
  byte[] startKey=generateStartKey(filter);
  byte[] endKey=generateStopKey(filter);
  try (Scanner scanner=partitionsTable.scan(startKey,endKey)){
    while (true) {
      Row row=scanner.next();
      if (row == null) {
        break;
      }
      PartitionKey key;
      try {
        key=parseRowKey(row.getRow(),partitioning);
      }
 catch (      IllegalArgumentException e) {
        if (!ignoreInvalidRowsSilently) {
          LOG.debug(String.format("String_Node_Str",getName(),Bytes.toStringBinary(row.getRow())));
        }
        continue;
      }
      if (filter != null && !filter.match(key)) {
        continue;
      }
      byte[] pathBytes=row.get(RELATIVE_PATH);
      if (pathBytes != null) {
        consumer.consume(key,Bytes.toString(pathBytes),decodeMetadata ? metadataFromRow(row) : null);
      }
    }
  }
 }
Program: 6141
Project: 6141
Buggy source:
public void deleteRange(byte[] startRow,byte[] stopRow,@Nullable FuzzyRowFilter filter,@Nullable byte[][] columns) throws IOException {
  if (columns != null) {
    if (columns.length == 0) {
      return;
    }
    columns=Arrays.copyOf(columns,columns.length);
    Arrays.sort(columns,Bytes.BYTES_COMPARATOR);
  }
  DB db=getDB();
  DBIterator iterator=db.iterator();
  seekToStart(iterator,startRow);
  byte[] endKey=stopRow == null ? null : createEndKey(stopRow);
  Scanner scanner=new LevelDBScanner(iterator,endKey,filter,columns,null);
  DBIterator deleteIterator=db.iterator();
  seekToStart(deleteIterator,startRow);
  final int deletesPerRound=1024;
  try {
    Row rowValues;
    WriteBatch batch=db.createWriteBatch();
    int deletesInBatch=0;
    while ((rowValues=scanner.next()) != null) {
      byte[] row=rowValues.getRow();
      for (      byte[] column : rowValues.getColumns().keySet()) {
        addToDeleteBatch(batch,deleteIterator,row,column);
        deletesInBatch++;
        if (deletesInBatch >= deletesPerRound) {
          db.write(batch,getWriteOptions());
          batch=db.createWriteBatch();
          deletesInBatch=0;
        }
      }
    }
    if (deletesInBatch > 0) {
      db.write(batch,getWriteOptions());
    }
  }
  finally {
    scanner.close();
    deleteIterator.close();
  }
}

Fixed version (ground truth):
public void deleteRange(byte[] startRow,byte[] stopRow,@Nullable FuzzyRowFilter filter,@Nullable byte[][] columns) throws IOException {
  if (columns != null) {
    if (columns.length == 0) {
      return;
    }
    columns=Arrays.copyOf(columns,columns.length);
    Arrays.sort(columns,Bytes.BYTES_COMPARATOR);
  }
  DB db=getDB();
  DBIterator iterator=db.iterator();
  seekToStart(iterator,startRow);
  byte[] endKey=stopRow == null ? null : createEndKey(stopRow);
  DBIterator deleteIterator=db.iterator();
  seekToStart(deleteIterator,startRow);
  final int deletesPerRound=1024;
  try (Scanner scanner=new LevelDBScanner(iterator,endKey,filter,columns,null)){
    Row rowValues;
    WriteBatch batch=db.createWriteBatch();
    int deletesInBatch=0;
    while ((rowValues=scanner.next()) != null) {
      byte[] row=rowValues.getRow();
      for (      byte[] column : rowValues.getColumns().keySet()) {
        addToDeleteBatch(batch,deleteIterator,row,column);
        deletesInBatch++;
        if (deletesInBatch >= deletesPerRound) {
          db.write(batch,getWriteOptions());
          batch=db.createWriteBatch();
          deletesInBatch=0;
        }
      }
    }
    if (deletesInBatch > 0) {
      db.write(batch,getWriteOptions());
    }
  }
  finally {
    deleteIterator.close();
  }
}
Program: 6142
Project: 6142
Buggy source:
/** 
 * Delete entries in fact table.
 * @param scan specifies deletion criteria
 */
public void delete(FactScan scan){
  Scanner scanner=getScanner(scan);
  try {
    Row row;
    while ((row=scanner.next()) != null) {
      List<byte[]> columns=Lists.newArrayList();
      boolean exhausted=false;
      for (      byte[] column : row.getColumns().keySet()) {
        long ts=codec.getTimestamp(row.getRow(),column);
        if (ts < scan.getStartTs()) {
          continue;
        }
        if (ts > scan.getEndTs()) {
          exhausted=true;
          break;
        }
        columns.add(column);
      }
      timeSeriesTable.delete(row.getRow(),columns.toArray(new byte[columns.size()][]));
      if (exhausted) {
        break;
      }
    }
  }
  finally {
    scanner.close();
  }
}

Fixed version (ground truth):
/** 
 * Delete entries in fact table.
 * @param scan specifies deletion criteria
 */
public void delete(FactScan scan){
  try (Scanner scanner=getScanner(scan)){
    Row row;
    while ((row=scanner.next()) != null) {
      List<byte[]> columns=Lists.newArrayList();
      boolean exhausted=false;
      for (      byte[] column : row.getColumns().keySet()) {
        long ts=codec.getTimestamp(row.getRow(),column);
        if (ts < scan.getStartTs()) {
          continue;
        }
        if (ts > scan.getEndTs()) {
          exhausted=true;
          break;
        }
        columns.add(column);
      }
      timeSeriesTable.delete(row.getRow(),columns.toArray(new byte[columns.size()][]));
      if (exhausted) {
        break;
      }
    }
  }
 }
Program: 6144
Project: 6144
Buggy source:
/** 
 * Rebuilds all the indexes in the   {@link MetadataDataset} in batches.
 * @param startRowKey the key of the row to start the scan for the current batch with
 * @param limit the batch size
 * @return the row key of the last row scanned in the current batch, {@code null} if there are no more rows to scan.
 */
@Nullable public byte[] rebuildIndexes(@Nullable byte[] startRowKey,int limit){
  byte[] valueRowPrefix=MdsKey.getValueRowPrefix();
  startRowKey=startRowKey == null ? valueRowPrefix : startRowKey;
  byte[] stopRowKey=Bytes.stopKeyForPrefix(valueRowPrefix);
  Scanner scanner=indexedTable.scan(startRowKey,stopRowKey);
  Row row;
  try {
    while ((limit > 0) && (row=scanner.next()) != null) {
      byte[] rowKey=row.getRow();
      String targetType=MdsKey.getTargetType(rowKey);
      Id.NamespacedId namespacedId=MdsKey.getNamespacedIdFromKey(targetType,rowKey);
      String metadataKey=MdsKey.getMetadataKey(targetType,rowKey);
      Indexer indexer=getIndexerForKey(metadataKey);
      MetadataEntry metadataEntry=getMetadata(namespacedId,metadataKey);
      if (metadataEntry == null) {
        LOG.warn("String_Node_Str" + "String_Node_Str",metadataKey,namespacedId);
        continue;
      }
      Set<String> indexes=indexer.getIndexes(metadataEntry);
      storeIndexes(namespacedId,metadataKey,indexes);
      limit--;
    }
    Row startRowForNextBatch=scanner.next();
    if (startRowForNextBatch == null) {
      return null;
    }
    return startRowForNextBatch.getRow();
  }
  finally {
    scanner.close();
  }
}

Fixed version (ground truth):
/** 
 * Rebuilds all the indexes in the   {@link MetadataDataset} in batches.
 * @param startRowKey the key of the row to start the scan for the current batch with
 * @param limit the batch size
 * @return the row key of the last row scanned in the current batch, {@code null} if there are no more rows to scan.
 */
@Nullable public byte[] rebuildIndexes(@Nullable byte[] startRowKey,int limit){
  byte[] valueRowPrefix=MdsKey.getValueRowPrefix();
  startRowKey=startRowKey == null ? valueRowPrefix : startRowKey;
  byte[] stopRowKey=Bytes.stopKeyForPrefix(valueRowPrefix);
  Row row;
  try (Scanner scanner=indexedTable.scan(startRowKey,stopRowKey)){
    while ((limit > 0) && (row=scanner.next()) != null) {
      byte[] rowKey=row.getRow();
      String targetType=MdsKey.getTargetType(rowKey);
      Id.NamespacedId namespacedId=MdsKey.getNamespacedIdFromKey(targetType,rowKey);
      String metadataKey=MdsKey.getMetadataKey(targetType,rowKey);
      Indexer indexer=getIndexerForKey(metadataKey);
      MetadataEntry metadataEntry=getMetadata(namespacedId,metadataKey);
      if (metadataEntry == null) {
        LOG.warn("String_Node_Str" + "String_Node_Str",metadataKey,namespacedId);
        continue;
      }
      Set<String> indexes=indexer.getIndexes(metadataEntry);
      storeIndexes(namespacedId,metadataKey,indexes);
      limit--;
    }
    Row startRowForNextBatch=scanner.next();
    if (startRowForNextBatch == null) {
      return null;
    }
    return startRowForNextBatch.getRow();
  }
 }
Program: 6145
Project: 6145
Buggy source:
private Metadata getSnapshotBeforeTime(Id.NamespacedId targetId,long timeMillis){
  byte[] scanStartKey=MdsHistoryKey.getMdsScanStartKey(targetId,timeMillis).getKey();
  byte[] scanEndKey=MdsHistoryKey.getMdsScanEndKey(targetId).getKey();
  Scanner scanner=indexedTable.scan(scanStartKey,scanEndKey);
  try {
    Row next=scanner.next();
    if (next != null) {
      return GSON.fromJson(next.getString(HISTORY_COLUMN),Metadata.class);
    }
 else {
      return new Metadata(targetId);
    }
  }
  finally {
    scanner.close();
  }
}

Fixed version (ground truth):
private Metadata getSnapshotBeforeTime(Id.NamespacedId targetId,long timeMillis){
  byte[] scanStartKey=MdsHistoryKey.getMdsScanStartKey(targetId,timeMillis).getKey();
  byte[] scanEndKey=MdsHistoryKey.getMdsScanEndKey(targetId).getKey();
  try (Scanner scanner=indexedTable.scan(scanStartKey,scanEndKey)){
    Row next=scanner.next();
    if (next != null) {
      return GSON.fromJson(next.getString(HISTORY_COLUMN),Metadata.class);
    }
 else {
      return new Metadata(targetId);
    }
  }
 }
Program: 6146
Project: 6146
Buggy source:
/** 
 * Delete all indexes in the metadata dataset.
 * @param limit the number of rows (indexes) to delete
 * @return the offset at which to start deletion
 */
public int deleteAllIndexes(int limit){
  byte[] indexStartPrefix=MdsKey.getIndexRowPrefix();
  byte[] indexStopPrefix=Bytes.stopKeyForPrefix(indexStartPrefix);
  int count=0;
  Scanner scanner=indexedTable.scan(indexStartPrefix,indexStopPrefix);
  Row row;
  try {
    while (count < limit && ((row=scanner.next()) != null)) {
      if (deleteIndexRow(row)) {
        count++;
      }
    }
  }
  finally {
    scanner.close();
  }
  return count;
}

Fixed version (ground truth):
/** 
 * Delete all indexes in the metadata dataset.
 * @param limit the number of rows (indexes) to delete
 * @return the offset at which to start deletion
 */
public int deleteAllIndexes(int limit){
  byte[] indexStartPrefix=MdsKey.getIndexRowPrefix();
  byte[] indexStopPrefix=Bytes.stopKeyForPrefix(indexStartPrefix);
  int count=0;
  Row row;
  try (Scanner scanner=indexedTable.scan(indexStartPrefix,indexStopPrefix)){
    while (count < limit && ((row=scanner.next()) != null)) {
      if (deleteIndexRow(row)) {
        count++;
      }
    }
  }
   return count;
}
Program: 6147
Project: 6147
Buggy source:
@Override protected void configure(){
  bind(DynamicDatasetCache.class).toProvider(DynamicDatasetCacheProvider.class).in(Scopes.SINGLETON);
  bind(DatasetContext.class).to(DynamicDatasetCache.class).in(Scopes.SINGLETON);
  bind(Admin.class).toProvider(AdminProvider.class);
  bind(Transactional.class).toProvider(TransactionalProvider.class);
  install(new FactoryModuleBuilder().implement(AuthorizationContext.class,DefaultAuthorizationContext.class).build(AuthorizationContextFactory.class));
  bind(AuthorizerInstantiatorService.class).in(Scopes.SINGLETON);
  expose(AuthorizerInstantiatorService.class);
}

Fixed version (ground truth):
@Override protected void configure(){
  bind(DynamicDatasetCache.class).toProvider(DynamicDatasetCacheProvider.class).in(Scopes.SINGLETON);
  bind(DatasetContext.class).to(DynamicDatasetCache.class).in(Scopes.SINGLETON);
  bind(Admin.class).toProvider(AdminProvider.class);
  bind(Transactional.class).toProvider(TransactionalProvider.class);
  install(new FactoryModuleBuilder().implement(AuthorizationContext.class,DefaultAuthorizationContext.class).build(AuthorizationContextFactory.class));
  bind(AuthorizerInstantiator.class).in(Scopes.SINGLETON);
  expose(AuthorizerInstantiator.class);
}