nus-yam/ex-repair huggingface dataset:
Program: 5831
Project: 5831
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);
  if (!remainingSources.isEmpty()) {
    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);
  Set<String> processedNodes=new HashSet<>();
  if (!remainingSources.isEmpty()) {
    Map<String,Set<String>> nodesAccessibleBySources=new HashMap<>();
    for (    String remainingSource : remainingSources) {
      Dag remainingNodesDag=subsetFrom(remainingSource,possibleNewSinks);
      nodesAccessibleBySources.put(remainingSource,remainingNodesDag.getNodes());
    }
    for (    String remainingSource : remainingSources) {
      if (processedNodes.contains(remainingSource)) {
        continue;
      }
      Set<String> remainingAccessibleNodes=nodesAccessibleBySources.get(remainingSource);
      Set<String> islandNodes=new HashSet<>();
      islandNodes.addAll(remainingAccessibleNodes);
      for (      String otherSource : remainingSources) {
        if (remainingSource.equals(otherSource)) {
          continue;
        }
        Set<String> otherAccessibleNodes=nodesAccessibleBySources.get(otherSource);
        if (!Sets.intersection(remainingAccessibleNodes,otherAccessibleNodes).isEmpty()) {
          islandNodes.addAll(otherAccessibleNodes);
        }
      }
      dags.add(createSubDag(islandNodes));
      processedNodes.addAll(islandNodes);
    }
  }
  return dags;
}
Program: 5832
Project: 5832
Buggy source:
public UpgradeTool() throws Exception {
  this.cConf=CConfiguration.create();
  this.hConf=HBaseConfiguration.create();
  Injector injector=createInjector();
  this.txService=injector.getInstance(TransactionService.class);
  this.zkClientService=injector.getInstance(ZKClientService.class);
  this.dsFramework=injector.getInstance(DatasetFramework.class);
  this.metadataStore=injector.getInstance(MetadataStore.class);
  this.streamStateStoreUpgrader=injector.getInstance(StreamStateStoreUpgrader.class);
  this.dsUpgrade=injector.getInstance(DatasetUpgrader.class);
  this.dsSpecUpgrader=injector.getInstance(DatasetSpecificationUpgrader.class);
  this.queueAdmin=injector.getInstance(QueueAdmin.class);
  this.nsStore=injector.getInstance(NamespaceStore.class);
  Runtime.getRuntime().addShutdownHook(new Thread(){
    @Override public void run(){
      try {
        UpgradeTool.this.stop();
      }
 catch (      Throwable e) {
        LOG.error("String_Node_Str",e);
      }
    }
  }
);
  this.existingEntitySystemMetadataWriter=injector.getInstance(ExistingEntitySystemMetadataWriter.class);
  this.datasetServiceManager=injector.getInstance(DatasetServiceManager.class);
}

Fixed version (ground truth):
public UpgradeTool() throws Exception {
  this.cConf=CConfiguration.create();
  this.hConf=HBaseConfiguration.create();
  Injector injector=createInjector();
  this.txService=injector.getInstance(TransactionService.class);
  this.zkClientService=injector.getInstance(ZKClientService.class);
  this.dsFramework=injector.getInstance(DatasetFramework.class);
  this.metadataStore=injector.getInstance(MetadataStore.class);
  this.streamStateStoreUpgrader=injector.getInstance(StreamStateStoreUpgrader.class);
  this.dsUpgrade=injector.getInstance(DatasetUpgrader.class);
  this.dsSpecUpgrader=injector.getInstance(DatasetSpecificationUpgrader.class);
  this.queueAdmin=injector.getInstance(QueueAdmin.class);
  this.nsStore=injector.getInstance(NamespaceStore.class);
  this.authorizationService=injector.getInstance(AuthorizationEnforcementService.class);
  Runtime.getRuntime().addShutdownHook(new Thread(){
    @Override public void run(){
      try {
        UpgradeTool.this.stop();
      }
 catch (      Throwable e) {
        LOG.error("String_Node_Str",e);
      }
    }
  }
);
  this.existingEntitySystemMetadataWriter=injector.getInstance(ExistingEntitySystemMetadataWriter.class);
  this.upgradeDatasetServiceManager=injector.getInstance(UpgradeDatasetServiceManager.class);
}
Program: 5833
Project: 5833
Buggy source:
private void performUpgrade() throws Exception {
  performCoprocessorUpgrade();
  LOG.info("String_Node_Str");
  dsSpecUpgrader.upgrade();
  LOG.info("String_Node_Str");
  streamStateStoreUpgrader.upgrade();
  datasetServiceManager.startUp();
  LOG.info("String_Node_Str");
  try {
    existingEntitySystemMetadataWriter.write(datasetServiceManager.getDSFramework());
    LOG.info("String_Node_Str");
    DeletedDatasetMetadataRemover datasetMetadataRemover=new DeletedDatasetMetadataRemover(nsStore,metadataStore,datasetServiceManager.getDSFramework());
    datasetMetadataRemover.remove();
    LOG.info("String_Node_Str");
    metadataStore.deleteAllIndexes();
    LOG.info("String_Node_Str");
    metadataStore.rebuildIndexes();
  }
  finally {
    datasetServiceManager.shutDown();
  }
}

