nus-yam/ex-repair huggingface dataset:
Program: 4828
Project: 4828
Buggy source:
@Override public Map<String,String> getOutputFormatConfiguration(){
  if (isExternal) {
    throw new UnsupportedOperationException("String_Node_Str" + spec.getName() + "String_Node_Str");
  }
  Map<String,String> outputArgs=new HashMap<>(files.getOutputFormatConfiguration());
  PartitionKey outputKey=PartitionedFileSetArguments.getOutputPartitionKey(runtimeArguments,getPartitioning());
  if (outputKey == null) {
    String dynamicPartitionerClassName=PartitionedFileSetArguments.getDynamicPartitioner(runtimeArguments);
    if (dynamicPartitionerClassName == null) {
      throw new DataSetException("String_Node_Str");
    }
    Map<String,String> outputMetadata=PartitionedFileSetArguments.getOutputPartitionMetadata(runtimeArguments);
    PartitionedFileSetArguments.setOutputPartitionMetadata(outputArgs,outputMetadata);
    PartitionedFileSetArguments.setDynamicPartitioner(outputArgs,dynamicPartitionerClassName);
    PartitionedFileSetArguments.setDynamicPartitionerConcurrency(outputArgs,PartitionedFileSetArguments.isDynamicPartitionerConcurrencyAllowed(runtimeArguments));
    outputArgs.put(Constants.Dataset.Partitioned.HCONF_ATTR_OUTPUT_FORMAT_CLASS_NAME,files.getOutputFormatClassName());
    outputArgs.put(Constants.Dataset.Partitioned.HCONF_ATTR_OUTPUT_DATASET,getName());
  }
  return ImmutableMap.copyOf(outputArgs);
}

Fixed version (ground truth):
@Override public Map<String,String> getOutputFormatConfiguration(){
  if (isExternal) {
    throw new UnsupportedOperationException("String_Node_Str" + spec.getName() + "String_Node_Str");
  }
  Map<String,String> outputArgs=new HashMap<>(files.getOutputFormatConfiguration());
  PartitionKey outputKey=PartitionedFileSetArguments.getOutputPartitionKey(runtimeArguments,getPartitioning());
  if (outputKey == null) {
    String dynamicPartitionerClassName=PartitionedFileSetArguments.getDynamicPartitioner(runtimeArguments);
    if (dynamicPartitionerClassName == null) {
      throw new DataSetException("String_Node_Str");
    }
    Map<String,String> outputMetadata=PartitionedFileSetArguments.getOutputPartitionMetadata(runtimeArguments);
    PartitionedFileSetArguments.setOutputPartitionMetadata(outputArgs,outputMetadata);
    PartitionedFileSetArguments.setDynamicPartitioner(outputArgs,dynamicPartitionerClassName);
    PartitionedFileSetArguments.setDynamicPartitionerConcurrency(outputArgs,PartitionedFileSetArguments.isDynamicPartitionerConcurrencyAllowed(runtimeArguments));
    outputArgs.put(Constants.Dataset.Partitioned.HCONF_ATTR_OUTPUT_FORMAT_CLASS_NAME,files.getOutputFormatClassName());
    outputArgs.put(Constants.Dataset.Partitioned.HCONF_ATTR_OUTPUT_DATASET,getName());
  }
 else {
    assertNotExists(outputKey,true);
  }
  return ImmutableMap.copyOf(outputArgs);
}
Program: 4829
Project: 4829
Buggy source:
@Override public TimePartitionOutput getPartitionOutput(long time){
  if (isExternal) {
    throw new UnsupportedOperationException("String_Node_Str" + spec.getName() + "String_Node_Str");
  }
  PartitionKey key=partitionKeyForTime(time);
  return new BasicTimePartitionOutput(this,getOutputPath(key),key);
}

Fixed version (ground truth):
@Override public TimePartitionOutput getPartitionOutput(long time){
  if (isExternal) {
    throw new UnsupportedOperationException("String_Node_Str" + spec.getName() + "String_Node_Str");
  }
  PartitionKey key=partitionKeyForTime(time);
  assertNotExists(key,true);
  return new BasicTimePartitionOutput(this,getOutputPath(key),key);
}
Program: 4830
Project: 4830
Buggy source:
/** 
 * Relays job-level and task-level information about a particular MapReduce program run.
 */
@GET @Path("String_Node_Str") public void getMapReduceInfo(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String mapreduceId,@PathParam("String_Node_Str") String runId) throws IOException, NotFoundException {
  ProgramId programId=new ProgramId(namespaceId,appId,ProgramType.MAPREDUCE,mapreduceId);
  ProgramRunId run=programId.run(runId);
  ApplicationSpecification appSpec=store.getApplication(programId.getParent());
  if (appSpec == null) {
    throw new NotFoundException(programId.getApplication());
  }
  if (!appSpec.getMapReduce().containsKey(mapreduceId)) {
    throw new NotFoundException(programId);
  }
  RunRecordMeta runRecordMeta=store.getRun(programId,runId);
  if (runRecordMeta == null) {
    throw new NotFoundException(run);
  }
  MRJobInfo mrJobInfo=mrJobInfoFetcher.getMRJobInfo(run.toId());
  mrJobInfo.setState(runRecordMeta.getStatus().name());
  mrJobInfo.setStartTime(TimeUnit.SECONDS.toMillis(runRecordMeta.getRunTs()));
  Long stopTs=runRecordMeta.getStopTs();
  if (stopTs != null) {
    mrJobInfo.setStopTime(TimeUnit.SECONDS.toMillis(stopTs));
  }
  Gson gson=new GsonBuilder().serializeSpecialFloatingPointValues().create();
  responder.sendJson(HttpResponseStatus.OK,mrJobInfo,mrJobInfo.getClass(),gson);
}

Fixed version (ground truth):
/** 
 * Relays job-level and task-level information about a particular MapReduce program run.
 */
@GET @Path("String_Node_Str") public void getMapReduceInfo(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String appId,@PathParam("String_Node_Str") String mapreduceId,@PathParam("String_Node_Str") String runId) throws IOException, NotFoundException {
  ProgramId programId=new ProgramId(namespaceId,appId,ProgramType.MAPREDUCE,mapreduceId);
  ProgramRunId run=programId.run(runId);
  ApplicationSpecification appSpec=store.getApplication(programId.getParent());
  if (appSpec == null) {
    throw new NotFoundException(programId.getApplication());
  }
  if (!appSpec.getMapReduce().containsKey(mapreduceId)) {
    throw new NotFoundException(programId);
  }
  RunRecordMeta runRecordMeta=store.getRun(programId,runId);
  if (runRecordMeta == null) {
    throw new NotFoundException(run);
  }
  MRJobInfo mrJobInfo=mrJobInfoFetcher.getMRJobInfo(run.toId());
  mrJobInfo.setState(runRecordMeta.getStatus().name());
  mrJobInfo.setStartTime(TimeUnit.SECONDS.toMillis(runRecordMeta.getStartTs()));
  Long stopTs=runRecordMeta.getStopTs();
  if (stopTs != null) {
    mrJobInfo.setStopTime(TimeUnit.SECONDS.toMillis(stopTs));
  }
  Gson gson=new GsonBuilder().serializeSpecialFloatingPointValues().create();
  responder.sendJson(HttpResponseStatus.OK,mrJobInfo,mrJobInfo.getClass(),gson);
}
Program: 4831
Project: 4831
Buggy source:
public void setStartTime(@Nullable Long startTime){
  this.startTime=startTime;
}

