nus-yam/ex-repair huggingface dataset:
Program: 6701
Project: 6701
Buggy source:
@DELETE @Path("String_Node_Str") public void deleteArtifact(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String artifactName,@PathParam("String_Node_Str") String artifactVersion) throws NamespaceNotFoundException, BadRequestException {
  Id.Namespace namespace=validateAndGetNamespace(namespaceId);
  Id.Artifact artifactId=validateAndGetArtifactId(namespace,artifactName,artifactVersion);
  try {
    artifactRepository.deleteArtifact(artifactId);
    responder.sendStatus(HttpResponseStatus.OK);
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str",artifactName,namespaceId,e);
    responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,"String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
@DELETE @Path("String_Node_Str") public void deleteArtifact(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String artifactName,@PathParam("String_Node_Str") String artifactVersion) throws NamespaceNotFoundException, BadRequestException {
  Id.Namespace namespace=Id.Namespace.SYSTEM.getId().equalsIgnoreCase(namespaceId) ? Id.Namespace.SYSTEM : validateAndGetNamespace(namespaceId);
  Id.Artifact artifactId=validateAndGetArtifactId(namespace,artifactName,artifactVersion);
  try {
    artifactRepository.deleteArtifact(artifactId);
    responder.sendStatus(HttpResponseStatus.OK);
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str",artifactName,namespaceId,e);
    responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,"String_Node_Str" + e.getMessage());
  }
}
Program: 6702
Project: 6702
Buggy source:
/** 
 * Write key and value to the hadoop context.
 * @param key         the key
 * @param value       the value
 */
void write(KEYOUT key,VALUEOUT value) throws IOException, InterruptedException ;

Fixed version (ground truth):
/** 
 * Write key and value to the hadoop context. This method must only be used in the MapReduce writes to a single output. If there is more than one outputs,   {@link #write(String,Object,Object)} must be used.
 * @param key         the key
 * @param value       the value
 */
void write(KEYOUT key,VALUEOUT value) throws IOException, InterruptedException ;
Program: 6703
Project: 6703
Buggy source:
private WrappedSink(String sinkPluginId,BatchSink<IN,KEY_OUT,VAL_OUT> sink,Set<String> outputNames,MapReduceTaskContext context,Metrics metrics){
  this.sink=sink;
  this.emitter=new DefaultEmitter<>(new StageMetrics(metrics,PluginID.from(sinkPluginId)));
  this.outputNames=outputNames;
  this.context=context;
}

Fixed version (ground truth):
protected WrappedSink(String sinkPluginId,BatchSink<IN,KEY_OUT,VAL_OUT> sink,MapReduceTaskContext<KEY_OUT,VAL_OUT> context,Metrics metrics){
  this.sink=sink;
  this.emitter=new DefaultEmitter<>(new StageMetrics(metrics,PluginID.from(sinkPluginId)));
  this.context=context;
}
Program: 6705
Project: 6705
Buggy source:
private void write(IN input) throws Exception {
  sink.transform(input,emitter);
  for (  KeyValue outputRecord : emitter) {
    for (    String outputName : outputNames) {
      context.write(outputName,outputRecord.getKey(),outputRecord.getValue());
    }
  }
  emitter.reset();
}

Fixed version (ground truth):
public void write(IN input) throws Exception {
  sink.transform(input,emitter);
  for (  KeyValue outputRecord : emitter) {
    for (    String outputName : outputNames) {
      context.write(outputName,outputRecord.getKey(),outputRecord.getValue());
    }
  }
  emitter.reset();
}
Program: 6706
Project: 6706
Buggy source:
@Override public boolean apply(@Nullable RunRecordMeta input){
  if (input == null) {
    return false;
  }
  String runId=input.getPid();
  Id.Program targetProgramId=retrieveProgramIdForRunRecord(programType,runId);
  return (targetProgramId != null) && !runIdToRuntimeInfo.containsKey(RunIds.fromString(runId));
}

Fixed version (ground truth):
@Override public boolean apply(RunRecordMeta input){
  String runId=input.getPid();
  Id.Program targetProgramId=retrieveProgramIdForRunRecord(programType,runId);
  if (targetProgramId != null) {
    runIdToProgramId.put(runId,targetProgramId);
    return true;
  }
 else {
    return false;
  }
}
Program: 6707
Project: 6707
Buggy source:
@Override public void run(){
  try {
    RunRecordsCorrectorRunnable.LOG.debug("String_Node_Str");
    programLifecycleService.validateAndCorrectRunningRunRecords();
    RunRecordsCorrectorRunnable.LOG.debug("String_Node_Str");
  }
 catch (  Throwable t) {
    LOG.debug("String_Node_Str",t);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    RunRecordsCorrectorRunnable.LOG.debug("String_Node_Str");
    programLifecycleService.validateAndCorrectRunningRunRecords();
    RunRecordsCorrectorRunnable.LOG.debug("String_Node_Str");
  }
 catch (  Throwable t) {
    LOG.warn("String_Node_Str",Throwables.getRootCause(t).getMessage());
    LOG.debug("String_Node_Str",t);
  }
}
Program: 6709
Project: 6709
Buggy source:
@Override public void run(){
  LOG.info("String_Node_Str");
  Futures.getUnchecked(Services.chainStart(zkClientService,kafkaClientService,metricsCollectionService,streamCoordinatorClient,resourceReporter));
  LOG.info("String_Node_Str",name);
  controller=injector.getInstance(getProgramClass()).run(program,programOpts);
  final SettableFuture<ProgramController.State> state=SettableFuture.create();
  controller.addListener(new AbstractListener(){
    @Override public void alive(){
      runlatch.countDown();
    }
    @Override public void init(    ProgramController.State currentState,    @Nullable Throwable cause){
      if (currentState == ProgramController.State.ALIVE) {
        alive();
      }
 else {
        super.init(currentState,cause);
      }
    }
    @Override public void completed(){
      state.set(ProgramController.State.COMPLETED);
    }
    @Override public void killed(){
      state.set(ProgramController.State.KILLED);
    }
    @Override public void error(    Throwable cause){
      LOG.error("String_Node_Str",cause);
      state.setException(cause);
    }
  }
,MoreExecutors.sameThreadExecutor());
  try {
    state.get();
    LOG.info("String_Node_Str");
  }
 catch (  InterruptedException e) {
    LOG.warn("String_Node_Str",e);
  }
catch (  ExecutionException e) {
    LOG.error("String_Node_Str",e);
    if (propagateServiceError()) {
      throw Throwables.propagate(Throwables.getRootCause(e));
    }
  }
 finally {
    runlatch.countDown();
  }
}

Fixed version (ground truth):
@Override public void run(){
  LOG.info("String_Node_Str");
  Futures.getUnchecked(Services.chainStart(zkClientService,kafkaClientService,metricsCollectionService,streamCoordinatorClient,resourceReporter));
  LOG.info("String_Node_Str",name);
  controller=injector.getInstance(getProgramClass()).run(program,programOpts);
  final SettableFuture<ProgramController.State> state=SettableFuture.create();
  controller.addListener(new AbstractListener(){
    @Override public void alive(){
      runlatch.countDown();
    }
    @Override public void init(    ProgramController.State currentState,    @Nullable Throwable cause){
      if (currentState == ProgramController.State.ALIVE) {
        alive();
      }
 else {
        super.init(currentState,cause);
      }
    }
    @Override public void completed(){
      state.set(ProgramController.State.COMPLETED);
    }
    @Override public void killed(){
      state.set(ProgramController.State.KILLED);
    }
    @Override public void error(    Throwable cause){
      LOG.error("String_Node_Str",cause);
      state.setException(cause);
    }
  }
,MoreExecutors.sameThreadExecutor());
  try {
    state.get();
    LOG.info("String_Node_Str",name);
  }
 catch (  InterruptedException e) {
    LOG.warn("String_Node_Str",name,e);
    Thread.currentThread().interrupt();
  }
catch (  ExecutionException e) {
    LOG.error("String_Node_Str",name,e);
    if (propagateServiceError()) {
      throw Throwables.propagate(Throwables.getRootCause(e));
    }
  }
 finally {
    runlatch.countDown();
  }
}
Program: 6710
Project: 6710
Buggy source:
@Override public void stop(){
  try {
    LOG.info("String_Node_Str",name);
    controller.stop().get();
    logAppenderInitializer.close();
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e,e);
    throw Throwables.propagate(e);
  }
}