Fixed version (ground truth):
private void performUpgrade() throws Exception {
  performCoprocessorUpgrade();
  LOG.info("String_Node_Str");
  dsSpecUpgrader.upgrade();
  LOG.info("String_Node_Str");
  streamStateStoreUpgrader.upgrade();
  upgradeDatasetServiceManager.startUp();
  LOG.info("String_Node_Str");
  try {
    existingEntitySystemMetadataWriter.write(upgradeDatasetServiceManager.getDSFramework());
    LOG.info("String_Node_Str");
    DeletedDatasetMetadataRemover datasetMetadataRemover=new DeletedDatasetMetadataRemover(nsStore,metadataStore,upgradeDatasetServiceManager.getDSFramework());
    datasetMetadataRemover.remove();
    LOG.info("String_Node_Str");
    metadataStore.deleteAllIndexes();
    LOG.info("String_Node_Str");
    metadataStore.rebuildIndexes();
  }
  finally {
    upgradeDatasetServiceManager.shutDown();
  }
}
Program: 5834
Project: 5834
Buggy source:
/** 
 * Stop services and
 */
private void stop(){
  try {
    txService.stopAndWait();
    zkClientService.stopAndWait();
  }
 catch (  Throwable e) {
    LOG.error("String_Node_Str",e);
    Runtime.getRuntime().halt(1);
  }
}

Fixed version (ground truth):
/** 
 * Stop services and
 */
private void stop(){
  try {
    txService.stopAndWait();
    zkClientService.stopAndWait();
    authorizationService.stopAndWait();
  }
 catch (  Throwable e) {
    LOG.error("String_Node_Str",e);
    Runtime.getRuntime().halt(1);
  }
}
Program: 5836
Project: 5836
Buggy source:
/** 
 * Do the start up work
 */
private void startUp() throws Exception {
  zkClientService.startAndWait();
  txService.startAndWait();
  initializeDSFramework(cConf,dsFramework);
}

Fixed version (ground truth):
/** 
 * Do the start up work
 */
private void startUp() throws Exception {
  zkClientService.startAndWait();
  txService.startAndWait();
  authorizationService.startAndWait();
  initializeDSFramework(cConf,dsFramework);
}
Program: 5837
Project: 5837
Buggy source:
@Test public void testInjector() throws Exception {
  new UpgradeTool();
}

Fixed version (ground truth):
@Test public void testInjector() throws Exception {
  Injector upgradeToolInjector=new UpgradeTool().createInjector();
  upgradeToolInjector.getInstance(UpgradeDatasetServiceManager.class);
}
Program: 5838
Project: 5838
Buggy source:
@Override public PartitionConsumerResult doConsume(ConsumerWorkingSet workingSet,PartitionAcceptor acceptor){
  doExpiry(workingSet);
  workingSet.populate(getPartitionedFileSet(),getConfiguration());
  List<PartitionDetail> toConsume=selectPartitions(acceptor,workingSet.getPartitions());
  return new PartitionConsumerResult(toConsume,removeDiscardedPartitions(workingSet));
}

Fixed version (ground truth):
@Override public PartitionConsumerResult doConsume(ConsumerWorkingSet workingSet,PartitionAcceptor acceptor){
  doExpiry(workingSet);
  workingSet.populate(getPartitionedFileSet(),getConfiguration());
  List<PartitionDetail> toConsume=selectPartitions(acceptor,workingSet);
  return new PartitionConsumerResult(toConsume,removeDiscardedPartitions(workingSet));
}
Program: 5839
Project: 5839
Buggy source:
private List<PartitionDetail> selectPartitions(PartitionAcceptor acceptor,List<? extends ConsumablePartition> partitions){
  long now=System.currentTimeMillis();
  List<PartitionDetail> toConsume=new ArrayList<>();
  for (  ConsumablePartition consumablePartition : partitions) {
    if (ProcessState.AVAILABLE != consumablePartition.getProcessState()) {
      continue;
    }
    PartitionDetail partition=getPartitionedFileSet().getPartition(consumablePartition.getPartitionKey());
    if (partition == null) {
      continue;
    }
    PartitionAcceptor.Return accept=acceptor.accept(partition);
switch (accept) {
case ACCEPT:
      consumablePartition.take();
    consumablePartition.setTimestamp(now);
  toConsume.add(partition);
continue;
case SKIP:
continue;
case STOP:
return toConsume;
}
}
return toConsume;
}

Fixed version (ground truth):
private List<PartitionDetail> selectPartitions(PartitionAcceptor acceptor,ConsumerWorkingSet workingSet){
  long now=System.currentTimeMillis();
  List<PartitionDetail> toConsume=new ArrayList<>();
  Iterator<ConsumablePartition> iter=workingSet.getPartitions().iterator();
  while (iter.hasNext()) {
    ConsumablePartition consumablePartition=iter.next();
    if (ProcessState.AVAILABLE != consumablePartition.getProcessState()) {
      continue;
    }
    PartitionDetail partition=getPartitionedFileSet().getPartition(consumablePartition.getPartitionKey());
    if (partition == null) {
      iter.remove();
      continue;
    }
    PartitionAcceptor.Return accept=acceptor.accept(partition);
switch (accept) {
case ACCEPT:
      consumablePartition.take();
    consumablePartition.setTimestamp(now);
  toConsume.add(partition);
continue;
case SKIP:
continue;
case STOP:
return toConsume;
}
}
return toConsume;
}
Program: 5843
Project: 5843
Buggy source:
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  ETLConfig that=(ETLConfig)o;
  return Objects.equals(source,that.source) && Objects.equals(sinks,that.sinks) && Objects.equals(transforms,that.transforms)&& Objects.equals(connections,that.connections)&& Objects.equals(resources,that.resources)&& isStageLoggingEnabled() == that.isStageLoggingEnabled();
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  ETLConfig that=(ETLConfig)o;
  return Objects.equals(source,that.source) && Objects.equals(sinks,that.sinks) && Objects.equals(transforms,that.transforms)&& Objects.equals(connections,that.connections)&& Objects.equals(resources,that.resources)&& Objects.equals(isStageLoggingEnabled(),that.isStageLoggingEnabled());
}
Program: 5844
Project: 5844
Buggy source:
/** 
 * Gets the value of the given metrics.
 * @param tags tags for the request
 * @param metrics names of the metrics
 * @param groupBys groupBys for the request
 * @return values of the metrics
 * @throws IOException if a network error occurred
 * @throws UnauthenticatedException if the request is not authorized successfully in the gateway server
 */