Fixed version (ground truth):
public void setStartTime(Long startTime){
  this.startTime=startTime;
}
Program: 4832
Project: 4832
Buggy source:
@Nullable public Long getStartTime(){
  return startTime;
}

Fixed version (ground truth):
public Long getStartTime(){
  return startTime;
}
Program: 4834
Project: 4834
Buggy source:
public ETLMapReduce(BatchPhaseSpec phaseSpec){
  this.phaseSpec=phaseSpec;
}

Fixed version (ground truth):
public ETLMapReduce(BatchPhaseSpec phaseSpec,Set<String> connectorDatasets){
  this.phaseSpec=phaseSpec;
  this.connectorDatasets=connectorDatasets;
}
Program: 4835
Project: 4835
Buggy source:
@Override public void configure(){
  setName(phaseSpec.getPhaseName());
  setDescription("String_Node_Str" + phaseSpec.getDescription());
  setMapperResources(phaseSpec.getResources());
  setReducerResources(phaseSpec.getResources());
  setDriverResources(phaseSpec.getDriverResources());
  Set<String> sources=phaseSpec.getPhase().getSources();
  if (sources.isEmpty()) {
    throw new IllegalArgumentException(String.format("String_Node_Str",phaseSpec.getPhaseName()));
  }
  if (phaseSpec.getPhase().getSinks().isEmpty()) {
    throw new IllegalArgumentException(String.format("String_Node_Str",phaseSpec.getPhaseName()));
  }
  Set<StageInfo> reducers=phaseSpec.getPhase().getStagesOfType(BatchAggregator.PLUGIN_TYPE,BatchJoiner.PLUGIN_TYPE);
  if (reducers.size() > 1) {
    throw new IllegalArgumentException(String.format("String_Node_Str",phaseSpec.getPhaseName(),Joiner.on(',').join(reducers)));
  }
 else   if (!reducers.isEmpty()) {
    String reducerName=reducers.iterator().next().getName();
    PipelinePhase mapperPipeline=phaseSpec.getPhase().subsetTo(ImmutableSet.of(reducerName));
    for (    StageInfo stageInfo : mapperPipeline) {
      if (stageInfo.getErrorDatasetName() != null) {
        throw new IllegalArgumentException(String.format("String_Node_Str",stageInfo.getName(),reducerName));
      }
    }
  }
  Map<String,String> properties=new HashMap<>();
  properties.put(Constants.PIPELINEID,GSON.toJson(phaseSpec));
  setProperties(properties);
}

Fixed version (ground truth):
@Override public void configure(){
  setName(phaseSpec.getPhaseName());
  setDescription("String_Node_Str" + phaseSpec.getDescription());
  setMapperResources(phaseSpec.getResources());
  setReducerResources(phaseSpec.getResources());
  setDriverResources(phaseSpec.getDriverResources());
  Set<String> sources=phaseSpec.getPhase().getSources();
  if (sources.isEmpty()) {
    throw new IllegalArgumentException(String.format("String_Node_Str",phaseSpec.getPhaseName()));
  }
  if (phaseSpec.getPhase().getSinks().isEmpty()) {
    throw new IllegalArgumentException(String.format("String_Node_Str",phaseSpec.getPhaseName()));
  }
  Set<StageInfo> reducers=phaseSpec.getPhase().getStagesOfType(BatchAggregator.PLUGIN_TYPE,BatchJoiner.PLUGIN_TYPE);
  if (reducers.size() > 1) {
    throw new IllegalArgumentException(String.format("String_Node_Str",phaseSpec.getPhaseName(),Joiner.on(',').join(reducers)));
  }
 else   if (!reducers.isEmpty()) {
    String reducerName=reducers.iterator().next().getName();
    PipelinePhase mapperPipeline=phaseSpec.getPhase().subsetTo(ImmutableSet.of(reducerName));
    for (    StageInfo stageInfo : mapperPipeline) {
      if (stageInfo.getErrorDatasetName() != null) {
        throw new IllegalArgumentException(String.format("String_Node_Str",stageInfo.getName(),reducerName));
      }
    }
  }
  Map<String,String> properties=new HashMap<>();
  properties.put(Constants.PIPELINEID,GSON.toJson(phaseSpec));
  properties.put(Constants.CONNECTOR_DATASETS,GSON.toJson(connectorDatasets));
  setProperties(properties);
}
Program: 4836
Project: 4836
Buggy source:
public MapReduceBatchContext(MapReduceContext context,Metrics metrics,StageInfo stageInfo){
  super(context,metrics,new DatasetContextLookupProvider(context),context.getLogicalStartTime(),context.getAdmin(),stageInfo,new BasicArguments(context));
  this.mrContext=context;
  this.caller=NoStageLoggingCaller.wrap(Caller.DEFAULT);
  this.outputNames=new HashSet<>();
  this.inputNames=new HashSet<>();
  this.isPreviewEnabled=context.getDataTracer(stageInfo.getName()).isEnabled();
}

Fixed version (ground truth):
public MapReduceBatchContext(MapReduceContext context,Metrics metrics,StageInfo stageInfo){
  this(context,metrics,stageInfo,new HashSet<String>());
}
Program: 4837
Project: 4837
Buggy source:
/** 
 * Get the output, if preview is enabled, return the output with a   {@link NullOutputFormatProvider}.
 */
private Output getOutput(Output output){
  if (isPreviewEnabled) {
    return Output.of(output.getName(),new NullOutputFormatProvider());
  }
  return output;
}

Fixed version (ground truth):
/** 
 * Get the output, if preview is enabled, return the output with a   {@link NullOutputFormatProvider}.
 */
private Output getOutput(Output output){
  if (isPreviewEnabled && !connectorDatasets.contains(output.getName())) {
    return Output.of(output.getName(),new NullOutputFormatProvider());
  }
  return output;
}
Program: 4838
Project: 4838
Buggy source:
public ETLMapReduce(BatchPhaseSpec phaseSpec){
  this.phaseSpec=phaseSpec;
}