Fixed version (ground truth):
@Override public void stop(){
  try {
    LOG.info("String_Node_Str",name);
    controller.stop().get();
    logAppenderInitializer.close();
  }
 catch (  InterruptedException e) {
    LOG.debug("String_Node_Str",name,e);
    Thread.currentThread().interrupt();
  }
catch (  Exception e) {
    LOG.error("String_Node_Str",name,e);
    throw Throwables.propagate(e);
  }
}
Program: 6711
Project: 6711
Buggy source:
@Override public void stop(){
  if (!stopped.compareAndSet(false,true)) {
    return;
  }
  scheduledExecutor.shutdownNow();
  close();
  super.stop();
}

Fixed version (ground truth):
@Override public void stop(){
  if (!stopped.compareAndSet(false,true)) {
    return;
  }
  scheduledExecutor.shutdownNow();
  try {
    scheduledExecutor.awaitTermination(5,TimeUnit.MINUTES);
  }
 catch (  InterruptedException e) {
    LOG.debug("String_Node_Str");
    Thread.currentThread().interrupt();
  }
  close();
  super.stop();
}
Program: 6713
Project: 6713
Buggy source:
@Nullable private PluginInstantiator getArtifactPluginInstantiator(CConfiguration cConf){
  ClassLoader classLoader=Delegators.getDelegate(cConf.getClassLoader(),MapReduceClassLoader.class);
  if (!(classLoader instanceof MapReduceClassLoader)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  return ((MapReduceClassLoader)classLoader).getArtifactPluginInstantiator();
}

Fixed version (ground truth):
@Nullable private PluginInstantiator getArtifactPluginInstantiator(Configuration hConf){
  ClassLoader classLoader=Delegators.getDelegate(hConf.getClassLoader(),MapReduceClassLoader.class);
  if (!(classLoader instanceof MapReduceClassLoader)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  return ((MapReduceClassLoader)classLoader).getArtifactPluginInstantiator();
}
Program: 6714
Project: 6714
Buggy source:
@Nullable private PluginInstantiator getPluginInstantiator(CConfiguration cConf){
  if (contextConfig.getAdapterSpec() == null) {
    return null;
  }
  ClassLoader classLoader=Delegators.getDelegate(cConf.getClassLoader(),MapReduceClassLoader.class);
  if (!(classLoader instanceof MapReduceClassLoader)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  return ((MapReduceClassLoader)classLoader).getPluginInstantiator();
}

Fixed version (ground truth):
@Nullable private PluginInstantiator getPluginInstantiator(Configuration hConf){
  if (contextConfig.getAdapterSpec() == null) {
    return null;
  }
  ClassLoader classLoader=Delegators.getDelegate(hConf.getClassLoader(),MapReduceClassLoader.class);
  if (!(classLoader instanceof MapReduceClassLoader)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  return ((MapReduceClassLoader)classLoader).getPluginInstantiator();
}
Program: 6715
Project: 6715
Buggy source:
/** 
 * Creates an instance of   {@link BasicMapReduceContext} that the {@link co.cask.cdap.app.program.Program} containedinside cannot load program classes. It is used for the cases where only the application specification is needed, but no need to load any class from it.
 */
public synchronized BasicMapReduceContext get(){
  if (context == null) {
    CConfiguration cConf=contextConfig.getConf();
    context=getBuilder(cConf).build(type,contextConfig.getRunId(),taskContext.getTaskAttemptID().getTaskID().toString(),contextConfig.getLogicalStartTime(),contextConfig.getProgramNameInWorkflow(),contextConfig.getWorkflowToken(),contextConfig.getArguments(),contextConfig.getTx(),createProgram(contextConfig),artifactLocationFactory,contextConfig.getInputDataSet(),contextConfig.getInputSelection(),contextConfig.getOutputDataSet(),contextConfig.getAdapterSpec(),getPluginInstantiator(cConf),getArtifactPluginInstantiator(cConf));
  }
  return context;
}

Fixed version (ground truth):
/** 
 * Creates an instance of   {@link BasicMapReduceContext} that the {@link co.cask.cdap.app.program.Program} containedinside cannot load program classes. It is used for the cases where only the application specification is needed, but no need to load any class from it.
 */
public synchronized BasicMapReduceContext get(){
  if (context == null) {
    CConfiguration cConf=contextConfig.getConf();
    context=getBuilder(cConf).build(type,contextConfig.getRunId(),taskContext.getTaskAttemptID().getTaskID().toString(),contextConfig.getLogicalStartTime(),contextConfig.getProgramNameInWorkflow(),contextConfig.getWorkflowToken(),contextConfig.getArguments(),contextConfig.getTx(),createProgram(contextConfig),artifactLocationFactory,contextConfig.getInputDataSet(),contextConfig.getInputSelection(),contextConfig.getOutputDataSet(),contextConfig.getAdapterSpec(),getPluginInstantiator(contextConfig.getConfiguration()),getArtifactPluginInstantiator(contextConfig.getConfiguration()));
  }
  return context;
}
Program: 6717
Project: 6717
Buggy source:
@Nullable private PluginInstantiator createArtifactPluginInstantiator(ClassLoader programClassLoader){
  return new PluginInstantiator(cConf,programClassLoader);
}

Fixed version (ground truth):
private PluginInstantiator createArtifactPluginInstantiator(ClassLoader programClassLoader){
  return new PluginInstantiator(cConf,programClassLoader);
}
Program: 6718
Project: 6718
Buggy source:
@Override public void terminated(Service.State from){
  if (pluginInstantiator != null) {
    Closeables.closeQuietly(pluginInstantiator);
  }
  if (from == Service.State.STOPPING) {
    store.setStop(program.getId(),runId.getId(),TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis()),ProgramController.State.KILLED.getRunStatus());
  }
 else {
    store.setStop(program.getId(),runId.getId(),TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis()),ProgramController.State.COMPLETED.getRunStatus());
  }
}

Fixed version (ground truth):
@Override public void terminated(Service.State from){
  Closeables.closeQuietly(artifactPluginInstantiator);
  if (pluginInstantiator != null) {
    Closeables.closeQuietly(pluginInstantiator);
  }
  if (from == Service.State.STOPPING) {
    store.setStop(program.getId(),runId.getId(),TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis()),ProgramController.State.KILLED.getRunStatus());
  }
 else {
    store.setStop(program.getId(),runId.getId(),TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis()),ProgramController.State.COMPLETED.getRunStatus());
  }
}
Program: 6719
Project: 6719
Buggy source:
public void deployApplication(Id.Application appId,CreateAppRequest createAppRequest) throws Exception {
  DefaultHttpRequest request=new DefaultHttpRequest(HttpVersion.HTTP_1_1,HttpMethod.PUT,String.format("String_Node_Str",appId.getNamespaceId(),appId.getId()));
  request.setHeader(Constants.Gateway.API_KEY,"String_Node_Str");
  MockResponder mockResponder=new MockResponder();
  BodyConsumer bodyConsumer=appLifecycleHttpHandler.deploy(request,mockResponder,appId.getNamespaceId(),appId.getId(),createAppRequest.getArtifact().getName(),GSON.toJson(createAppRequest.getConfig()),MediaType.APPLICATION_JSON);
  Preconditions.checkNotNull(bodyConsumer,"String_Node_Str");
  bodyConsumer.chunk(ChannelBuffers.wrappedBuffer(Bytes.toBytes(GSON.toJson(createAppRequest))),mockResponder);
  bodyConsumer.finished(mockResponder);
}