public MetricQueryResult query(Map<String,String> tags,List<String> metrics,List<String> groupBys,@Nullable Map<String,String> timeRangeParams) throws IOException, UnauthenticatedException, UnauthorizedException {
  List<String> queryParts=Lists.newArrayList();
  queryParts.add("String_Node_Str");
  add("String_Node_Str",metrics,queryParts);
  add("String_Node_Str",groupBys,queryParts);
  addTags(tags,queryParts);
  addTimeRangeParametersToQuery(timeRangeParams,queryParts);
  URL url=config.resolveURLV3(String.format("String_Node_Str",Joiner.on("String_Node_Str").join(queryParts)));
  HttpResponse response=restClient.execute(HttpMethod.POST,url,config.getAccessToken());
  return ObjectResponse.fromJsonBody(response,MetricQueryResult.class).getResponseObject();
}

Fixed version (ground truth):
/** 
 * Gets the value of the given metrics.
 * @param tags tags for the request
 * @param metrics names of the metrics
 * @param groupBys groupBys for the request
 * @param timeRangeParams parameters specifying the time range
 * @return values of the metrics
 * @throws IOException if a network error occurred
 * @throws UnauthenticatedException if the request is not authorized successfully in the gateway server
 */
public MetricQueryResult query(Map<String,String> tags,List<String> metrics,List<String> groupBys,Map<String,String> timeRangeParams) throws IOException, UnauthenticatedException, UnauthorizedException {
  List<String> queryParts=Lists.newArrayList();
  queryParts.add("String_Node_Str");
  add("String_Node_Str",metrics,queryParts);
  add("String_Node_Str",groupBys,queryParts);
  addTags(tags,queryParts);
  addTimeRangeParametersToQuery(timeRangeParams,queryParts);
  URL url=config.resolveURLV3(String.format("String_Node_Str",Joiner.on("String_Node_Str").join(queryParts)));
  HttpResponse response=restClient.execute(HttpMethod.POST,url,config.getAccessToken());
  return ObjectResponse.fromJsonBody(response,MetricQueryResult.class).getResponseObject();
}
Program: 5845
Project: 5845
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (KeyRange.class != obj.getClass()) {
    return false;
  }
  KeyRange other=(KeyRange)obj;
  return Arrays.equals(this.start,other.start) && Arrays.equals(this.stop,other.stop);
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null || KeyRange.class != obj.getClass()) {
    return false;
  }
  KeyRange other=(KeyRange)obj;
  return Arrays.equals(this.start,other.start) && Arrays.equals(this.stop,other.stop);
}
Program: 5846
Project: 5846
Buggy source:
/** 
 * Given a key prefix, return the smallest key that is greater than all keys starting with that prefix.
 */