Fixed version (ground truth):
public ETLMapReduce(BatchPhaseSpec phaseSpec,Set<String> connectorDatasets){
  this.phaseSpec=phaseSpec;
  this.connectorDatasets=connectorDatasets;
}
Program: 4839
Project: 4839
Buggy source:
@Override public void configure(){
  setName(phaseSpec.getPhaseName());
  setDescription("String_Node_Str" + phaseSpec.getDescription());
  setMapperResources(phaseSpec.getResources());
  setReducerResources(phaseSpec.getResources());
  setDriverResources(phaseSpec.getDriverResources());
  Set<String> sources=phaseSpec.getPhase().getSources();
  if (sources.isEmpty()) {
    throw new IllegalArgumentException(String.format("String_Node_Str",phaseSpec.getPhaseName()));
  }
  if (phaseSpec.getPhase().getSinks().isEmpty()) {
    throw new IllegalArgumentException(String.format("String_Node_Str",phaseSpec.getPhaseName()));
  }
  Set<StageSpec> reducers=phaseSpec.getPhase().getStagesOfType(BatchAggregator.PLUGIN_TYPE,BatchJoiner.PLUGIN_TYPE);
  if (reducers.size() > 1) {
    throw new IllegalArgumentException(String.format("String_Node_Str",phaseSpec.getPhaseName(),Joiner.on(',').join(reducers)));
  }
 else   if (!reducers.isEmpty()) {
    String reducerName=reducers.iterator().next().getName();
    PipelinePhase mapperPipeline=phaseSpec.getPhase().subsetTo(ImmutableSet.of(reducerName));
    for (    StageSpec stageInfo : mapperPipeline) {
      if (stageInfo.getErrorDatasetName() != null) {
        throw new IllegalArgumentException(String.format("String_Node_Str",stageInfo.getName(),reducerName));
      }
    }
  }
  Map<String,String> properties=new HashMap<>();
  properties.put(Constants.PIPELINEID,GSON.toJson(phaseSpec));
  setProperties(properties);
}

Fixed version (ground truth):
@Override public void configure(){
  setName(phaseSpec.getPhaseName());
  setDescription("String_Node_Str" + phaseSpec.getDescription());
  setMapperResources(phaseSpec.getResources());
  setReducerResources(phaseSpec.getResources());
  setDriverResources(phaseSpec.getDriverResources());
  Set<String> sources=phaseSpec.getPhase().getSources();
  if (sources.isEmpty()) {
    throw new IllegalArgumentException(String.format("String_Node_Str",phaseSpec.getPhaseName()));
  }
  if (phaseSpec.getPhase().getSinks().isEmpty()) {
    throw new IllegalArgumentException(String.format("String_Node_Str",phaseSpec.getPhaseName()));
  }
  Set<StageSpec> reducers=phaseSpec.getPhase().getStagesOfType(BatchAggregator.PLUGIN_TYPE,BatchJoiner.PLUGIN_TYPE);
  if (reducers.size() > 1) {
    throw new IllegalArgumentException(String.format("String_Node_Str",phaseSpec.getPhaseName(),Joiner.on(',').join(reducers)));
  }
 else   if (!reducers.isEmpty()) {
    String reducerName=reducers.iterator().next().getName();
    PipelinePhase mapperPipeline=phaseSpec.getPhase().subsetTo(ImmutableSet.of(reducerName));
    for (    StageSpec stageInfo : mapperPipeline) {
      if (stageInfo.getErrorDatasetName() != null) {
        throw new IllegalArgumentException(String.format("String_Node_Str",stageInfo.getName(),reducerName));
      }
    }
  }
  Map<String,String> properties=new HashMap<>();
  properties.put(Constants.PIPELINEID,GSON.toJson(phaseSpec));
  properties.put(Constants.CONNECTOR_DATASETS,GSON.toJson(connectorDatasets));
  setProperties(properties);
}
Program: 4840
Project: 4840
Buggy source:
public MapReduceBatchContext(MapReduceContext context,Metrics metrics,StageSpec stageSpec){
  super(context,metrics,new DatasetContextLookupProvider(context),context.getLogicalStartTime(),context.getAdmin(),stageSpec,new BasicArguments(context));
  this.mrContext=context;
  this.caller=NoStageLoggingCaller.wrap(Caller.DEFAULT);
  this.outputNames=new HashSet<>();
  this.inputNames=new HashSet<>();
  this.isPreviewEnabled=context.getDataTracer(stageSpec.getName()).isEnabled();
}

Fixed version (ground truth):
public MapReduceBatchContext(MapReduceContext context,Metrics metrics,StageSpec stageSpec){
  this(context,metrics,stageSpec,new HashSet<String>());
}
Program: 4841
Project: 4841
Buggy source:
/** 
 * Get the output, if preview is enabled, return the output with a   {@link NullOutputFormatProvider}.
 */
private Output getOutput(Output output){
  if (isPreviewEnabled) {
    return Output.of(output.getName(),new NullOutputFormatProvider());
  }
  return output;
}

Fixed version (ground truth):
/** 
 * Get the output, if preview is enabled, return the output with a   {@link NullOutputFormatProvider}.
 */
private Output getOutput(Output output){
  if (isPreviewEnabled && !connectorDatasets.contains(output.getName())) {
    return Output.of(output.getName(),new NullOutputFormatProvider());
  }
  return output;
}
Program: 4842
Project: 4842
Buggy source:
/** 
 * Returns the   {@link PartitionKey} of the input configured for this task.
 */
PartitionKey getInputPartitionKey();

Fixed version (ground truth):
/** 
 * Returns the   {@link PartitionKey} of the input configured for this task.In case of CombineFileInputFormat, this will be the PartitionKey currently being processed by the task.
 */
PartitionKey getInputPartitionKey();
Program: 4843
Project: 4843
Buggy source:
@Override public void configure(){
  setName("String_Node_Str");
  setDescription("String_Node_Str");
  createDataset(INPUT,"String_Node_Str");
  createDataset(OUTPUT,"String_Node_Str");
  createDataset(PARTITIONED,"String_Node_Str",PartitionedFileSetProperties.builder().setPartitioning(Partitioning.builder().addStringField("String_Node_Str").addLongField("String_Node_Str").build()).setBasePath("String_Node_Str").setInputFormat(TextInputFormat.class).setOutputFormat(TextOutputFormat.class).setOutputProperty(TextOutputFormat.SEPERATOR,SEPARATOR).build());
  addMapReduce(new PartitionWriter());
  addMapReduce(new PartitionReader());
}