Fixed version (ground truth):
public void deployApplication(Id.Application appId,AppRequest appRequest) throws Exception {
  DefaultHttpRequest request=new DefaultHttpRequest(HttpVersion.HTTP_1_1,HttpMethod.PUT,String.format("String_Node_Str",appId.getNamespaceId(),appId.getId()));
  request.setHeader(Constants.Gateway.API_KEY,"String_Node_Str");
  MockResponder mockResponder=new MockResponder();
  BodyConsumer bodyConsumer=appLifecycleHttpHandler.deploy(request,mockResponder,appId.getNamespaceId(),appId.getId(),appRequest.getArtifact().getName(),GSON.toJson(appRequest.getConfig()),MediaType.APPLICATION_JSON);
  Preconditions.checkNotNull(bodyConsumer,"String_Node_Str");
  bodyConsumer.chunk(ChannelBuffers.wrappedBuffer(Bytes.toBytes(GSON.toJson(appRequest))),mockResponder);
  bodyConsumer.finished(mockResponder);
}
Program: 6720
Project: 6720
Buggy source:
@Override public ApplicationManager deployApplication(Id.Application appId,CreateAppRequest createAppRequest) throws Exception {
  applicationClient.deploy(appId,createAppRequest);
  return new RemoteApplicationManager(appId,clientConfig,restClient);
}

Fixed version (ground truth):
@Override public ApplicationManager deployApplication(Id.Application appId,AppRequest appRequest) throws Exception {
  applicationClient.deploy(appId,appRequest);
  return new RemoteApplicationManager(appId,clientConfig,restClient);
}
Program: 6721
Project: 6721
Buggy source:
/** 
 * Deploys an   {@link Application}.
 * @param appId the id of the application to create
 * @param createAppRequest the app creation request that includes the artifact to create the app from and any configto pass to the application.
 * @return An {@link ApplicationManager} to manage the deployed application.
 */
ApplicationManager deployApplication(Id.Application appId,CreateAppRequest createAppRequest) throws Exception ;

Fixed version (ground truth):
/** 
 * Deploys an   {@link Application}.
 * @param appId the id of the application to create
 * @param appRequest the app create or update request that includes the artifact to create the app from and any configto pass to the application.
 * @return An {@link ApplicationManager} to manage the deployed application.
 */
ApplicationManager deployApplication(Id.Application appId,AppRequest appRequest) throws Exception ;
Program: 6722
Project: 6722
Buggy source:
/** 
 * Deploys an   {@link Application}. The application artifact must already exist.
 * @param appId the id of the application to create
 * @param createAppRequest the application create request
 * @return An {@link ApplicationManager} to manage the deployed application
 */
protected static ApplicationManager deployApplication(Id.Application appId,CreateAppRequest createAppRequest) throws Exception {
  return getTestManager().deployApplication(appId,createAppRequest);
}

Fixed version (ground truth):
/** 
 * Deploys an   {@link Application}. The application artifact must already exist.
 * @param appId the id of the application to create
 * @param appRequest the application create or update request
 * @return An {@link ApplicationManager} to manage the deployed application
 */
protected static ApplicationManager deployApplication(Id.Application appId,AppRequest appRequest) throws Exception {
  return getTestManager().deployApplication(appId,appRequest);
}
Program: 6723
Project: 6723
Buggy source:
@Override public ApplicationManager deployApplication(Id.Application appId,CreateAppRequest createAppRequest) throws Exception {
  appFabricClient.deployApplication(appId,createAppRequest);
  ArtifactSummary requestedArtifact=createAppRequest.getArtifact();
  Id.Artifact artifactId=Id.Artifact.from(requestedArtifact.isSystem() ? Id.Namespace.SYSTEM : appId.getNamespace(),requestedArtifact.getName(),requestedArtifact.getVersion());
  ArtifactDetail artifactDetail=artifactRepository.getArtifact(artifactId);
  return appManagerFactory.create(appId,artifactDetail.getDescriptor().getLocation());
}