static byte[] rowAfterPrefix(byte[] prefix){
  Preconditions.checkNotNull("String_Node_Str",prefix);
  for (int i=prefix.length - 1; i >= 0; i--) {
    if (prefix[i] != (byte)0xff) {
      byte[] after=Arrays.copyOf(prefix,i + 1);
      ++after[i];
      return after;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Given a key prefix, return the smallest key that is greater than all keys starting with that prefix.
 */
static byte[] rowAfterPrefix(byte[] prefix){
  Preconditions.checkNotNull(prefix,"String_Node_Str");
  for (int i=prefix.length - 1; i >= 0; i--) {
    if (prefix[i] != (byte)0xff) {
      byte[] after=Arrays.copyOf(prefix,i + 1);
      ++after[i];
      return after;
    }
  }
  return null;
}
Program: 5847
Project: 5847
Buggy source:
@Override public boolean equals(Object o){
  if (!(o instanceof TimeseriesId) || o == null) {
    return false;
  }
  TimeseriesId other=(TimeseriesId)o;
  return Objects.equal(context,other.context) && Objects.equal(metric,other.metric) && Objects.equal(tag,other.tag)&& Objects.equal(runId,other.runId);
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (!(o instanceof TimeseriesId)) {
    return false;
  }
  TimeseriesId other=(TimeseriesId)o;
  return Objects.equal(context,other.context) && Objects.equal(metric,other.metric) && Objects.equal(tag,other.tag)&& Objects.equal(runId,other.runId);
}
Program: 5848
Project: 5848
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void write(DataOutput out) throws IOException {
  String schemaStr=record.getSchema().toString();
  String recordStr=StructuredRecordStringConverter.toJsonString(record);
  out.writeInt(schemaStr.length());
  out.write(Bytes.toBytes(schemaStr));
  out.writeInt(recordStr.length());
  out.write(Bytes.toBytes(recordStr));
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void write(DataOutput out) throws IOException {
  byte[] schemaBytes=Bytes.toBytes(record.getSchema().toString());
  out.writeInt(schemaBytes.length);
  out.write(schemaBytes);
  byte[] recordBytes=Bytes.toBytes(StructuredRecordStringConverter.toJsonString(record));
  out.writeInt(recordBytes.length);
  out.write(recordBytes);
}
Program: 5850
Project: 5850
Buggy source:
@Override protected synchronized void doShutDown(){
  if (processController == null) {
    LOG.warn("String_Node_Str");
    return;
  }
  stopPollStatus();
  try {
    Uninterruptibles.getUninterruptibly(getStopMessageFuture(),Constants.APPLICATION_MAX_STOP_SECONDS,TimeUnit.SECONDS);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e);
    kill();
  }
  FinalApplicationStatus finalStatus=null;
  try {
    StopWatch stopWatch=new StopWatch();
    stopWatch.start();
    stopWatch.split();
    long maxTime=TimeUnit.MILLISECONDS.convert(Constants.APPLICATION_MAX_STOP_SECONDS,TimeUnit.SECONDS);
    YarnApplicationReport report=processController.getReport();
    finalStatus=report.getFinalApplicationStatus();
    ApplicationId appId=report.getApplicationId();
    while (finalStatus == FinalApplicationStatus.UNDEFINED && stopWatch.getSplitTime() < maxTime) {
      LOG.debug("String_Node_Str",appName,appId,finalStatus);
      TimeUnit.SECONDS.sleep(1);
      stopWatch.split();
      finalStatus=processController.getReport().getFinalApplicationStatus();
    }
    LOG.debug("String_Node_Str",appName,appId,finalStatus);
    if (finalStatus == FinalApplicationStatus.UNDEFINED) {
      kill();
    }
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str",e.getMessage(),e);
    kill();
  }
  super.doShutDown();
  if (finalStatus == FinalApplicationStatus.FAILED) {
    setTerminationStatus(finalStatus);
    throw new RuntimeException(String.format("String_Node_Str",appName,getRunId(),finalStatus.name().toLowerCase()));
  }
}

Fixed version (ground truth):
@Override protected synchronized void doShutDown(){
  if (processController == null) {
    LOG.warn("String_Node_Str");
    return;
  }
  stopPollStatus();
  try {
    Uninterruptibles.getUninterruptibly(getStopMessageFuture(),maxStopSeconds,TimeUnit.SECONDS);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e);
    kill();
  }
  FinalApplicationStatus finalStatus=null;
  try {
    StopWatch stopWatch=new StopWatch();
    stopWatch.start();
    stopWatch.split();
    long maxTime=TimeUnit.MILLISECONDS.convert(maxStopSeconds,TimeUnit.SECONDS);
    YarnApplicationReport report=processController.getReport();
    finalStatus=report.getFinalApplicationStatus();
    ApplicationId appId=report.getApplicationId();
    while (finalStatus == FinalApplicationStatus.UNDEFINED && stopWatch.getSplitTime() < maxTime) {
      LOG.debug("String_Node_Str",appName,appId,finalStatus);
      TimeUnit.SECONDS.sleep(1);
      stopWatch.split();
      finalStatus=processController.getReport().getFinalApplicationStatus();
    }
    LOG.debug("String_Node_Str",appName,appId,finalStatus);
    if (finalStatus == FinalApplicationStatus.UNDEFINED) {
      kill();
    }
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str",e.getMessage(),e);
    kill();
  }
  super.doShutDown();
  if (finalStatus == FinalApplicationStatus.FAILED) {
    setTerminationStatus(finalStatus);
    throw new RuntimeException(String.format("String_Node_Str",appName,getRunId(),finalStatus.name().toLowerCase()));
  }
}
Program: 5851
Project: 5851
Buggy source:
@Override protected void doStartUp(){
  super.doStartUp();
  try {
    processController=startUp.call();
    YarnApplicationReport report=processController.getReport();
    ApplicationId appId=report.getApplicationId();
    LOG.debug("String_Node_Str",appName,appId);
    YarnApplicationState state=report.getYarnApplicationState();
    StopWatch stopWatch=new StopWatch();
    stopWatch.start();
    stopWatch.split();
    long maxTime=TimeUnit.MILLISECONDS.convert(Constants.APPLICATION_MAX_START_SECONDS,TimeUnit.SECONDS);
    LOG.debug("String_Node_Str",appName,appId);
    while (!hasRun(state) && stopWatch.getSplitTime() < maxTime) {
      report=processController.getReport();
      state=report.getYarnApplicationState();
      LOG.debug("String_Node_Str",appName,appId,state);
      TimeUnit.SECONDS.sleep(1);
      stopWatch.split();
    }
    LOG.info("String_Node_Str",appName,appId,state);
    if (state != YarnApplicationState.RUNNING) {
      LOG.info("String_Node_Str",appName,appId,Constants.APPLICATION_MAX_START_SECONDS);
      forceShutDown();
    }
 else {
      try {
        URL resourceUrl=URI.create(String.format("String_Node_Str",report.getHost(),report.getRpcPort())).resolve(TrackerService.PATH).toURL();
        resourcesClient=new ResourceReportClient(resourceUrl);
      }
 catch (      IOException e) {
        resourcesClient=null;
      }
    }
  }
 catch (  Exception e) {
    throw Throwables.propagate(e);
  }
}

Fixed version (ground truth):
@Override protected void doStartUp(){
  super.doStartUp();
  try {
    processController=startUp.call();
    YarnApplicationReport report=processController.getReport();
    ApplicationId appId=report.getApplicationId();
    LOG.debug("String_Node_Str",appName,appId);
    YarnApplicationState state=report.getYarnApplicationState();
    StopWatch stopWatch=new StopWatch();
    stopWatch.start();
    stopWatch.split();
    long maxTime=TimeUnit.MILLISECONDS.convert(maxStartSeconds,TimeUnit.SECONDS);
    LOG.debug("String_Node_Str",appName,appId);
    while (!hasRun(state) && stopWatch.getSplitTime() < maxTime) {
      report=processController.getReport();
      state=report.getYarnApplicationState();
      LOG.debug("String_Node_Str",appName,appId,state);
      TimeUnit.SECONDS.sleep(1);
      stopWatch.split();
    }
    LOG.info("String_Node_Str",appName,appId,state);
    if (state != YarnApplicationState.RUNNING) {
      LOG.info("String_Node_Str",appName,appId,Constants.APPLICATION_MAX_START_SECONDS);
      forceShutDown();
    }
 else {
      try {
        URL resourceUrl=URI.create(String.format("String_Node_Str",report.getHost(),report.getRpcPort())).resolve(TrackerService.PATH).toURL();
        resourcesClient=new ResourceReportClient(resourceUrl);
      }
 catch (      IOException e) {
        resourcesClient=null;
      }
    }
  }
 catch (  Exception e) {
    throw Throwables.propagate(e);
  }
}
Program: 5855
Project: 5855
Buggy source:
/** 
 * Return the original properties of a dataset instance, that is, the properties with which the dataset was created or last reconfigured.
 * @param instance the id of the dataset
 * @return The original properties as stored in the dataset's spec, or if they are not available, a best effortto derive the original properties from the top-level properties of the spec
 * @throws UnauthorizedException if permimeter security and authorization are enabled, and the current user does nothave any privileges on the #instance
 */
Map<String,String> getOriginalProperties(Id.DatasetInstance instance) throws Exception {
  DatasetSpecification spec=instanceManager.get(instance);
  if (spec == null) {
    throw new NotFoundException(instance);
  }
  ensureAccess(instance.toEntityId());
  return DatasetsUtil.fixOriginalProperties(spec).getOriginalProperties();
}

Fixed version (ground truth):
/** 
 * Return the original properties of a dataset instance, that is, the properties with which the dataset was created or last reconfigured.
 * @param instance the id of the dataset
 * @return The original properties as stored in the dataset's spec, or if they are not available, a best effortto derive the original properties from the top-level properties of the spec
 * @throws UnauthorizedException if perimeter security and authorization are enabled, and the current user does nothave any privileges on the #instance
 */
Map<String,String> getOriginalProperties(Id.DatasetInstance instance) throws Exception {
  DatasetSpecification spec=instanceManager.get(instance);
  if (spec == null) {
    throw new NotFoundException(instance);
  }
  ensureAccess(instance.toEntityId());
  return DatasetsUtil.fixOriginalProperties(spec).getOriginalProperties();
}
Program: 5856
Project: 5856
Buggy source:
@POST @Path("String_Node_Str") public void drop(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String instanceName) throws Exception {
  InternalDatasetDropParams params=GSON.fromJson(request.getContent().toString(Charsets.UTF_8),InternalDatasetDropParams.class);
  Preconditions.checkArgument(params.getInstanceSpec() != null,"String_Node_Str");
  Preconditions.checkArgument(params.getTypeMeta() != null,"String_Node_Str");
  DatasetSpecification spec=params.getInstanceSpec();
  DatasetTypeMeta typeMeta=params.getTypeMeta();
  try {
    datasetAdminService.drop(Id.DatasetInstance.from(namespaceId,instanceName),typeMeta,spec);
    responder.sendJson(HttpResponseStatus.OK,spec);
  }
 catch (  BadRequestException e) {
    responder.sendString(HttpResponseStatus.BAD_REQUEST,e.getMessage());
  }
}

Fixed version (ground truth):
@POST @Path("String_Node_Str") public void drop(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String instanceName) throws Exception {
  propagateUserId(request);
  InternalDatasetDropParams params=GSON.fromJson(request.getContent().toString(Charsets.UTF_8),InternalDatasetDropParams.class);
  Preconditions.checkArgument(params.getInstanceSpec() != null,"String_Node_Str");
  Preconditions.checkArgument(params.getTypeMeta() != null,"String_Node_Str");
  DatasetSpecification spec=params.getInstanceSpec();
  DatasetTypeMeta typeMeta=params.getTypeMeta();
  try {
    datasetAdminService.drop(Id.DatasetInstance.from(namespaceId,instanceName),typeMeta,spec);
    responder.sendJson(HttpResponseStatus.OK,spec);
  }
 catch (  BadRequestException e) {
    responder.sendString(HttpResponseStatus.BAD_REQUEST,e.getMessage());
  }
}
Program: 5857
Project: 5857
Buggy source:
@Inject public DatasetAdminOpHTTPHandler(DatasetAdminService datasetAdminService){
  this.datasetAdminService=datasetAdminService;
}

Fixed version (ground truth):
@Inject @VisibleForTesting public DatasetAdminOpHTTPHandler(DatasetAdminService datasetAdminService){
  this.datasetAdminService=datasetAdminService;
}
Program: 5858
Project: 5858
Buggy source:
@POST @Path("String_Node_Str") public void truncate(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String instanceName){
  try {
    Id.DatasetInstance instanceId=Id.DatasetInstance.from(namespaceId,instanceName);
    datasetAdminService.truncate(instanceId);
    responder.sendJson(HttpResponseStatus.OK,new DatasetAdminOpResponse(null,null));
  }
 catch (  NotFoundException e) {
    LOG.debug("String_Node_Str",e);
    responder.sendString(HttpResponseStatus.NOT_FOUND,StringUtils.defaultIfEmpty(e.getMessage(),"String_Node_Str"));
  }
catch (  Exception e) {
    LOG.error(getAdminOpErrorMessage("String_Node_Str",instanceName),e);
    responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,getAdminOpErrorMessage("String_Node_Str",instanceName));
  }
}

Fixed version (ground truth):
@POST @Path("String_Node_Str") public void truncate(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String instanceName){
  propagateUserId(request);
  try {
    Id.DatasetInstance instanceId=Id.DatasetInstance.from(namespaceId,instanceName);
    datasetAdminService.truncate(instanceId);
    responder.sendJson(HttpResponseStatus.OK,new DatasetAdminOpResponse(null,null));
  }
 catch (  NotFoundException e) {
    LOG.debug("String_Node_Str",e);
    responder.sendString(HttpResponseStatus.NOT_FOUND,StringUtils.defaultIfEmpty(e.getMessage(),"String_Node_Str"));
  }
catch (  Exception e) {
    LOG.error(getAdminOpErrorMessage("String_Node_Str",instanceName),e);
    responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,getAdminOpErrorMessage("String_Node_Str",instanceName));
  }
}
Program: 5859
Project: 5859
Buggy source:
@POST @Path("String_Node_Str") public void upgrade(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String instanceName){
  try {
    Id.DatasetInstance instanceId=Id.DatasetInstance.from(namespaceId,instanceName);
    datasetAdminService.upgrade(instanceId);
    responder.sendJson(HttpResponseStatus.OK,new DatasetAdminOpResponse(null,null));
  }
 catch (  NotFoundException e) {
    LOG.debug("String_Node_Str",e);
    responder.sendString(HttpResponseStatus.NOT_FOUND,StringUtils.defaultIfEmpty(e.getMessage(),"String_Node_Str"));
  }
catch (  Exception e) {
    LOG.error(getAdminOpErrorMessage("String_Node_Str",instanceName),e);
    responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,getAdminOpErrorMessage("String_Node_Str",instanceName));
  }
}