Fixed version (ground truth):
@Override public void configure(){
  setName("String_Node_Str");
  setDescription("String_Node_Str");
  createDataset(INPUT,"String_Node_Str");
  createDataset(OUTPUT,"String_Node_Str");
  Class<? extends InputFormat> inputFormatClass=getConfig().isUseCombineFileInputFormat() ? CombineTextInputFormat.class : TextInputFormat.class;
  createDataset(PARTITIONED,"String_Node_Str",PartitionedFileSetProperties.builder().setPartitioning(Partitioning.builder().addStringField("String_Node_Str").addLongField("String_Node_Str").build()).setBasePath("String_Node_Str").setInputFormat(inputFormatClass).setOutputFormat(TextOutputFormat.class).setOutputProperty(TextOutputFormat.SEPERATOR,SEPARATOR).build());
  addMapReduce(new PartitionWriter());
  addMapReduce(new PartitionReader());
}
Program: 4844
Project: 4844
Buggy source:
@Override public void initialize(MapReduceTaskContext<byte[],Put> context) throws Exception {
  InputContext inputContext=context.getInputContext();
  Preconditions.checkArgument(PARTITIONED.equals(inputContext.getInputName()));
  Preconditions.checkArgument(inputContext instanceof PartitionedFileSetInputContext);
  PartitionedFileSetInputContext pfsInputcontext=(PartitionedFileSetInputContext)inputContext;
  Preconditions.checkNotNull(pfsInputcontext.getInputPartitionKey());
  Map<String,String> dsArguments=RuntimeArguments.extractScope(Scope.DATASET,PARTITIONED,context.getRuntimeArguments());
  PartitionFilter inputPartitionFilter=PartitionedFileSetArguments.getInputPartitionFilter(dsArguments);
  Preconditions.checkNotNull(inputPartitionFilter);
  Preconditions.checkArgument(inputPartitionFilter.match(pfsInputcontext.getInputPartitionKey()));
}

Fixed version (ground truth):
@Override public void initialize(MapReduceTaskContext<byte[],Put> context) throws Exception {
  InputContext inputContext=context.getInputContext();
  Preconditions.checkArgument(PARTITIONED.equals(inputContext.getInputName()));
  Preconditions.checkArgument(inputContext instanceof PartitionedFileSetInputContext);
  this.pfsInputcontext=(PartitionedFileSetInputContext)inputContext;
  Preconditions.checkNotNull(pfsInputcontext.getInputPartitionKey());
  Preconditions.checkArgument(pfsInputcontext.getInputPartitionKeys().contains(pfsInputcontext.getInputPartitionKey()));
  Map<String,String> dsArguments=RuntimeArguments.extractScope(Scope.DATASET,PARTITIONED,context.getRuntimeArguments());
  PartitionFilter inputPartitionFilter=PartitionedFileSetArguments.getInputPartitionFilter(dsArguments);
  Preconditions.checkNotNull(inputPartitionFilter);
  Preconditions.checkArgument(inputPartitionFilter.match(pfsInputcontext.getInputPartitionKey()));
}
Program: 4845
Project: 4845
Buggy source:
@Override public void map(LongWritable pos,Text text,Context context) throws IOException, InterruptedException {
  String line=text.toString();
  String[] fields=line.split(SEPARATOR);
  context.write(rowToWrite,new Put(rowToWrite,Bytes.toBytes(fields[0]),Bytes.toBytes(fields[1])));
}

Fixed version (ground truth):
@Override public void map(LongWritable pos,Text text,Context context) throws IOException, InterruptedException {
  String line=text.toString();
  String[] fields=line.split(SEPARATOR);
  context.write(rowToWrite,new Put(rowToWrite,Bytes.toBytes(fields[0]),Bytes.toBytes(fields[1])));
  context.write(rowToWrite,new Put(rowToWrite,Bytes.toBytes(fields[0] + "String_Node_Str"),Bytes.toBytes(pfsInputcontext.getInputPartitionKey().toString())));
}
Program: 4847
Project: 4847
Buggy source:
@Override protected void configure(){
  super.configure();
  addStream(new Stream(streamName));
}

Fixed version (ground truth):
@Override protected void configure(){
  setName(WORKFLOW_NAME);
}
Program: 4848
Project: 4848
Buggy source:
@Override protected void configure(){
  super.configure();
  addStream(new Stream(streamName));
}