Fixed version (ground truth):
@Override public ApplicationManager deployApplication(Id.Application appId,AppRequest appRequest) throws Exception {
  appFabricClient.deployApplication(appId,appRequest);
  ArtifactSummary requestedArtifact=appRequest.getArtifact();
  Id.Artifact artifactId=Id.Artifact.from(requestedArtifact.isSystem() ? Id.Namespace.SYSTEM : appId.getNamespace(),requestedArtifact.getName(),requestedArtifact.getVersion());
  ArtifactDetail artifactDetail=artifactRepository.getArtifact(artifactId);
  return appManagerFactory.create(appId,artifactDetail.getDescriptor().getLocation());
}
Program: 6725
Project: 6725
Buggy source:
@Test public void testAppFromArtifact() throws Exception {
  Id.Artifact artifactId=Id.Artifact.from(Id.Namespace.DEFAULT,"String_Node_Str","String_Node_Str");
  addAppArtifact(artifactId,ConfigTestApp.class);
  Id.Application appId=Id.Application.from(Id.Namespace.DEFAULT,"String_Node_Str");
  CreateAppRequest<ConfigTestApp.ConfigClass> createRequest=new CreateAppRequest<>(new ArtifactSummary(artifactId.getName(),artifactId.getVersion().getVersion(),false),new ConfigTestApp.ConfigClass("String_Node_Str","String_Node_Str"));
  ApplicationManager appManager=deployApplication(appId,createRequest);
  testAppConfig(appManager,createRequest.getConfig());
}

Fixed version (ground truth):
@Test public void testAppFromArtifact() throws Exception {
  Id.Artifact artifactId=Id.Artifact.from(Id.Namespace.DEFAULT,"String_Node_Str","String_Node_Str");
  addAppArtifact(artifactId,ConfigTestApp.class);
  Id.Application appId=Id.Application.from(Id.Namespace.DEFAULT,"String_Node_Str");
  AppRequest<ConfigTestApp.ConfigClass> createRequest=new AppRequest<>(new ArtifactSummary(artifactId.getName(),artifactId.getVersion().getVersion(),false),new ConfigTestApp.ConfigClass("String_Node_Str","String_Node_Str"));
  ApplicationManager appManager=deployApplication(appId,createRequest);
  testAppConfig(appManager,createRequest.getConfig());
}
Program: 6726
Project: 6726
Buggy source:
@Override public boolean apply(@Nullable RunRecordMeta input){
  if (input == null) {
    return false;
  }
  String runId=input.getPid();
  return !runIdToRuntimeInfo.containsKey(RunIds.fromString(runId));
}

Fixed version (ground truth):
@Override public boolean apply(@Nullable RunRecordMeta input){
  if (input == null) {
    return false;
  }
  String runId=input.getPid();
  Id.Program targetProgramId=retrieveProgramIdForRunRecord(programType,runId);
  return (targetProgramId != null) && !runIdToRuntimeInfo.containsKey(RunIds.fromString(runId));
}
Program: 6728
Project: 6728
Buggy source:
/** 
 * Resolves a bash-style file path into a   {@link File}. Handles ".", "..", and "~".
 * @param path bash-style path
 * @return {@link File} of the resolved path
 */
public File resolvePathToFile(String path){
  path=resolveVariables(path);
  if (path.contains("String_Node_Str") || path.contains("String_Node_Str")) {
    path=path.replace("String_Node_Str",File.separator);
    path=path.replace("String_Node_Str",File.separator);
  }
  if (path.startsWith("String_Node_Str" + File.separator)) {
    path=new File(homeDir,path.substring(2)).getAbsolutePath();
  }
  if (!new File(path).isAbsolute()) {
    path=new File(workingDir,path).getAbsolutePath();
  }
  String[] tokens=path.split(File.separator);
  LinkedList<String> finalTokens=new LinkedList<>();
  for (  String token : tokens) {
    if (token.equals("String_Node_Str")) {
      if (!finalTokens.isEmpty()) {
        finalTokens.removeLast();
      }
    }
 else     if (!token.equals("String_Node_Str")) {
      finalTokens.addLast(token);
    }
  }
  return new File(File.separator + Joiner.on(File.separator).join(finalTokens));
}

Fixed version (ground truth):
/** 
 * Resolves a bash-style file path into a   {@link File}. Handles ".", "..", and "~".
 * @param path bash-style path
 * @return {@link File} of the resolved path
 */
public File resolvePathToFile(String path){
  path=resolveVariables(path);
  if (path.contains("String_Node_Str") || path.contains("String_Node_Str")) {
    path=path.replace("String_Node_Str",File.separator);
    path=path.replace("String_Node_Str",File.separator);
  }
  if (path.startsWith("String_Node_Str" + File.separator)) {
    path=new File(homeDir,path.substring(2)).getAbsolutePath();
  }
  if (!new File(path).isAbsolute()) {
    path=new File(workingDir,path).getAbsolutePath();
  }
  String[] tokens=path.split(Pattern.quote(File.separator));
  LinkedList<String> finalTokens=new LinkedList<>();
  for (  String token : tokens) {
    if (token.equals("String_Node_Str")) {
      if (!finalTokens.isEmpty()) {
        finalTokens.removeLast();
      }
    }
 else     if (!token.equals("String_Node_Str")) {
      finalTokens.addLast(token);
    }
  }
  return new File(File.separator + Joiner.on(File.separator).join(finalTokens));
}
Program: 6729
Project: 6729
Buggy source:
@Override public void initialize(RealtimeContext context) throws Exception {
  super.initialize(context);
  String kafkaZKConnect=getKafkaConfig().getZookeeper();
  if (kafkaZKConnect != null) {
    zkClient=ZKClientServices.delegate(ZKClients.reWatchOnExpire(ZKClients.retryOnFailure(ZKClientService.Builder.of(kafkaZKConnect).build(),RetryStrategies.fixDelay(2,TimeUnit.SECONDS))));
    zkClient.startAndWait();
    brokerService=createBrokerService(zkClient);
    brokerService.startAndWait();
  }
  kafkaConsumers=CacheBuilder.newBuilder().concurrencyLevel(1).expireAfterAccess(60,TimeUnit.SECONDS).removalListener(consumerCacheRemovalListener()).build();
}