Fixed version (ground truth):
@POST @Path("String_Node_Str") public void upgrade(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String instanceName){
  propagateUserId(request);
  try {
    Id.DatasetInstance instanceId=Id.DatasetInstance.from(namespaceId,instanceName);
    datasetAdminService.upgrade(instanceId);
    responder.sendJson(HttpResponseStatus.OK,new DatasetAdminOpResponse(null,null));
  }
 catch (  NotFoundException e) {
    LOG.debug("String_Node_Str",e);
    responder.sendString(HttpResponseStatus.NOT_FOUND,StringUtils.defaultIfEmpty(e.getMessage(),"String_Node_Str"));
  }
catch (  Exception e) {
    LOG.error(getAdminOpErrorMessage("String_Node_Str",instanceName),e);
    responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,getAdminOpErrorMessage("String_Node_Str",instanceName));
  }
}
Program: 5860
Project: 5860
Buggy source:
@POST @Path("String_Node_Str") public void exists(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String instanceName){
  Id.Namespace namespace=Id.Namespace.from(namespaceId);
  try {
    Id.DatasetInstance instanceId=Id.DatasetInstance.from(namespace,instanceName);
    responder.sendJson(HttpResponseStatus.OK,new DatasetAdminOpResponse(datasetAdminService.exists(instanceId),null));
  }
 catch (  NotFoundException e) {
    LOG.debug("String_Node_Str",e);
    responder.sendString(HttpResponseStatus.NOT_FOUND,StringUtils.defaultIfEmpty(e.getMessage(),"String_Node_Str"));
  }
catch (  Exception e) {
    LOG.error(getAdminOpErrorMessage("String_Node_Str",instanceName),e);
    responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,getAdminOpErrorMessage("String_Node_Str",instanceName));
  }
}