Fixed version (ground truth):
@Override protected void configure(){
  setName(WORKFLOW_NAME);
}
Program: 4850
Project: 4850
Buggy source:
@Override public void run(){
  try {
    ImpersonationUtils.doAs(opInfo.getUGI(),new Callable<Void>(){
      @Override public Void call() throws Exception {
        try {
          QueryStatus status=exploreService.fetchStatus(opInfo);
          if (status.getStatus() != QueryStatus.OpStatus.FINISHED && status.getStatus() != QueryStatus.OpStatus.CLOSED && status.getStatus() != QueryStatus.OpStatus.CANCELED && status.getStatus() != QueryStatus.OpStatus.ERROR) {
            LOG.info("String_Node_Str",handle.getHandle(),status.getStatus());
            exploreService.cancelInternal(handle);
          }
        }
 catch (        Throwable e) {
          LOG.error("String_Node_Str",handle.getHandle(),e);
        }
 finally {
          LOG.debug("String_Node_Str",handle);
          try {
            exploreService.closeInternal(handle,opInfo);
          }
 catch (          Throwable e) {
            LOG.error("String_Node_Str",handle,e);
          }
        }
        return null;
      }
    }
);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",handle);
  }
 finally {
    try {
      if (!UserGroupInformation.getLoginUser().equals(opInfo.getUGI())) {
        FileSystem.closeAllForUGI(opInfo.getUGI());
      }
    }
 catch (    IOException e) {
      LOG.warn("String_Node_Str",opInfo.getUGI(),e);
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    ImpersonationUtils.doAs(opInfo.getUGI(),new Callable<Void>(){
      @Override public Void call() throws Exception {
        try {
          QueryStatus status=exploreService.fetchStatus(opInfo);
          if (status.getStatus() != QueryStatus.OpStatus.FINISHED && status.getStatus() != QueryStatus.OpStatus.CLOSED && status.getStatus() != QueryStatus.OpStatus.CANCELED && status.getStatus() != QueryStatus.OpStatus.ERROR) {
            LOG.info("String_Node_Str",handle.getHandle(),status.getStatus());
            exploreService.cancelInternal(handle);
          }
        }
 catch (        Throwable e) {
          LOG.error("String_Node_Str",handle.getHandle(),e);
        }
 finally {
          LOG.debug("String_Node_Str",handle);
          try {
            exploreService.closeInternal(handle,opInfo);
          }
 catch (          Throwable e) {
            LOG.error("String_Node_Str",handle,e);
          }
        }
        return null;
      }
    }
);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",handle);
  }
}
Program: 4853
Project: 4853
Buggy source:
public static VersionNumber create(String versionString) throws ParseException {
  Matcher matcher=PATTERN.matcher(versionString);
  Matcher ibmMatcher=IBM_PATTERN.matcher(versionString);
  if (matcher.matches()) {
    String majorString=matcher.group(1);
    String minorString=matcher.group(3);
    String patchString=matcher.group(5);
    String last=matcher.group(7);
    String classifier=matcher.group(9);
    String snapshotString=matcher.group(10);
    return new VersionNumber(new Integer(majorString),minorString != null ? new Integer(minorString) : null,patchString != null ? new Integer(patchString) : null,last != null ? new Integer(last) : null,classifier,"String_Node_Str".equals(snapshotString));
  }
 else   if (ibmMatcher.matches()) {
    String majorString=ibmMatcher.group(1);
    String minorString=ibmMatcher.group(3);
    String patchString=ibmMatcher.group(5);
    String last=ibmMatcher.group(7);
    String classifier=ibmMatcher.group(9);
    return new VersionNumber(new Integer(majorString),minorString != null ? new Integer(minorString) : null,patchString != null ? new Integer(patchString) : null,last != null ? new Integer(last) : null,classifier,false);
  }
  throw new ParseException("String_Node_Str",0);
}

Fixed version (ground truth):
public static VersionNumber create(String versionString) throws ParseException {
  Matcher matcher=PATTERN.matcher(versionString);
  Matcher hdpMatcher=HDP_PATTERN.matcher(versionString);
  Matcher ibmMatcher=IBM_PATTERN.matcher(versionString);
  if (matcher.matches()) {
    String majorString=matcher.group(1);
    String minorString=matcher.group(3);
    String patchString=matcher.group(5);
    String last=matcher.group(7);
    String classifier=matcher.group(9);
    String snapshotString=matcher.group(10);
    return new VersionNumber(new Integer(majorString),minorString != null ? new Integer(minorString) : null,patchString != null ? new Integer(patchString) : null,last != null ? new Integer(last) : null,classifier,"String_Node_Str".equals(snapshotString));
  }
 else   if (hdpMatcher.matches()) {
    String majorString=hdpMatcher.group(1);
    String minorString=hdpMatcher.group(3);
    String patchString=hdpMatcher.group(5);
    return new VersionNumber(new Integer(majorString),minorString != null ? new Integer(minorString) : null,patchString != null ? new Integer(patchString) : null,null,null,false);
  }
 else   if (ibmMatcher.matches()) {
    String majorString=ibmMatcher.group(1);
    String minorString=ibmMatcher.group(3);
    String patchString=ibmMatcher.group(5);
    String last=ibmMatcher.group(7);
    String classifier=ibmMatcher.group(9);
    return new VersionNumber(new Integer(majorString),minorString != null ? new Integer(minorString) : null,patchString != null ? new Integer(patchString) : null,last != null ? new Integer(last) : null,classifier,false);
  }
  throw new ParseException("String_Node_Str",0);
}
Program: 4854
Project: 4854
Buggy source:
@Override public Service get(){
  return new AbstractService(){
    @Override protected void doStart(){
      try {
        namespaceAdmin.create(NamespaceMeta.DEFAULT);
        LOG.info("String_Node_Str",NamespaceMeta.DEFAULT);
        notifyStarted();
      }
 catch (      AlreadyExistsException e) {
        LOG.info("String_Node_Str");
        notifyStarted();
      }
catch (      Exception e) {
        notifyFailed(e);
      }
    }
    @Override protected void doStop(){
      notifyStopped();
    }
  }
;
}

Fixed version (ground truth):
@Override public Service get(){
  return new AbstractService(){
    @Override protected void doStart(){
      try {
        namespaceAdmin.create(NamespaceMeta.DEFAULT);
        LOG.info("String_Node_Str",NamespaceMeta.DEFAULT);
        notifyStarted();
      }
 catch (      FileAlreadyExistsException e) {
        LOG.warn("String_Node_Str",NamespaceMeta.DEFAULT,e);
        notifyStarted();
      }
catch (      NamespaceAlreadyExistsException e) {
        LOG.info("String_Node_Str");
        notifyStarted();
      }
catch (      Exception e) {
        notifyFailed(e);
      }
    }
    @Override protected void doStop(){
      notifyStopped();
    }
  }
;
}
Program: 4855
Project: 4855
Buggy source:
@Inject public DefaultNamespaceEnsurer(final NamespaceAdmin namespaceAdmin){
  this.serviceDelegate=new RetryOnStartFailureService(new Supplier<Service>(){
    @Override public Service get(){
      return new AbstractService(){
        @Override protected void doStart(){
          try {
            namespaceAdmin.create(NamespaceMeta.DEFAULT);
            LOG.info("String_Node_Str",NamespaceMeta.DEFAULT);
            notifyStarted();
          }
 catch (          AlreadyExistsException e) {
            LOG.info("String_Node_Str");
            notifyStarted();
          }
catch (          Exception e) {
            notifyFailed(e);
          }
        }
        @Override protected void doStop(){
          notifyStopped();
        }
      }
;
    }
  }
,RetryStrategies.exponentialDelay(200,5000,TimeUnit.MILLISECONDS));
}

Fixed version (ground truth):
@Inject public DefaultNamespaceEnsurer(final NamespaceAdmin namespaceAdmin){
  this.serviceDelegate=new RetryOnStartFailureService(new Supplier<Service>(){
    @Override public Service get(){
      return new AbstractService(){
        @Override protected void doStart(){
          try {
            namespaceAdmin.create(NamespaceMeta.DEFAULT);
            LOG.info("String_Node_Str",NamespaceMeta.DEFAULT);
            notifyStarted();
          }
 catch (          FileAlreadyExistsException e) {
            LOG.warn("String_Node_Str",NamespaceMeta.DEFAULT,e);
            notifyStarted();
          }
catch (          NamespaceAlreadyExistsException e) {
            LOG.info("String_Node_Str");
            notifyStarted();
          }
catch (          Exception e) {
            notifyFailed(e);
          }
        }
        @Override protected void doStop(){
          notifyStopped();
        }
      }
;
    }
  }
,RetryStrategies.exponentialDelay(200,5000,TimeUnit.MILLISECONDS));
}
Program: 4856
Project: 4856
Buggy source:
@Override public String get(){
  InputStream errorStream=urlConn.getErrorStream();
  try {
    return errorStream == null ? "String_Node_Str" : new String(ByteStreams.toByteArray(errorStream),StandardCharsets.UTF_8);
  }
 catch (  IOException e) {
    return "String_Node_Str";
  }
}

Fixed version (ground truth):
@Override public String get(){
  try (InputStream errorStream=urlConn.getErrorStream()){
    return errorStream == null ? "String_Node_Str" : new String(ByteStreams.toByteArray(errorStream),StandardCharsets.UTF_8);
  }
 catch (  IOException e) {
    return "String_Node_Str";
  }
 finally {
    urlConn.disconnect();
  }
}
Program: 4858
Project: 4858
Buggy source:
@Override public void close(){
  urlConn.disconnect();
}

Fixed version (ground truth):
@Override public void close(){
  Closeables.closeQuietly(inputStream);
  urlConn.disconnect();
}
Program: 4862
Project: 4862
Buggy source:
/** 
 * Prepares the resources that need to be localized to service containers.
 * @param tempDir a temporary directory for creating files to be localized
 * @param hConf the hadoop configuration
 * @return a list of extra classpath that need to be added to each container.
 * @throws IOException if failed to prepare localize resources
 */
List<String> prepareLocalizeResource(Path tempDir,Configuration hConf) throws IOException {
  CConfiguration containerCConf=CConfiguration.copy(cConf);
  containerCConf.set(Constants.CFG_LOCAL_DATA_DIR,"String_Node_Str");
  List<String> extraClassPath=new ArrayList<>();
  prepareLogSaverResources(tempDir,containerCConf,runnableLocalizeResources.get(Constants.Service.LOGSAVER),extraClassPath);
  if (cConf.getBoolean(Constants.Explore.EXPLORE_ENABLED)) {
    prepareExploreResources(tempDir,hConf,runnableLocalizeResources.get(Constants.Service.EXPLORE_HTTP_USER_SERVICE),extraClassPath);
  }
  Path cConfPath=saveCConf(containerCConf,Files.createTempFile(tempDir,"String_Node_Str","String_Node_Str"));
  Path hConfPath=saveHConf(hConf,Files.createTempFile(tempDir,"String_Node_Str","String_Node_Str"));
  for (  String service : ALL_SERVICES) {
    Map<String,LocalizeResource> localizeResources=runnableLocalizeResources.get(service);
    localizeResources.put(CCONF_NAME,new LocalizeResource(cConfPath.toFile(),false));
    localizeResources.put(HCONF_NAME,new LocalizeResource(hConfPath.toFile(),false));
  }
  return extraClassPath;
}

Fixed version (ground truth):
/** 
 * Prepares the resources that need to be localized to service containers.
 * @param tempDir a temporary directory for creating files to be localized
 * @param hConf the hadoop configuration
 * @return a list of extra classpath that need to be added to each container.
 * @throws IOException if failed to prepare localize resources
 */
List<String> prepareLocalizeResource(Path tempDir,Configuration hConf) throws IOException {
  CConfiguration containerCConf=CConfiguration.copy(cConf);
  containerCConf.set(Constants.CFG_LOCAL_DATA_DIR,"String_Node_Str");
  List<String> extraClassPath=new ArrayList<>();
  prepareLogSaverResources(tempDir,containerCConf,runnableLocalizeResources.get(Constants.Service.LOGSAVER),extraClassPath);
  prepareHBaseDDLExecutorResources(tempDir,containerCConf,runnableLocalizeResources.get(Constants.Service.DATASET_EXECUTOR));
  if (cConf.getBoolean(Constants.Explore.EXPLORE_ENABLED)) {
    prepareExploreResources(tempDir,hConf,runnableLocalizeResources.get(Constants.Service.EXPLORE_HTTP_USER_SERVICE),extraClassPath);
  }
  Path cConfPath=saveCConf(containerCConf,Files.createTempFile(tempDir,"String_Node_Str","String_Node_Str"));
  Path hConfPath=saveHConf(hConf,Files.createTempFile(tempDir,"String_Node_Str","String_Node_Str"));
  for (  String service : ALL_SERVICES) {
    Map<String,LocalizeResource> localizeResources=runnableLocalizeResources.get(service);
    localizeResources.put(CCONF_NAME,new LocalizeResource(cConfPath.toFile(),false));
    localizeResources.put(HCONF_NAME,new LocalizeResource(hConfPath.toFile(),false));
  }
  return extraClassPath;
}
Program: 4864
Project: 4864
Buggy source:
@Override public void run(){
  try {
    ImpersonationUtils.doAs(opInfo.getUGI(),new Callable<Void>(){
      @Override public Void call() throws Exception {
        try {
          QueryStatus status=exploreService.fetchStatus(opInfo);
          if (status.getStatus() != QueryStatus.OpStatus.FINISHED && status.getStatus() != QueryStatus.OpStatus.CLOSED && status.getStatus() != QueryStatus.OpStatus.CANCELED && status.getStatus() != QueryStatus.OpStatus.ERROR) {
            LOG.info("String_Node_Str",handle.getHandle(),status.getStatus());
            exploreService.cancelInternal(handle);
          }
        }
 catch (        Throwable e) {
          LOG.error("String_Node_Str",handle.getHandle(),e);
        }
 finally {
          LOG.debug("String_Node_Str",handle);
          try {
            exploreService.closeInternal(handle,opInfo);
          }
 catch (          Throwable e) {
            LOG.error("String_Node_Str",handle,e);
          }
        }
        return null;
      }
    }
);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",handle);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    ImpersonationUtils.doAs(opInfo.getUGI(),new Callable<Void>(){
      @Override public Void call() throws Exception {
        try {
          QueryStatus status=exploreService.fetchStatus(opInfo);
          if (status.getStatus() != QueryStatus.OpStatus.FINISHED && status.getStatus() != QueryStatus.OpStatus.CLOSED && status.getStatus() != QueryStatus.OpStatus.CANCELED && status.getStatus() != QueryStatus.OpStatus.ERROR) {
            LOG.info("String_Node_Str",handle.getHandle(),status.getStatus());
            exploreService.cancelInternal(handle);
          }
        }
 catch (        Throwable e) {
          LOG.error("String_Node_Str",handle.getHandle(),e);
        }
 finally {
          LOG.debug("String_Node_Str",handle);
          try {
            exploreService.closeInternal(handle,opInfo);
          }
 catch (          Throwable e) {
            LOG.error("String_Node_Str",handle,e);
          }
        }
        return null;
      }
    }
);
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",handle);
  }
 finally {
    try {
      if (!UserGroupInformation.getLoginUser().equals(opInfo.getUGI())) {
        FileSystem.closeAllForUGI(opInfo.getUGI());
      }
    }
 catch (    IOException e) {
      LOG.warn("String_Node_Str",opInfo.getUGI(),e);
    }
  }
}
Program: 4865
Project: 4865
Buggy source:
/** 
 * Collects stats from all   {@link OperationalStats}.
 */