Fixed version (ground truth):
@Override public void initialize(RealtimeContext context) throws Exception {
  super.initialize(context);
  String kafkaZKConnect=getKafkaConfig().getZookeeper();
  if (kafkaZKConnect != null) {
    zkClient=ZKClientServices.delegate(ZKClients.reWatchOnExpire(ZKClients.retryOnFailure(ZKClientService.Builder.of(kafkaZKConnect).build(),RetryStrategies.fixDelay(2,TimeUnit.SECONDS))));
    zkClient.startAndWait();
    brokerService=new ZKBrokerService(zkClient);
    brokerService.startAndWait();
  }
  kafkaConsumers=CacheBuilder.newBuilder().concurrencyLevel(1).expireAfterAccess(60,TimeUnit.SECONDS).removalListener(consumerCacheRemovalListener()).build();
}
Program: 6730
Project: 6730
Buggy source:
/** 
 * Sends an event to a stream. The writes is asynchronous, meaning when this method returns, it only guarantees the event has been received by the server, but may not get persisted.
 * @param stream ID of the stream
 * @param event event to send to the stream
 * @throws IOException if a network error occurred
 * @throws StreamNotFoundException if the stream with the specified ID was not found
 */
public void asyncSendEvent(Id.Stream stream,String event) throws IOException, StreamNotFoundException, UnauthorizedException {
  URL url=config.resolveNamespacedURLV3(stream.getNamespace(),String.format("String_Node_Str",stream.getId()));
  writeEvent(url,stream,event);
}

Fixed version (ground truth):
/** 
 * Sends an event to a stream. The write is asynchronous, meaning when this method returns, it only guarantees the event has been received by the server, but may not get persisted.
 * @param stream ID of the stream
 * @param event event to send to the stream
 * @throws IOException if a network error occurred
 * @throws StreamNotFoundException if the stream with the specified ID was not found
 */
public void asyncSendEvent(Id.Stream stream,String event) throws IOException, StreamNotFoundException, UnauthorizedException {
  URL url=config.resolveNamespacedURLV3(stream.getNamespace(),String.format("String_Node_Str",stream.getId()));
  writeEvent(url,stream,event);
}
Program: 6731
Project: 6731
Buggy source:
@ProcessInput public void receive(StreamEvent data){
  table.increment(Bytes.toBytes(KEY),1L);
}

Fixed version (ground truth):
@ProcessInput public void receive(StreamEvent data){
  table.increment(Bytes.toBytes(KEY),1L);
  for (  Map.Entry<String,String> header : data.getHeaders().entrySet()) {
    headers.write(header.getKey(),header.getValue());
  }
}
Program: 6734
Project: 6734
Buggy source:
private void addTransforms(List<ETLStage> stageConfigs,List<Transformation> pipeline,List<StageMetrics> stageMetrics,List<String> transformIds,MapReduceContext context) throws Exception {
  Preconditions.checkArgument(stageConfigs.size() == transformIds.size());
  for (int i=0; i < stageConfigs.size(); i++) {
    ETLStage stageConfig=stageConfigs.get(i);
    String transformId=transformIds.get(i);
    Transform transform=context.newPluginInstance(transformId);
    BatchTransformContext transformContext=new BatchTransformContext(context,mapperMetrics,transformId);
    LOG.debug("String_Node_Str",stageConfig.getName());
    LOG.debug("String_Node_Str",transform.getClass().getName());
    transform.initialize(transformContext);
    pipeline.add(transform);
    transforms.add(transform);
    stageMetrics.add(new StageMetrics(mapperMetrics,StageMetrics.Type.TRANSFORM,stageConfig.getName()));
  }
}

Fixed version (ground truth):
private void addTransforms(List<ETLStage> stageConfigs,List<Transformation> pipeline,List<StageMetrics> stageMetrics,List<String> transformIds,MapReduceContext context) throws Exception {
  Preconditions.checkArgument(stageConfigs.size() == transformIds.size());
  for (int i=0; i < stageConfigs.size(); i++) {
    ETLStage stageConfig=stageConfigs.get(i);
    String transformId=transformIds.get(i);
    Transform transform=context.newPluginInstance(transformId);
    BatchTransformContext transformContext=new BatchTransformContext(context,mapperMetrics,transformId);
    LOG.debug("String_Node_Str",stageConfig.getName());
    LOG.debug("String_Node_Str",transform.getClass().getName());
    transform.initialize(transformContext);
    pipeline.add(transform);
    transforms.add(transform);
    stageMetrics.add(new StageMetrics(mapperMetrics,PluginID.from(transformId)));
  }
}
Program: 6735
Project: 6735
Buggy source:
@Override public void initialize(MapReduceContext context) throws Exception {
  Map<String,String> runtimeArgs=context.getRuntimeArguments();
  ETLBatchConfig etlConfig=GSON.fromJson(runtimeArgs.get(Constants.CONFIG_KEY),ETLBatchConfig.class);
  String sourcePluginId=runtimeArgs.get(Constants.Source.PLUGINID);
  String sinkPluginId=runtimeArgs.get(Constants.Sink.PLUGINID);
  List<String> transformIds=GSON.fromJson(runtimeArgs.get(Constants.Transform.PLUGINIDS),STRING_LIST_TYPE);
  List<ETLStage> stageList=etlConfig.getTransforms();
  List<Transformation> pipeline=Lists.newArrayListWithCapacity(stageList.size() + 2);
  List<StageMetrics> stageMetrics=Lists.newArrayListWithCapacity(stageList.size() + 2);
  transforms=Lists.newArrayListWithCapacity(stageList.size());
  BatchSource source=context.newPluginInstance(sourcePluginId);
  BatchSourceContext batchSourceContext=new MapReduceSourceContext(context,mapperMetrics,sourcePluginId);
  source.initialize(batchSourceContext);
  pipeline.add(source);
  stageMetrics.add(new StageMetrics(mapperMetrics,StageMetrics.Type.SOURCE,etlConfig.getSource().getName()));
  addTransforms(stageList,pipeline,stageMetrics,transformIds,context);
  BatchSink sink=context.newPluginInstance(sinkPluginId);
  BatchSinkContext batchSinkContext=new MapReduceSinkContext(context,mapperMetrics,sinkPluginId);
  sink.initialize(batchSinkContext);
  pipeline.add(sink);
  stageMetrics.add(new StageMetrics(mapperMetrics,StageMetrics.Type.SINK,etlConfig.getSink().getName()));
  transformExecutor=new TransformExecutor<>(pipeline,stageMetrics);
}