Fixed version (ground truth):
@POST @Path("String_Node_Str") public void exists(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String instanceName){
  propagateUserId(request);
  Id.Namespace namespace=Id.Namespace.from(namespaceId);
  try {
    Id.DatasetInstance instanceId=Id.DatasetInstance.from(namespace,instanceName);
    responder.sendJson(HttpResponseStatus.OK,new DatasetAdminOpResponse(datasetAdminService.exists(instanceId),null));
  }
 catch (  NotFoundException e) {
    LOG.debug("String_Node_Str",e);
    responder.sendString(HttpResponseStatus.NOT_FOUND,StringUtils.defaultIfEmpty(e.getMessage(),"String_Node_Str"));
  }
catch (  Exception e) {
    LOG.error(getAdminOpErrorMessage("String_Node_Str",instanceName),e);
    responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,getAdminOpErrorMessage("String_Node_Str",instanceName));
  }
}
Program: 5861
Project: 5861
Buggy source:
@POST @Path("String_Node_Str") public void create(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String name){
  InternalDatasetCreationParams params=GSON.fromJson(request.getContent().toString(Charsets.UTF_8),InternalDatasetCreationParams.class);
  Preconditions.checkArgument(params.getProperties() != null,"String_Node_Str");
  Preconditions.checkArgument(params.getTypeMeta() != null,"String_Node_Str");
  DatasetProperties props=params.getProperties();
  DatasetTypeMeta typeMeta=params.getTypeMeta();
  try {
    Id.DatasetInstance instanceId=Id.DatasetInstance.from(namespaceId,name);
    DatasetSpecification spec=datasetAdminService.createOrUpdate(instanceId,typeMeta,props,null);
    responder.sendJson(HttpResponseStatus.OK,spec);
  }
 catch (  BadRequestException e) {
    responder.sendString(HttpResponseStatus.BAD_REQUEST,e.getMessage());
  }
catch (  Exception e) {
    responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,e.getMessage());
  }
}