private void collectOperationalStats() throws InterruptedException {
  LOG.trace("String_Node_Str");
  for (  Map.Entry<OperationalExtensionId,OperationalStats> entry : operationalStatsLoader.getAll().entrySet()) {
    if (!isRunning()) {
      return;
    }
    OperationalStats stats=entry.getValue();
    LOG.trace("String_Node_Str",stats.getServiceName(),stats.getStatType());
    try {
      stats.collect();
    }
 catch (    Throwable t) {
      Throwables.propagateIfInstanceOf(t,InterruptedException.class);
      Throwable rootCause=Throwables.getRootCause(t);
      if (rootCause instanceof ServiceUnavailableException || rootCause instanceof TException) {
        return;
      }
      if (rootCause instanceof InterruptedException) {
        throw (InterruptedException)rootCause;
      }
      LOG.warn("String_Node_Str",stats.getServiceName(),stats.getStatType(),rootCause.getMessage());
    }
  }
}

Fixed version (ground truth):
/** 
 * Collects stats from all   {@link OperationalStats}.
 */
private void collectOperationalStats() throws InterruptedException {
  LOG.trace("String_Node_Str");
  for (  Map.Entry<OperationalExtensionId,OperationalStats> entry : operationalStatsLoader.getAll().entrySet()) {
    if (!isRunning()) {
      return;
    }
    OperationalStats stats=entry.getValue();
    LOG.trace("String_Node_Str",stats.getServiceName(),stats.getStatType());
    try {
      stats.collect();
    }
 catch (    Throwable t) {
      Throwables.propagateIfInstanceOf(t,InterruptedException.class);
      Throwable rootCause=Throwables.getRootCause(t);
      if (rootCause instanceof ServiceUnavailableException || rootCause instanceof TException) {
        return;
      }
      if (rootCause instanceof InterruptedException) {
        throw (InterruptedException)rootCause;
      }
      READ_FAILURE_LOG.warn("String_Node_Str",stats.getServiceName(),stats.getStatType(),rootCause.getMessage());
    }
  }
}
Program: 4866
Project: 4866
Buggy source:
@Override protected Entry computeNext(){
  if (closed || (maxLimit <= 0)) {
    return endOfData();
  }
  while (scanner.hasNext()) {
    RawMessageTableEntry tableEntry=scanner.next();
    if (skipStartRow != null) {
      byte[] row=skipStartRow;
      skipStartRow=null;
      if (Bytes.equals(row,tableEntry.getKey())) {
        continue;
      }
    }
    MessageFilter.Result status=accept(tableEntry.getTxPtr());
    if (status == MessageFilter.Result.ACCEPT) {
      maxLimit--;
      return new ImmutableMessageTableEntry(tableEntry.getKey(),tableEntry.getPayload(),tableEntry.getTxPtr());
    }
    if (status == MessageFilter.Result.HOLD) {
      break;
    }
  }
  return endOfData();
}