Fixed version (ground truth):
@Override public void initialize(MapReduceContext context) throws Exception {
  Map<String,String> runtimeArgs=context.getRuntimeArguments();
  ETLBatchConfig etlConfig=GSON.fromJson(runtimeArgs.get(Constants.CONFIG_KEY),ETLBatchConfig.class);
  String sourcePluginId=runtimeArgs.get(Constants.Source.PLUGINID);
  String sinkPluginId=runtimeArgs.get(Constants.Sink.PLUGINID);
  List<String> transformIds=GSON.fromJson(runtimeArgs.get(Constants.Transform.PLUGINIDS),STRING_LIST_TYPE);
  List<ETLStage> stageList=etlConfig.getTransforms();
  List<Transformation> pipeline=Lists.newArrayListWithCapacity(stageList.size() + 2);
  List<StageMetrics> stageMetrics=Lists.newArrayListWithCapacity(stageList.size() + 2);
  transforms=Lists.newArrayListWithCapacity(stageList.size());
  BatchSource source=context.newPluginInstance(sourcePluginId);
  BatchSourceContext batchSourceContext=new MapReduceSourceContext(context,mapperMetrics,sourcePluginId);
  source.initialize(batchSourceContext);
  pipeline.add(source);
  stageMetrics.add(new StageMetrics(mapperMetrics,PluginID.from(sourcePluginId)));
  addTransforms(stageList,pipeline,stageMetrics,transformIds,context);
  BatchSink sink=context.newPluginInstance(sinkPluginId);
  BatchSinkContext batchSinkContext=new MapReduceSinkContext(context,mapperMetrics,sinkPluginId);
  sink.initialize(batchSinkContext);
  pipeline.add(sink);
  stageMetrics.add(new StageMetrics(mapperMetrics,PluginID.from(sinkPluginId)));
  transformExecutor=new TransformExecutor<>(pipeline,stageMetrics);
}
Program: 6737
Project: 6737
Buggy source:
public StageMetrics(Metrics metrics,Type stageType,String name){
  this.metrics=metrics;
  this.prefix=stageType.toString() + "String_Node_Str" + name+ "String_Node_Str";
}