Fixed version (ground truth):
@POST @Path("String_Node_Str") public void create(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String name){
  propagateUserId(request);
  InternalDatasetCreationParams params=GSON.fromJson(request.getContent().toString(Charsets.UTF_8),InternalDatasetCreationParams.class);
  Preconditions.checkArgument(params.getProperties() != null,"String_Node_Str");
  Preconditions.checkArgument(params.getTypeMeta() != null,"String_Node_Str");
  DatasetProperties props=params.getProperties();
  DatasetTypeMeta typeMeta=params.getTypeMeta();
  try {
    Id.DatasetInstance instanceId=Id.DatasetInstance.from(namespaceId,name);
    DatasetSpecification spec=datasetAdminService.createOrUpdate(instanceId,typeMeta,props,null);
    responder.sendJson(HttpResponseStatus.OK,spec);
  }
 catch (  BadRequestException e) {
    responder.sendString(HttpResponseStatus.BAD_REQUEST,e.getMessage());
  }
catch (  Exception e) {
    responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,e.getMessage());
  }
}
Program: 5862
Project: 5862
Buggy source:
@POST @Path("String_Node_Str") public void update(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String name){
  InternalDatasetUpdateParams params=GSON.fromJson(request.getContent().toString(Charsets.UTF_8),InternalDatasetUpdateParams.class);
  Preconditions.checkArgument(params.getProperties() != null,"String_Node_Str");
  Preconditions.checkArgument(params.getTypeMeta() != null,"String_Node_Str");
  Preconditions.checkArgument(params.getExistingSpec() != null,"String_Node_Str");
  DatasetProperties props=params.getProperties();
  DatasetSpecification existing=params.getExistingSpec();
  DatasetTypeMeta typeMeta=params.getTypeMeta();
  try {
    Id.DatasetInstance instanceId=Id.DatasetInstance.from(namespaceId,name);
    DatasetSpecification spec=datasetAdminService.createOrUpdate(instanceId,typeMeta,props,existing);
    responder.sendJson(HttpResponseStatus.OK,spec);
  }
 catch (  NotFoundException e) {
    LOG.debug("String_Node_Str",e);
    responder.sendString(HttpResponseStatus.NOT_FOUND,StringUtils.defaultIfEmpty(e.getMessage(),"String_Node_Str"));
  }
catch (  BadRequestException e) {
    responder.sendString(HttpResponseStatus.BAD_REQUEST,e.getMessage());
  }
catch (  IncompatibleUpdateException e) {
    responder.sendString(HttpResponseStatus.CONFLICT,e.getMessage());
  }
catch (  Exception e) {
    responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,e.getMessage());
  }
}

Fixed version (ground truth):
@POST @Path("String_Node_Str") public void update(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String name){
  propagateUserId(request);
  InternalDatasetUpdateParams params=GSON.fromJson(request.getContent().toString(Charsets.UTF_8),InternalDatasetUpdateParams.class);
  Preconditions.checkArgument(params.getProperties() != null,"String_Node_Str");
  Preconditions.checkArgument(params.getTypeMeta() != null,"String_Node_Str");
  Preconditions.checkArgument(params.getExistingSpec() != null,"String_Node_Str");
  DatasetProperties props=params.getProperties();
  DatasetSpecification existing=params.getExistingSpec();
  DatasetTypeMeta typeMeta=params.getTypeMeta();
  try {
    Id.DatasetInstance instanceId=Id.DatasetInstance.from(namespaceId,name);
    DatasetSpecification spec=datasetAdminService.createOrUpdate(instanceId,typeMeta,props,existing);
    responder.sendJson(HttpResponseStatus.OK,spec);
  }
 catch (  NotFoundException e) {
    LOG.debug("String_Node_Str",e);
    responder.sendString(HttpResponseStatus.NOT_FOUND,StringUtils.defaultIfEmpty(e.getMessage(),"String_Node_Str"));
  }
catch (  BadRequestException e) {
    responder.sendString(HttpResponseStatus.BAD_REQUEST,e.getMessage());
  }
catch (  IncompatibleUpdateException e) {
    responder.sendString(HttpResponseStatus.CONFLICT,e.getMessage());
  }
catch (  Exception e) {
    responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,e.getMessage());
  }
}
Program: 5863
Project: 5863
Buggy source:
@Inject public LocalDatasetOpExecutor(CConfiguration cConf,DiscoveryServiceClient discoveryClient,DatasetOpExecutorService executorServer){
  super(cConf,discoveryClient);
  this.executorServer=executorServer;
}

Fixed version (ground truth):
@Inject @VisibleForTesting public LocalDatasetOpExecutor(CConfiguration cConf,DiscoveryServiceClient discoveryClient,DatasetOpExecutorService executorServer,AuthenticationContext authenticationContext){
  super(cConf,discoveryClient,authenticationContext);
  this.executorServer=executorServer;
}
Program: 5864
Project: 5864
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);
  doRequest(datasetInstanceId,"String_Node_Str",GSON.toJson(dropParams));
}
Program: 5865
Project: 5865
Buggy source:
@Override public void upgrade(Id.DatasetInstance datasetInstanceId) throws Exception {
  executeAdminOp(datasetInstanceId,"String_Node_Str");
}

Fixed version (ground truth):
@Override public void upgrade(Id.DatasetInstance datasetInstanceId) throws Exception {
  executeAdminOp(datasetInstanceId,"String_Node_Str",null);
}
Program: 5866
Project: 5866
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);
  HttpResponse response=doRequest(datasetInstanceId,"String_Node_Str",GSON.toJson(updateParams));
  return ObjectResponse.fromJsonBody(response,DatasetSpecification.class).getResponseObject();
}
Program: 5867
Project: 5867
Buggy source:
@Override public void truncate(Id.DatasetInstance datasetInstanceId) throws Exception {
  executeAdminOp(datasetInstanceId,"String_Node_Str");
}

Fixed version (ground truth):
@Override public void truncate(Id.DatasetInstance datasetInstanceId) throws Exception {
  executeAdminOp(datasetInstanceId,"String_Node_Str",null);
}
Program: 5868
Project: 5868
Buggy source:
@Override public boolean exists(Id.DatasetInstance datasetInstanceId) throws Exception {
  return (Boolean)executeAdminOp(datasetInstanceId,"String_Node_Str").getResult();
}