Fixed version (ground truth):
@Override protected RawMessageTableEntry computeNext(){
  if (!entries.hasNext()) {
    return endOfData();
  }
  Entry entry=entries.next();
  if (topicId == null || (!topicId.equals(entry.getTopicId())) || (generation != entry.getGeneration())) {
    topicId=entry.getTopicId();
    generation=entry.getGeneration();
    topic=MessagingUtils.toDataKeyPrefix(topicId,entry.getGeneration());
    rowKey=new byte[topic.length + Bytes.SIZEOF_LONG + Bytes.SIZEOF_SHORT];
  }
  Bytes.putBytes(rowKey,0,topic,0,topic.length);
  Bytes.putLong(rowKey,topic.length,entry.getPublishTimestamp());
  Bytes.putShort(rowKey,topic.length + Bytes.SIZEOF_LONG,entry.getSequenceId());
  byte[] txPtr=null;
  if (entry.isTransactional()) {
    txPtr=Bytes.toBytes(entry.getTransactionWritePointer());
  }
  return tableEntry.set(rowKey,txPtr,entry.getPayload());
}
Program: 4867
Project: 4867
Buggy source:
@Override public void store(Iterator<? extends Entry> entries) throws IOException {
  persist(storeIterator.reset(entries));
}

Fixed version (ground truth):
@Override public void store(Iterator<? extends Entry> entries) throws IOException {
  persist(new StoreIterator(entries));
}
Program: 4868
Project: 4868
Buggy source:
@Override protected Entry computeNext(){
  if (closed || (!scanner.hasNext())) {
    return endOfData();
  }
  RawPayloadTableEntry entry=scanner.next();
  if (skipFirstRow) {
    skipFirstRow=false;
    if (!scanner.hasNext()) {
      return endOfData();
    }
    entry=scanner.next();
  }
  return new ImmutablePayloadTableEntry(entry.getKey(),entry.getValue());
}

Fixed version (ground truth):
@Override protected RawPayloadTableEntry computeNext(){
  if (!entries.hasNext()) {
    return endOfData();
  }
  Entry entry=entries.next();
  if (topicId == null || (!topicId.equals(entry.getTopicId())) || (generation != entry.getGeneration())) {
    topicId=entry.getTopicId();
    generation=entry.getGeneration();
    topic=MessagingUtils.toDataKeyPrefix(topicId,entry.getGeneration());
    rowKey=new byte[topic.length + (2 * Bytes.SIZEOF_LONG) + Bytes.SIZEOF_SHORT];
  }
  Bytes.putBytes(rowKey,0,topic,0,topic.length);
  Bytes.putLong(rowKey,topic.length,entry.getTransactionWritePointer());
  Bytes.putLong(rowKey,topic.length + Bytes.SIZEOF_LONG,entry.getPayloadWriteTimestamp());
  Bytes.putShort(rowKey,topic.length + (2 * Bytes.SIZEOF_LONG),entry.getPayloadSequenceId());
  return tableEntry.set(rowKey,entry.getPayload());
}
Program: 4869
Project: 4869
Buggy source:
@Override public void store(Iterator<? extends Entry> entries) throws IOException {
  persist(storeIterator.reset(entries));
}

Fixed version (ground truth):
@Override public void store(Iterator<? extends Entry> entries) throws IOException {
  persist(new StoreIterator(entries));
}
Program: 4870
Project: 4870
Buggy source:
@Override protected void run() throws Exception {
  try {
    Tasks.waitFor(true,new Callable<Boolean>(){
      @Override public Boolean call() throws Exception {
        if (stopping) {
          return true;
        }
        List<ArtifactSummary> artifacts=null;
        try {
          artifacts=artifactRepository.getArtifactSummaries(NamespaceId.SYSTEM,artifactName,Integer.MAX_VALUE,ArtifactSortOrder.DESC);
        }
 catch (        ArtifactNotFoundException ex) {
        }
        return artifacts != null && !artifacts.isEmpty();
      }
    }
,5,TimeUnit.MINUTES,2,TimeUnit.SECONDS,String.format("String_Node_Str",artifactName));
    List<ArtifactSummary> artifacts=new ArrayList<>(artifactRepository.getArtifactSummaries(NamespaceId.SYSTEM,artifactName,Integer.MAX_VALUE,ArtifactSortOrder.DESC));
    if (stopping) {
      LOG.debug("String_Node_Str",appId.getApplication());
    }
    createAppAndStartProgram(artifacts.remove(0));
  }
 catch (  Exception ex) {
    LOG.warn("String_Node_Str",appId,ex);
  }
}