Fixed version (ground truth):
public StageMetrics(Metrics metrics,PluginID id){
  this.metrics=metrics;
  this.prefix=id.getMetricsContext() + "String_Node_Str";
}
Program: 6739
Project: 6739
Buggy source:
@SuppressWarnings("String_Node_Str") private void initializeSink(WorkerContext context,ETLStage stage) throws Exception {
  String sinkPluginId=context.getRuntimeArguments().get(Constants.Sink.PLUGINID);
  sink=context.newPluginInstance(sinkPluginId);
  RealtimeContext sinkContext=new WorkerRealtimeContext(context,metrics,sinkPluginId);
  LOG.debug("String_Node_Str",stage.getName());
  LOG.debug("String_Node_Str",sink.getClass().getName());
  sink.initialize(sinkContext);
  sink=new TrackedRealtimeSink(sink,metrics,stage.getName());
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void initializeSink(WorkerContext context,ETLStage stage) throws Exception {
  String sinkPluginId=context.getRuntimeArguments().get(Constants.Sink.PLUGINID);
  sink=context.newPluginInstance(sinkPluginId);
  RealtimeContext sinkContext=new WorkerRealtimeContext(context,metrics,sinkPluginId);
  LOG.debug("String_Node_Str",stage.getName());
  LOG.debug("String_Node_Str",sink.getClass().getName());
  sink.initialize(sinkContext);
  sink=new TrackedRealtimeSink(sink,metrics,PluginID.from(sinkPluginId));
}
Program: 6740
Project: 6740
Buggy source:
private void initializeSource(WorkerContext context,ETLStage stage) throws Exception {
  String sourcePluginId=context.getRuntimeArguments().get(Constants.Source.PLUGINID);
  source=context.newPluginInstance(sourcePluginId);
  RealtimeContext sourceContext=new WorkerRealtimeContext(context,metrics,sourcePluginId);
  LOG.debug("String_Node_Str",stage.getName());
  LOG.debug("String_Node_Str",source.getClass().getName());
  source.initialize(sourceContext);
  sourceEmitter=new DefaultEmitter(new StageMetrics(metrics,StageMetrics.Type.SOURCE,stage.getName()));
}

Fixed version (ground truth):
private void initializeSource(WorkerContext context,ETLStage stage) throws Exception {
  String sourcePluginId=context.getRuntimeArguments().get(Constants.Source.PLUGINID);
  source=context.newPluginInstance(sourcePluginId);
  RealtimeContext sourceContext=new WorkerRealtimeContext(context,metrics,sourcePluginId);
  LOG.debug("String_Node_Str",stage.getName());
  LOG.debug("String_Node_Str",source.getClass().getName());
  source.initialize(sourceContext);
  sourceEmitter=new DefaultEmitter(new StageMetrics(metrics,PluginID.from(sourcePluginId)));
}
Program: 6741
Project: 6741
Buggy source:
private List<Transformation> initializeTransforms(WorkerContext context,List<ETLStage> stages) throws Exception {
  List<String> transformIds=GSON.fromJson(context.getRuntimeArguments().get(Constants.Transform.PLUGINIDS),STRING_LIST_TYPE);
  List<Transformation> transforms=Lists.newArrayList();
  Preconditions.checkArgument(transformIds != null);
  Preconditions.checkArgument(stages.size() == transformIds.size());
  transformMetrics=Lists.newArrayListWithCapacity(stages.size());
  for (int i=0; i < stages.size(); i++) {
    ETLStage stage=stages.get(i);
    String transformId=transformIds.get(i);
    try {
      Transform transform=context.newPluginInstance(transformId);
      RealtimeTransformContext transformContext=new RealtimeTransformContext(context,metrics,transformId);
      LOG.debug("String_Node_Str",stage.getName());
      LOG.debug("String_Node_Str",transform.getClass().getName());
      transform.initialize(transformContext);
      transforms.add(transform);
      transformMetrics.add(new StageMetrics(metrics,StageMetrics.Type.TRANSFORM,stage.getName()));
    }
 catch (    InstantiationException e) {
      LOG.error("String_Node_Str",stage.getName(),e);
      Throwables.propagate(e);
    }
  }
  return transforms;
}

Fixed version (ground truth):
private List<Transformation> initializeTransforms(WorkerContext context,List<ETLStage> stages) throws Exception {
  List<String> transformIds=GSON.fromJson(context.getRuntimeArguments().get(Constants.Transform.PLUGINIDS),STRING_LIST_TYPE);
  List<Transformation> transforms=Lists.newArrayList();
  Preconditions.checkArgument(transformIds != null);
  Preconditions.checkArgument(stages.size() == transformIds.size());
  transformMetrics=Lists.newArrayListWithCapacity(stages.size());
  for (int i=0; i < stages.size(); i++) {
    ETLStage stage=stages.get(i);
    String transformId=transformIds.get(i);
    try {
      Transform transform=context.newPluginInstance(transformId);
      RealtimeTransformContext transformContext=new RealtimeTransformContext(context,metrics,transformId);
      LOG.debug("String_Node_Str",stage.getName());
      LOG.debug("String_Node_Str",transform.getClass().getName());
      transform.initialize(transformContext);
      transforms.add(transform);
      transformMetrics.add(new StageMetrics(metrics,PluginID.from(transformId)));
    }
 catch (    InstantiationException e) {
      LOG.error("String_Node_Str",stage.getName(),e);
      Throwables.propagate(e);
    }
  }
  return transforms;
}
Program: 6742
Project: 6742
Buggy source:
public TrackedRealtimeSink(RealtimeSink<T> sink,Metrics metrics,String name){
  this.sink=sink;
  this.metrics=new StageMetrics(metrics,StageMetrics.Type.SINK,name);
}

Fixed version (ground truth):
public TrackedRealtimeSink(RealtimeSink<T> sink,Metrics metrics,PluginID id){
  this.sink=sink;
  this.metrics=new StageMetrics(metrics,id);
}
Program: 6746
Project: 6746
Buggy source:
@Override protected void startUp() throws Exception {
  LOG.info("String_Node_Str");
  scheduledExecutorService.scheduleWithFixedDelay(new RunRecordsCorrectorRunnable(this),2L,600L,TimeUnit.SECONDS);
}

Fixed version (ground truth):
@Override protected void startUp() throws Exception {
  LOG.info("String_Node_Str");
  long interval=configuration.getLong(Constants.AppFabric.PROGRAM_RUNID_CORRECTOR_INTERVAL_SECONDS);
  if (interval <= 0) {
    LOG.debug("String_Node_Str",interval);
    interval=180L;
  }
  scheduledExecutorService.scheduleWithFixedDelay(new RunRecordsCorrectorRunnable(this),2L,interval,TimeUnit.SECONDS);
}
Program: 6747
Project: 6747
Buggy source:
@Inject public ProgramLifecycleService(Store store,ProgramRuntimeService runtimeService){
  this.store=store;
  this.runtimeService=runtimeService;
  this.scheduledExecutorService=Executors.newScheduledThreadPool(1);
}

Fixed version (ground truth):
@Inject public ProgramLifecycleService(Store store,ProgramRuntimeService runtimeService,CConfiguration configuration){
  this.store=store;
  this.runtimeService=runtimeService;
  this.scheduledExecutorService=Executors.newScheduledThreadPool(1);
  this.configuration=configuration;
}
Program: 6748
Project: 6748
Buggy source:
/** 
 * @return the long value
 */
public long getAsLong(){
  return Long.parseLong(value);
}

Fixed version (ground truth):
/** 
 * @return the result of calling <code>Long.parseLong(toString())</code>
 */
public long getAsLong(){
  return Long.parseLong(value);
}
Program: 6749
Project: 6749
Buggy source:
/** 
 * @return the boolean value
 */
public boolean getAsBoolean(){
  return Boolean.parseBoolean(value);
}

Fixed version (ground truth):
/** 
 * @return the result of calling <code>Boolean.parseBoolean(toString())</code>
 */
public boolean getAsBoolean(){
  return Boolean.parseBoolean(value);
}
Program: 6750
Project: 6750
Buggy source:
/** 
 * @return the int value
 */
public int getAsInt(){
  return Integer.parseInt(value);
}

Fixed version (ground truth):
/** 
 * @return the result of calling <code>Integer.parseInt(toString())</code>
 */
public int getAsInt(){
  return Integer.parseInt(value);
}
Program: 6751
Project: 6751
Buggy source:
private BasicWorkflowToken(BasicWorkflowToken other){
  for (  Map.Entry<Scope,Map<String,List<NodeValue>>> entry : other.tokenValueMap.entrySet()) {
    Map<String,List<NodeValue>> tokenValueMapForScope=new HashMap<>();
    for (    Map.Entry<String,List<NodeValue>> valueEntry : entry.getValue().entrySet()) {
      tokenValueMapForScope.put(valueEntry.getKey(),Lists.newArrayList(valueEntry.getValue()));
    }
    this.tokenValueMap.put(entry.getKey(),tokenValueMapForScope);
  }
  this.nodeName=other.nodeName;
  if (other.mapReduceCounters != null) {
    this.mapReduceCounters=copyHadoopCounters(other.mapReduceCounters);
  }
}

Fixed version (ground truth):
private BasicWorkflowToken(BasicWorkflowToken other){
  for (  Map.Entry<Scope,Map<String,List<NodeValue>>> entry : other.tokenValueMap.entrySet()) {
    Map<String,List<NodeValue>> tokenValueMapForScope=new HashMap<>();
    for (    Map.Entry<String,List<NodeValue>> valueEntry : entry.getValue().entrySet()) {
      tokenValueMapForScope.put(valueEntry.getKey(),Lists.newArrayList(valueEntry.getValue()));
    }
    this.tokenValueMap.put(entry.getKey(),tokenValueMapForScope);
  }
  this.nodeName=other.nodeName;
  if (other.mapReduceCounters != null) {
    this.mapReduceCounters=copyHadoopCounters(other.mapReduceCounters);
  }
  this.maxSizeBytes=other.maxSizeBytes;
  this.bytesLeft=other.bytesLeft;
}
Program: 6752
Project: 6752
Buggy source:
/** 
 * Merge the other WorkflowToken passed to the method as a parameter with the WorkflowToken on which the method is invoked.
 * @param other the other WorkflowToken to be merged
 */
void mergeToken(BasicWorkflowToken other){
  for (  Map.Entry<Scope,Map<String,List<NodeValue>>> entry : other.tokenValueMap.entrySet()) {
    Map<String,List<NodeValue>> thisTokenValueMapForScope=this.tokenValueMap.get(entry.getKey());
    for (    Map.Entry<String,List<NodeValue>> otherTokenValueMapForScopeEntry : entry.getValue().entrySet()) {
      if (!thisTokenValueMapForScope.containsKey(otherTokenValueMapForScopeEntry.getKey())) {
        thisTokenValueMapForScope.put(otherTokenValueMapForScopeEntry.getKey(),Lists.<NodeValue>newArrayList());
      }
      for (      NodeValue otherNodeValue : otherTokenValueMapForScopeEntry.getValue()) {
        boolean otherNodeValueExist=false;
        for (        NodeValue thisNodeValue : thisTokenValueMapForScope.get(otherTokenValueMapForScopeEntry.getKey())) {
          if (thisNodeValue.equals(otherNodeValue)) {
            otherNodeValueExist=true;
            break;
          }
        }
        if (!otherNodeValueExist) {
          thisTokenValueMapForScope.get(otherTokenValueMapForScopeEntry.getKey()).add(otherNodeValue);
        }
      }
    }
  }
  if (other.getMapReduceCounters() != null) {
    setMapReduceCounters(other.getMapReduceCounters());
  }
}

Fixed version (ground truth):
/** 
 * Merge the other WorkflowToken passed to the method as a parameter with the WorkflowToken on which the method is invoked.
 * @param other the other WorkflowToken to be merged
 */
void mergeToken(BasicWorkflowToken other){
  for (  Map.Entry<Scope,Map<String,List<NodeValue>>> entry : other.tokenValueMap.entrySet()) {
    Map<String,List<NodeValue>> thisTokenValueMapForScope=this.tokenValueMap.get(entry.getKey());
    for (    Map.Entry<String,List<NodeValue>> otherTokenValueMapForScopeEntry : entry.getValue().entrySet()) {
      String otherKey=otherTokenValueMapForScopeEntry.getKey();
      if (!thisTokenValueMapForScope.containsKey(otherKey)) {
        thisTokenValueMapForScope.put(otherKey,Lists.<NodeValue>newArrayList());
      }
      for (      NodeValue otherNodeValue : otherTokenValueMapForScopeEntry.getValue()) {
        boolean otherNodeValueExist=false;
        for (        NodeValue thisNodeValue : thisTokenValueMapForScope.get(otherKey)) {
          if (thisNodeValue.equals(otherNodeValue)) {
            otherNodeValueExist=true;
            break;
          }
        }
        if (!otherNodeValueExist) {
          addOrUpdate(otherKey,otherNodeValue,thisTokenValueMapForScope.get(otherKey),-1);
        }
      }
    }
  }
  if (other.getMapReduceCounters() != null) {
    setMapReduceCounters(other.getMapReduceCounters());
  }
}
Program: 6753
Project: 6753
Buggy source:
void put(String key,Value value,Scope scope){
  Preconditions.checkNotNull(key,"String_Node_Str");
  Preconditions.checkNotNull(value,String.format("String_Node_Str",key));
  Preconditions.checkNotNull(value.toString(),String.format("String_Node_Str",key));
  Preconditions.checkState(nodeName != null,"String_Node_Str");
  List<NodeValue> nodeValueList=tokenValueMap.get(scope).get(key);
  if (nodeValueList == null) {
    nodeValueList=Lists.newArrayList();
    tokenValueMap.get(scope).put(key,nodeValueList);
  }
  for (int i=0; i < nodeValueList.size(); i++) {
    if (nodeValueList.get(i).getNodeName().equals(nodeName)) {
      nodeValueList.set(i,new NodeValue(nodeName,value));
      return;
    }
  }
  nodeValueList.add(new NodeValue(nodeName,value));
}

Fixed version (ground truth):
void put(String key,Value value,Scope scope){
  Preconditions.checkNotNull(key,"String_Node_Str");
  Preconditions.checkNotNull(value,String.format("String_Node_Str",key));
  Preconditions.checkNotNull(value.toString(),String.format("String_Node_Str",key));
  Preconditions.checkState(nodeName != null,"String_Node_Str");
  List<NodeValue> nodeValueList=tokenValueMap.get(scope).get(key);
  if (nodeValueList == null) {
    nodeValueList=Lists.newArrayList();
    tokenValueMap.get(scope).put(key,nodeValueList);
  }
  NodeValue nodeValueToAddUpdate=new NodeValue(nodeName,value);
  for (int i=0; i < nodeValueList.size(); i++) {
    NodeValue existingNodeValue=nodeValueList.get(i);
    if (existingNodeValue.getNodeName().equals(nodeName)) {
      addOrUpdate(key,nodeValueToAddUpdate,nodeValueList,i);
      return;
    }
  }
  addOrUpdate(key,nodeValueToAddUpdate,nodeValueList,-1);
}
Program: 6755
Project: 6755
Buggy source:
@Override protected void run() throws Exception {
  LOG.info("String_Node_Str",workflowSpec);
  WorkflowToken token=new BasicWorkflowToken();
  executeAll(workflowSpec.getNodes().iterator(),program.getApplicationSpecification(),new InstantiatorFactory(false),program.getClassLoader(),token);
  LOG.info("String_Node_Str",workflowSpec);
}

Fixed version (ground truth):
@Override protected void run() throws Exception {
  LOG.info("String_Node_Str",workflowSpec);
  WorkflowToken token=new BasicWorkflowToken(cConf.getInt(Constants.AppFabric.WORKFLOW_TOKEN_MAX_SIZE_MB));
  executeAll(workflowSpec.getNodes().iterator(),program.getApplicationSpecification(),new InstantiatorFactory(false),program.getClassLoader(),token);
  LOG.info("String_Node_Str",workflowSpec);
}
Program: 6756
Project: 6756
Buggy source:
@Inject public WorkflowProgramRunner(ProgramRunnerFactory programRunnerFactory,ServiceAnnouncer serviceAnnouncer,@Named(Constants.AppFabric.SERVER_ADDRESS) InetAddress hostname,MetricsCollectionService metricsCollectionService,DatasetFramework datasetFramework,DiscoveryServiceClient discoveryServiceClient,TransactionSystemClient txClient,Store store){
  this.programRunnerFactory=programRunnerFactory;
  this.serviceAnnouncer=serviceAnnouncer;
  this.hostname=hostname;
  this.metricsCollectionService=metricsCollectionService;
  this.datasetFramework=datasetFramework;
  this.discoveryServiceClient=discoveryServiceClient;
  this.txClient=txClient;
  this.store=store;
}

Fixed version (ground truth):
@Inject public WorkflowProgramRunner(ProgramRunnerFactory programRunnerFactory,ServiceAnnouncer serviceAnnouncer,@Named(Constants.AppFabric.SERVER_ADDRESS) InetAddress hostname,MetricsCollectionService metricsCollectionService,DatasetFramework datasetFramework,DiscoveryServiceClient discoveryServiceClient,TransactionSystemClient txClient,Store store,CConfiguration cConf){
  this.programRunnerFactory=programRunnerFactory;
  this.serviceAnnouncer=serviceAnnouncer;
  this.hostname=hostname;
  this.metricsCollectionService=metricsCollectionService;
  this.datasetFramework=datasetFramework;
  this.discoveryServiceClient=discoveryServiceClient;
  this.txClient=txClient;
  this.store=store;
  this.cConf=cConf;
}