Fixed version (ground truth):
@Override public boolean exists(Id.DatasetInstance datasetInstanceId) throws Exception {
  return (Boolean)executeAdminOp(datasetInstanceId,"String_Node_Str",null).getResult();
}
Program: 5869
Project: 5869
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);
  HttpResponse response=doRequest(datasetInstanceId,"String_Node_Str",GSON.toJson(creationParams));
  return ObjectResponse.fromJsonBody(response,DatasetSpecification.class).getResponseObject();
}
Program: 5870
Project: 5870
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));
    }
  }
);
  this.httpRequestConfig=new DefaultHttpRequestConfig();
}

Fixed version (ground truth):
@Inject RemoteDatasetOpExecutor(CConfiguration cConf,final DiscoveryServiceClient discoveryClient,AuthenticationContext authenticationContext){
  this.cConf=cConf;
  this.authenticationContext=authenticationContext;
  this.endpointStrategySupplier=Suppliers.memoize(new Supplier<EndpointStrategy>(){
    @Override public EndpointStrategy get(){
      return new RandomEndpointStrategy(discoveryClient.discover(Constants.Service.DATASET_EXECUTOR));
    }
  }
);
  this.httpRequestConfig=new DefaultHttpRequestConfig();
}
Program: 5871
Project: 5871
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,@Nullable String body) throws IOException, HandlerException, ConflictException {
  HttpResponse httpResponse=doRequest(datasetInstanceId,opName,body);
  return GSON.fromJson(Bytes.toString(httpResponse.getResponseBody()),DatasetAdminOpResponse.class);
}
Program: 5872
Project: 5872
Buggy source:
@Inject public YarnDatasetOpExecutor(CConfiguration cConf,DiscoveryServiceClient discoveryClient){
  super(cConf,discoveryClient);
}

Fixed version (ground truth):
@Inject YarnDatasetOpExecutor(CConfiguration cConf,DiscoveryServiceClient discoveryClient,AuthenticationContext authenticationContext){
  super(cConf,discoveryClient,authenticationContext);
}
Program: 5875
Project: 5875
Buggy source:
@Override public void initialize() throws Exception {
  Job job=getContext().getHadoopJob();
  job.setMapperClass(Emitter.class);
  job.setReducerClass(Counter.class);
  job.setNumReduceTasks(1);
  context.addInput(Input.ofDataset("String_Node_Str"));
  context.addOutput(Output.ofDataset("String_Node_Str"));
}

Fixed version (ground truth):
@Override public void initialize() throws Exception {
  MapReduceContext context=getContext();
  Job job=context.getHadoopJob();
  job.setMapperClass(Emitter.class);
  job.setReducerClass(Counter.class);
  job.setNumReduceTasks(1);
  context.addInput(Input.ofDataset("String_Node_Str"));
  context.addOutput(Output.ofDataset("String_Node_Str"));
}
Program: 5876
Project: 5876
Buggy source:
@Override public void start(){
  super.start();
  try {
    logSchema=new LogSchema().getAvroSchema();
    FileMetaDataManager fileMetaDataManager=new FileMetaDataManager(tableUtil,txExecutorFactory,rootLocationFactory,namespacedLocationFactory,cConf,impersonator);
    AvroFileWriter avroFileWriter=new AvroFileWriter(fileMetaDataManager,namespacedLocationFactory,logBaseDir,logSchema,maxLogFileSizeBytes,syncIntervalBytes,inactiveIntervalMs,impersonator);
    logFileWriter=new SimpleLogFileWriter(avroFileWriter,checkpointIntervalMs);
    LogCleanup logCleanup=new LogCleanup(fileMetaDataManager,rootLocationFactory,retentionDurationMs,impersonator);
    scheduledExecutor.scheduleAtFixedRate(logCleanup,10,logCleanupIntervalMins,TimeUnit.MINUTES);
  }
 catch (  Exception e) {
    close();
    throw Throwables.propagate(e);
  }
}

Fixed version (ground truth):
@Override public void start(){
  super.start();
  try {
    logSchema=new LogSchema().getAvroSchema();
    FileMetaDataManager fileMetaDataManager=new FileMetaDataManager(tableUtil,txExecutorFactory,rootLocationFactory,namespacedLocationFactory,cConf,impersonator);
    AvroFileWriter avroFileWriter=new AvroFileWriter(fileMetaDataManager,namespacedLocationFactory,logBaseDir,logSchema,maxLogFileSizeBytes,syncIntervalBytes,maxFileLifetimeMs,impersonator);
    logFileWriter=new SimpleLogFileWriter(avroFileWriter,checkpointIntervalMs);
    LogCleanup logCleanup=new LogCleanup(fileMetaDataManager,rootLocationFactory,retentionDurationMs,impersonator);
    scheduledExecutor.scheduleAtFixedRate(logCleanup,10,logCleanupIntervalMins,TimeUnit.MINUTES);
  }
 catch (  Exception e) {
    close();
    throw Throwables.propagate(e);
  }
}
Program: 5878
Project: 5878
Buggy source:
private void flush(boolean force) throws Exception {
  long currentTs=System.currentTimeMillis();
  if (!force && currentTs - lastCheckpointTime < flushIntervalMs) {
    return;
  }
  avroFileWriter.flush();
  checkpointManager.saveCheckpoint(partitionCheckpointMap);
  lastCheckpointTime=currentTs;
}

Fixed version (ground truth):
@Override public void flush(boolean force) throws IOException {
  try {
    long currentTs=System.currentTimeMillis();
    if (!force && currentTs - lastCheckpointTime < flushIntervalMs) {
      return;
    }
    avroFileWriter.flush();
    checkpointManager.saveCheckpoint(partitionCheckpointMap);
    lastCheckpointTime=currentTs;
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e);
    throw new IOException(e);
  }
}