Fixed version (ground truth):
@Override protected void run() throws Exception {
  try {
    Tasks.waitFor(true,new Callable<Boolean>(){
      @Override public Boolean call() throws Exception {
        if (stopping) {
          return true;
        }
        List<ArtifactSummary> artifacts=null;
        try {
          artifacts=artifactRepository.getArtifactSummaries(NamespaceId.SYSTEM,artifactName,Integer.MAX_VALUE,ArtifactSortOrder.DESC);
        }
 catch (        ArtifactNotFoundException ex) {
        }
        return artifacts != null && !artifacts.isEmpty();
      }
    }
,5,TimeUnit.MINUTES,2,TimeUnit.SECONDS,String.format("String_Node_Str",artifactName));
    List<ArtifactSummary> artifacts=new ArrayList<>(artifactRepository.getArtifactSummaries(NamespaceId.SYSTEM,artifactName,Integer.MAX_VALUE,ArtifactSortOrder.DESC));
    List<ArtifactSummary> userArtifacts=new ArrayList<>();
    try {
      userArtifacts.addAll(artifactRepository.getArtifactSummaries(appId.getNamespaceId(),artifactName,Integer.MAX_VALUE,ArtifactSortOrder.DESC));
    }
 catch (    ArtifactNotFoundException ex) {
    }
    artifacts.addAll(userArtifacts);
    ArtifactSummary maxSummary=artifacts.get(0);
    for (    ArtifactSummary currentSummary : artifacts) {
      ArtifactVersion currentVersion=new ArtifactVersion(currentSummary.getVersion());
      ArtifactVersion maxVersion=new ArtifactVersion(maxSummary.getVersion());
      if (currentVersion.compareTo(maxVersion) > 0) {
        maxSummary=currentSummary;
      }
    }
    if (stopping) {
      LOG.debug("String_Node_Str",appId.getApplication());
    }
    createAppAndStartProgram(maxSummary);
  }
 catch (  Exception ex) {
    LOG.warn("String_Node_Str",appId,ex);
  }
}
Program: 4871
Project: 4871
Buggy source:
private void createAppAndStartProgram(ArtifactSummary artifactSummary) throws Exception {
  LOG.info("String_Node_Str",appId.getApplication(),appConfig);
  applicationLifecycleService.deployApp(appId.getParent(),appId.getApplication(),appId.getVersion(),NamespaceId.SYSTEM.artifact(artifactSummary.getName(),artifactSummary.getVersion()).toId(),appConfig,new DefaultProgramTerminator());
  for (  Map.Entry<ProgramId,Map<String,String>> programEntry : programIdMap.entrySet()) {
    try {
      programLifecycleService.start(programEntry.getKey(),programEntry.getValue(),false);
    }
 catch (    IOException ex) {
      LOG.debug("String_Node_Str",programEntry.getKey(),ex.getMessage());
    }
  }
}

Fixed version (ground truth):
private void createAppAndStartProgram(ArtifactSummary artifactSummary) throws Exception {
  LOG.info("String_Node_Str",appId.getApplication(),appConfig);
  ArtifactId artifactId=artifactSummary.getScope().equals(ArtifactScope.SYSTEM) ? NamespaceId.SYSTEM.artifact(artifactSummary.getName(),artifactSummary.getVersion()) : appId.getNamespaceId().artifact(artifactSummary.getName(),artifactSummary.getVersion());
  applicationLifecycleService.deployApp(appId.getParent(),appId.getApplication(),appId.getVersion(),artifactId.toId(),appConfig,new DefaultProgramTerminator());
  for (  Map.Entry<ProgramId,Map<String,String>> programEntry : programIdMap.entrySet()) {
    try {
      programLifecycleService.start(programEntry.getKey(),programEntry.getValue(),false);
    }
 catch (    IOException ex) {
      LOG.debug("String_Node_Str",programEntry.getKey(),ex.getMessage());
    }
  }
}
Program: 4872
Project: 4872
Buggy source:
private boolean fetchAndProcessNotifications(DatasetContext context,MessageFetcher fetcher) throws Exception {
  boolean emptyFetch=true;
  try (CloseableIterator<Message> iterator=fetcher.fetch(NamespaceId.SYSTEM.getNamespace(),topic,100,messageId)){
    LOG.trace("String_Node_Str",messageId);
    while (iterator.hasNext() && !stopping) {
      emptyFetch=false;
      Message message=iterator.next();
      Notification notification;
      try {
        notification=GSON.fromJson(new String(message.getPayload(),StandardCharsets.UTF_8),Notification.class);
      }
 catch (      JsonSyntaxException e) {
        LOG.warn("String_Node_Str",message.getId(),e);
        messageId=message.getId();
        continue;
      }
      updateJobQueue(context,notification);
      messageId=message.getId();
    }
    if (!emptyFetch) {
      jobQueue.persistSubscriberState(topic,messageId);
    }
  }
 catch (  ServiceUnavailableException|TopicNotFoundException e) {
    SAMPLING_LOG.warn("String_Node_Str",e);
    failureCount++;
  }
  return emptyFetch;
}

Fixed version (ground truth):
@Nullable private String fetchAndProcessNotifications(DatasetContext context,MessageFetcher fetcher) throws Exception {
  String lastFetchedMessageId=null;
  try (CloseableIterator<Message> iterator=fetcher.fetch(NamespaceId.SYSTEM.getNamespace(),topic,100,messageId)){
    LOG.trace("String_Node_Str",messageId);
    while (iterator.hasNext() && !stopping) {
      Message message=iterator.next();
      Notification notification;
      try {
        notification=GSON.fromJson(new String(message.getPayload(),StandardCharsets.UTF_8),Notification.class);
      }
 catch (      JsonSyntaxException e) {
        LOG.warn("String_Node_Str",message.getId(),e);
        lastFetchedMessageId=message.getId();
        continue;
      }
      updateJobQueue(context,notification);
      lastFetchedMessageId=message.getId();
    }
    if (lastFetchedMessageId != null) {
      jobQueue.persistSubscriberState(topic,lastFetchedMessageId);
    }
    return lastFetchedMessageId;
  }
 }