nus-yam/ex-repair huggingface dataset:
Program: 6181
Project: 6181
Buggy source:
@Override public Map<String,WorkflowNodeStateDetail> getWorkflowNodeStates(ProgramRunId workflowRunId) throws NotFoundException {
  try {
    return workflowClient.getWorkflowNodeStates(workflowRunId);
  }
 catch (  IOException|UnauthenticatedException e) {
    throw Throwables.propagate(e);
  }
}

Fixed version (ground truth):
@Override public Map<String,WorkflowNodeStateDetail> getWorkflowNodeStates(String workflowRunId) throws NotFoundException {
  try {
    ProgramRunId programRunId=new ProgramRunId(workflowId.getNamespaceId(),workflowId.getApplicationId(),workflowId.getType(),workflowId.getId(),workflowRunId);
    return workflowClient.getWorkflowNodeStates(programRunId);
  }
 catch (  IOException|UnauthenticatedException e) {
    throw Throwables.propagate(e);
  }
}
Program: 6182
Project: 6182
Buggy source:
/** 
 * Creates a   {@link MetricsContext} to be used for the Spark execution.
 */
private static MetricsContext createMetricsContext(MetricsCollectionService service,ProgramId programId,RunId runId,@Nullable WorkflowProgramInfo workflowProgramInfo){
  Map<String,String> tags=Maps.newHashMap();
  tags.put(Constants.Metrics.Tag.NAMESPACE,programId.getNamespace());
  tags.put(Constants.Metrics.Tag.APP,programId.getApplication());
  tags.put(ProgramTypeMetricTag.getTagName(ProgramType.SPARK),programId.getProgram());
  tags.put(Constants.Metrics.Tag.RUN_ID,runId.getId());
  tags.put(Constants.Metrics.Tag.INSTANCE_ID,"String_Node_Str");
  MetricsContext programMetricsContext=service.getContext(tags);
  if (workflowProgramInfo == null) {
    return programMetricsContext;
  }
  tags=Maps.newHashMap();
  tags.put(Constants.Metrics.Tag.NAMESPACE,programId.getNamespace());
  tags.put(Constants.Metrics.Tag.APP,programId.getApplication());
  tags.put(Constants.Metrics.Tag.WORKFLOW,workflowProgramInfo.getName());
  tags.put(Constants.Metrics.Tag.RUN_ID,workflowProgramInfo.getRunId().getId());
  tags.put(Constants.Metrics.Tag.NODE,workflowProgramInfo.getNodeId());
  return new MultiMetricsContext(programMetricsContext,service.getContext(tags));
}

Fixed version (ground truth):
/** 
 * Creates a   {@link MetricsContext} to be used for the Spark execution.
 */
private static MetricsContext createMetricsContext(MetricsCollectionService service,ProgramId programId,RunId runId,@Nullable WorkflowProgramInfo workflowProgramInfo){
  Map<String,String> tags=Maps.newHashMap();
  tags.put(Constants.Metrics.Tag.NAMESPACE,programId.getNamespace());
  tags.put(Constants.Metrics.Tag.APP,programId.getApplication());
  tags.put(ProgramTypeMetricTag.getTagName(ProgramType.SPARK),programId.getProgram());
  tags.put(Constants.Metrics.Tag.RUN_ID,runId.getId());
  tags.put(Constants.Metrics.Tag.INSTANCE_ID,"String_Node_Str");
  if (workflowProgramInfo != null) {
    tags.put(Constants.Metrics.Tag.WORKFLOW,workflowProgramInfo.getName());
    tags.put(Constants.Metrics.Tag.WORKFLOW_RUN_ID,workflowProgramInfo.getRunId().getId());
    tags.put(Constants.Metrics.Tag.NODE,workflowProgramInfo.getNodeId());
  }
  return service.getContext(tags);
}
Program: 6183
Project: 6183
Buggy source:
/** 
 * Get node stated for the specified Workflow run.
 * @param workflowRunId the Workflow run for which node states to be returned
 * @return {@link Map} of node name to the {@link WorkflowNodeStateDetail}
 * @throws NotFoundException when the specified Workflow run is not found
 */
Map<String,WorkflowNodeStateDetail> getWorkflowNodeStates(ProgramRunId workflowRunId) throws NotFoundException ;

Fixed version (ground truth):
/** 
 * Get node stated for the specified Workflow run.
 * @param workflowRunId the Workflow run for which node states to be returned
 * @return {@link Map} of node name to the {@link WorkflowNodeStateDetail}
 * @throws NotFoundException when the specified Workflow run is not found
 */
Map<String,WorkflowNodeStateDetail> getWorkflowNodeStates(String workflowRunId) throws NotFoundException ;
Program: 6184
Project: 6184
Buggy source:
@Override public Map<String,WorkflowNodeStateDetail> getWorkflowNodeStates(ProgramRunId workflowRunId) throws NotFoundException {
  return appFabricClient.getWorkflowNodeStates(workflowRunId);
}

Fixed version (ground truth):
@Override public Map<String,WorkflowNodeStateDetail> getWorkflowNodeStates(String workflowRunId) throws NotFoundException {
  return appFabricClient.getWorkflowNodeStates(new ProgramRunId(programId.getNamespaceId(),programId.getApplicationId(),programId.getType(),programId.getId(),workflowRunId));
}
Program: 6185
Project: 6185
Buggy source:
public DefaultWorkflowManager(Id.Program programId,AppFabricClient appFabricClient,DefaultApplicationManager applicationManager){
  super(programId,applicationManager);
  this.appFabricClient=appFabricClient;
}

Fixed version (ground truth):
public DefaultWorkflowManager(Id.Program programId,AppFabricClient appFabricClient,DefaultApplicationManager applicationManager){
  super(programId,applicationManager);
  this.programId=programId;
  this.appFabricClient=appFabricClient;
}
Program: 6187
Project: 6187
Buggy source:
private static MetricsContext createMetricsContext(Program program,String runId,MetricsCollectionService service,@Nullable WorkflowProgramInfo workflowProgramInfo){
  Map<String,String> tags=Maps.newHashMap();
  tags.putAll(getMetricsContext(program,runId));
  MetricsContext programMetricsContext=service.getContext(tags);
  if (workflowProgramInfo == null) {
    return programMetricsContext;
  }
  tags=Maps.newHashMap();
  tags.put(Constants.Metrics.Tag.NAMESPACE,program.getNamespaceId());
  tags.put(Constants.Metrics.Tag.APP,program.getApplicationId());
  tags.put(Constants.Metrics.Tag.WORKFLOW,workflowProgramInfo.getName());
  tags.put(Constants.Metrics.Tag.RUN_ID,workflowProgramInfo.getRunId().getId());
  tags.put(Constants.Metrics.Tag.NODE,workflowProgramInfo.getNodeId());
  return new MultiMetricsContext(programMetricsContext,service.getContext(tags));
}

Fixed version (ground truth):
private static MetricsContext createMetricsContext(Program program,String runId,MetricsCollectionService service,@Nullable WorkflowProgramInfo workflowProgramInfo){
  Map<String,String> tags=Maps.newHashMap();
  tags.putAll(getMetricsContext(program,runId));
  if (workflowProgramInfo != null) {
    tags.put(Constants.Metrics.Tag.WORKFLOW,workflowProgramInfo.getName());
    tags.put(Constants.Metrics.Tag.WORKFLOW_RUN_ID,workflowProgramInfo.getRunId().getId());
    tags.put(Constants.Metrics.Tag.NODE,workflowProgramInfo.getNodeId());
  }
  return service.getContext(tags);
}
Program: 6188
Project: 6188
Buggy source:
private static MetricsContext createMetricsContext(Program program,String runId,MetricsCollectionService service,String taskId,@Nullable MapReduceMetrics.TaskType type,@Nullable WorkflowProgramInfo workflowProgramInfo){
  Map<String,String> tags=Maps.newHashMap();
  tags.putAll(getMetricsContext(program,runId));
  if (type != null) {
    tags.put(Constants.Metrics.Tag.MR_TASK_TYPE,type.getId());
    tags.put(Constants.Metrics.Tag.INSTANCE_ID,taskId);
  }
  MetricsContext programMetricsContext=service.getContext(tags);
  if (workflowProgramInfo == null) {
    return programMetricsContext;
  }
  tags=Maps.newHashMap();
  tags.put(Constants.Metrics.Tag.NAMESPACE,program.getNamespaceId());
  tags.put(Constants.Metrics.Tag.APP,program.getApplicationId());
  tags.put(Constants.Metrics.Tag.WORKFLOW,workflowProgramInfo.getName());
  tags.put(Constants.Metrics.Tag.RUN_ID,workflowProgramInfo.getRunId().getId());
  tags.put(Constants.Metrics.Tag.NODE,workflowProgramInfo.getNodeId());
  return new MultiMetricsContext(programMetricsContext,service.getContext(tags));
}

Fixed version (ground truth):
private static MetricsContext createMetricsContext(Program program,String runId,MetricsCollectionService service,String taskId,@Nullable MapReduceMetrics.TaskType type,@Nullable WorkflowProgramInfo workflowProgramInfo){
  Map<String,String> tags=Maps.newHashMap();
  tags.putAll(getMetricsContext(program,runId));
  if (type != null) {
    tags.put(Constants.Metrics.Tag.MR_TASK_TYPE,type.getId());
    tags.put(Constants.Metrics.Tag.INSTANCE_ID,taskId);
  }
  if (workflowProgramInfo != null) {
    tags.put(Constants.Metrics.Tag.WORKFLOW,workflowProgramInfo.getName());
    tags.put(Constants.Metrics.Tag.WORKFLOW_RUN_ID,workflowProgramInfo.getRunId().getId());
    tags.put(Constants.Metrics.Tag.NODE,workflowProgramInfo.getNodeId());
  }
  return service.getContext(tags);
}
Program: 6189
Project: 6189
Buggy source:
@Nullable private static MetricsContext getMetricCollector(Program program,String runId,@Nullable MetricsCollectionService service){
  if (service == null) {
    return null;
  }
  Map<String,String> tags=Maps.newHashMap(getMetricsContext(program,runId));
  return service.getContext(tags);
}

Fixed version (ground truth):
@Nullable private static MetricsContext getMetricCollector(Program program,String runId,@Nullable MetricsCollectionService service){
  if (service == null) {
    return null;
  }
  Map<String,String> tags=Maps.newHashMap();
  tags.put(Constants.Metrics.Tag.NAMESPACE,program.getNamespaceId());
  tags.put(Constants.Metrics.Tag.APP,program.getApplicationId());
  tags.put(ProgramTypeMetricTag.getTagName(program.getType()),program.getName());
  tags.put(Constants.Metrics.Tag.WORKFLOW_RUN_ID,runId);
  return service.getContext(tags);
}
Program: 6190
Project: 6190
Buggy source:
public CubeDataset(String name,MetricsTable entityTable,Map<Integer,Table> resolutionTables,Map<String,? extends Aggregation> aggregations){
  super(name,entityTable,resolutionTables.values().toArray(new Dataset[resolutionTables.values().size()]));
  this.entityTable=entityTable;
  this.resolutionTables=resolutionTables;
  int[] resolutions=new int[resolutionTables.keySet().size()];
  int index=0;
  for (  Integer resolution : resolutionTables.keySet()) {
    resolutions[index++]=resolution;
  }
  this.cube=new DefaultCube(resolutions,new FactTableSupplierImpl(entityTable,resolutionTables),aggregations);
}

Fixed version (ground truth):
public CubeDataset(String name,MetricsTable entityTable,Map<Integer,Table> resolutionTables,Map<String,? extends Aggregation> aggregations){
  super(name,entityTable,resolutionTables.values().toArray(new Dataset[resolutionTables.values().size()]));
  this.entityTable=entityTable;
  this.resolutionTables=resolutionTables;
  int[] resolutions=new int[resolutionTables.keySet().size()];
  int index=0;
  for (  Integer resolution : resolutionTables.keySet()) {
    resolutions[index++]=resolution;
  }
  this.cube=new DefaultCube(resolutions,new FactTableSupplierImpl(entityTable,resolutionTables),aggregations,ImmutableMap.<String,AggregationAlias>of());
}
Program: 6191
Project: 6191
Buggy source:
public DefaultCube(int[] resolutions,FactTableSupplier factTableSupplier,Map<String,? extends Aggregation> aggregations){
  this.aggregations=aggregations;
  this.resolutionToFactTable=Maps.newHashMap();
  for (  int resolution : resolutions) {
    resolutionToFactTable.put(resolution,factTableSupplier.get(resolution,3600));
  }
}

Fixed version (ground truth):
public DefaultCube(int[] resolutions,FactTableSupplier factTableSupplier,Map<String,? extends Aggregation> aggregations,Map<String,AggregationAlias> aggregationAliasMap){
  this.aggregations=aggregations;
  this.resolutionToFactTable=Maps.newHashMap();
  for (  int resolution : resolutions) {
    resolutionToFactTable.put(resolution,factTableSupplier.get(resolution,3600));
  }
  this.aggregationAliasMap=aggregationAliasMap;
}
Program: 6192
Project: 6192
Buggy source:
@Override public void add(Collection<? extends CubeFact> facts){
  List<Fact> toWrite=Lists.newArrayList();
  int dimValuesCount=0;
  for (  CubeFact fact : facts) {
    for (    Aggregation agg : aggregations.values()) {
      if (agg.accept(fact)) {
        List<DimensionValue> dimensionValues=Lists.newArrayList();
        for (        String dimensionName : agg.getDimensionNames()) {
          dimensionValues.add(new DimensionValue(dimensionName,fact.getDimensionValues().get(dimensionName)));
          dimValuesCount++;
        }
        toWrite.add(new Fact(fact.getTimestamp(),dimensionValues,fact.getMeasurements()));
      }
    }
  }
  for (  FactTable table : resolutionToFactTable.values()) {
    table.add(toWrite);
  }
  incrementMetric("String_Node_Str",1);
  incrementMetric("String_Node_Str",facts.size());
  incrementMetric("String_Node_Str",toWrite.size());
  incrementMetric("String_Node_Str",dimValuesCount);
  incrementMetric("String_Node_Str",toWrite.size() * resolutionToFactTable.size());
}

Fixed version (ground truth):
@Override public void add(Collection<? extends CubeFact> facts){
  List<Fact> toWrite=Lists.newArrayList();
  int dimValuesCount=0;
  for (  CubeFact fact : facts) {
    for (    Map.Entry<String,? extends Aggregation> aggEntry : aggregations.entrySet()) {
      Aggregation agg=aggEntry.getValue();
      AggregationAlias aggregationAlias=null;
      if (aggregationAliasMap.containsKey(aggEntry.getKey())) {
        aggregationAlias=aggregationAliasMap.get(aggEntry.getKey());
      }
      if (agg.accept(fact)) {
        List<DimensionValue> dimensionValues=Lists.newArrayList();
        for (        String dimensionName : agg.getDimensionNames()) {
          String dimensionValueKey=aggregationAlias == null ? dimensionName : aggregationAlias.getAlias(dimensionName);
          dimensionValues.add(new DimensionValue(dimensionName,fact.getDimensionValues().get(dimensionValueKey)));
          dimValuesCount++;
        }
        toWrite.add(new Fact(fact.getTimestamp(),dimensionValues,fact.getMeasurements()));
      }
    }
  }
  for (  FactTable table : resolutionToFactTable.values()) {
    table.add(toWrite);
  }
  incrementMetric("String_Node_Str",1);
  incrementMetric("String_Node_Str",facts.size());
  incrementMetric("String_Node_Str",toWrite.size());
  incrementMetric("String_Node_Str",dimValuesCount);
  incrementMetric("String_Node_Str",toWrite.size() * resolutionToFactTable.size());
}
Program: 6193
Project: 6193
Buggy source:
@Override protected Cube getCube(final String name,int[] resolutions,Map<String,? extends Aggregation> aggregations){
  FactTableSupplier supplier=new FactTableSupplier(){
    @Override public FactTable get(    int resolution,    int rollTime){
      String entityTableName="String_Node_Str" + name;
      InMemoryTableService.create(entityTableName);
      String dataTableName="String_Node_Str" + name + "String_Node_Str"+ resolution;
      InMemoryTableService.create(dataTableName);
      return new FactTable(new InMemoryMetricsTable(dataTableName),new EntityTable(new InMemoryMetricsTable(entityTableName)),resolution,rollTime);
    }
  }
;
  return new DefaultCube(resolutions,supplier,aggregations);
}

Fixed version (ground truth):
@Override protected Cube getCube(final String name,int[] resolutions,Map<String,? extends Aggregation> aggregations){
  FactTableSupplier supplier=new FactTableSupplier(){
    @Override public FactTable get(    int resolution,    int rollTime){
      String entityTableName="String_Node_Str" + name;
      InMemoryTableService.create(entityTableName);
      String dataTableName="String_Node_Str" + name + "String_Node_Str"+ resolution;
      InMemoryTableService.create(dataTableName);
      return new FactTable(new InMemoryMetricsTable(dataTableName),new EntityTable(new InMemoryMetricsTable(entityTableName)),resolution,rollTime);
    }
  }
;
  return new DefaultCube(resolutions,supplier,aggregations,ImmutableMap.<String,AggregationAlias>of());
}
Program: 6194
Project: 6194
Buggy source:
@Override public Map<String,WorkflowNodeStateDetail> getWorkflowNodeStates(ProgramRunId workflowRunId) throws NotFoundException {
  try {
    return workflowClient.getWorkflowNodeStates(workflowRunId);
  }
 catch (  IOException|UnauthenticatedException e) {
    throw Throwables.propagate(e);
  }
}

Fixed version (ground truth):
@Override public Map<String,WorkflowNodeStateDetail> getWorkflowNodeStates(String workflowRunId) throws NotFoundException {
  try {
    ProgramRunId programRunId=new ProgramRunId(workflowId.getNamespaceId(),workflowId.getApplicationId(),workflowId.getType(),workflowId.getId(),workflowRunId);
    return workflowClient.getWorkflowNodeStates(programRunId);
  }
 catch (  IOException|UnauthenticatedException e) {
    throw Throwables.propagate(e);
  }
}
Program: 6195
Project: 6195
Buggy source:
/** 
 * Creates a   {@link MetricsContext} to be used for the Spark execution.
 */
private static MetricsContext createMetricsContext(MetricsCollectionService service,ProgramId programId,RunId runId,@Nullable WorkflowProgramInfo workflowProgramInfo){
  Map<String,String> tags=Maps.newHashMap();
  tags.put(Constants.Metrics.Tag.NAMESPACE,programId.getNamespace());
  tags.put(Constants.Metrics.Tag.APP,programId.getApplication());
  tags.put(ProgramTypeMetricTag.getTagName(ProgramType.SPARK),programId.getProgram());
  tags.put(Constants.Metrics.Tag.RUN_ID,runId.getId());
  tags.put(Constants.Metrics.Tag.INSTANCE_ID,"String_Node_Str");
  MetricsContext programMetricsContext=service.getContext(tags);
  if (workflowProgramInfo == null) {
    return programMetricsContext;
  }
  tags=Maps.newHashMap();
  tags.put(Constants.Metrics.Tag.NAMESPACE,programId.getNamespace());
  tags.put(Constants.Metrics.Tag.APP,programId.getApplication());
  tags.put(Constants.Metrics.Tag.WORKFLOW,workflowProgramInfo.getName());
  tags.put(Constants.Metrics.Tag.RUN_ID,workflowProgramInfo.getRunId().getId());
  tags.put(Constants.Metrics.Tag.NODE,workflowProgramInfo.getNodeId());
  return new MultiMetricsContext(programMetricsContext,service.getContext(tags));
}

Fixed version (ground truth):
/** 
 * Creates a   {@link MetricsContext} to be used for the Spark execution.
 */
private static MetricsContext createMetricsContext(MetricsCollectionService service,ProgramId programId,RunId runId,@Nullable WorkflowProgramInfo workflowProgramInfo){
  Map<String,String> tags=Maps.newHashMap();
  tags.put(Constants.Metrics.Tag.NAMESPACE,programId.getNamespace());
  tags.put(Constants.Metrics.Tag.APP,programId.getApplication());
  tags.put(ProgramTypeMetricTag.getTagName(ProgramType.SPARK),programId.getProgram());
  tags.put(Constants.Metrics.Tag.RUN_ID,runId.getId());
  tags.put(Constants.Metrics.Tag.INSTANCE_ID,"String_Node_Str");
  if (workflowProgramInfo != null) {
    tags.put(Constants.Metrics.Tag.WORKFLOW,workflowProgramInfo.getName());
    tags.put(Constants.Metrics.Tag.WORKFLOW_RUN_ID,workflowProgramInfo.getRunId().getId());
    tags.put(Constants.Metrics.Tag.NODE,workflowProgramInfo.getNodeId());
  }
  return service.getContext(tags);
}
Program: 6196
Project: 6196
Buggy source:
/** 
 * Get node stated for the specified Workflow run.
 * @param workflowRunId the Workflow run for which node states to be returned
 * @return {@link Map} of node name to the {@link WorkflowNodeStateDetail}
 * @throws NotFoundException when the specified Workflow run is not found
 */
Map<String,WorkflowNodeStateDetail> getWorkflowNodeStates(ProgramRunId workflowRunId) throws NotFoundException ;

Fixed version (ground truth):
/** 
 * Get node stated for the specified Workflow run.
 * @param workflowRunId the Workflow run for which node states to be returned
 * @return {@link Map} of node name to the {@link WorkflowNodeStateDetail}
 * @throws NotFoundException when the specified Workflow run is not found
 */
Map<String,WorkflowNodeStateDetail> getWorkflowNodeStates(String workflowRunId) throws NotFoundException ;
Program: 6197
Project: 6197
Buggy source:
@Override public Map<String,WorkflowNodeStateDetail> getWorkflowNodeStates(ProgramRunId workflowRunId) throws NotFoundException {
  return appFabricClient.getWorkflowNodeStates(workflowRunId);
}

Fixed version (ground truth):
@Override public Map<String,WorkflowNodeStateDetail> getWorkflowNodeStates(String workflowRunId) throws NotFoundException {
  return appFabricClient.getWorkflowNodeStates(new ProgramRunId(programId.getNamespaceId(),programId.getApplicationId(),programId.getType(),programId.getId(),workflowRunId));
}
Program: 6198
Project: 6198
Buggy source:
public DefaultWorkflowManager(Id.Program programId,AppFabricClient appFabricClient,DefaultApplicationManager applicationManager){
  super(programId,applicationManager);
  this.appFabricClient=appFabricClient;
}

Fixed version (ground truth):
public DefaultWorkflowManager(Id.Program programId,AppFabricClient appFabricClient,DefaultApplicationManager applicationManager){
  super(programId,applicationManager);
  this.programId=programId;
  this.appFabricClient=appFabricClient;
}
Program: 6200
Project: 6200
Buggy source:
private static void usage(){
  HelpFormatter formatter=new HelpFormatter();
  String args="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  formatter.printHelp("String_Node_Str" + args,getOptions());
  System.exit(0);
}

Fixed version (ground truth):
private static void usage(){
  String toolName=TOOL_NAME + (OSDetector.isWindows() ? "String_Node_Str" : "String_Node_Str");
  HelpFormatter formatter=new HelpFormatter();
  String args="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  formatter.printHelp(toolName + "String_Node_Str" + args,getOptions());
  System.exit(0);
}
Program: 6201
Project: 6201
Buggy source:
@Override public ProgramRunner create(ProgramType programType){
  ProgramRuntimeProvider provider=runtimeProviderLoader.get(programType);
  if (provider != null) {
    LOG.debug("String_Node_Str",provider,programType);
    return provider.createProgramRunner(programType,mode,injector);
  }
  Provider<ProgramRunner> defaultProvider=defaultRunnerProviders.get(programType);
  Preconditions.checkNotNull(defaultProvider,"String_Node_Str" + programType);
  return defaultProvider.get();
}

Fixed version (ground truth):
@Override public ProgramRunner create(ProgramType programType){
  ProgramRuntimeProvider provider=runtimeProviderLoader.get(programType);
  if (provider != null) {
    LOG.debug("String_Node_Str",provider,programType);
    return provider.createProgramRunner(programType,mode,injector);
  }
  Provider<ProgramRunner> defaultProvider=defaultRunnerProviders.get(programType);
  if (defaultProvider == null) {
    throw new IllegalArgumentException("String_Node_Str" + programType);
  }
  return defaultProvider.get();
}
Program: 6202
Project: 6202
Buggy source:
@Override protected void configure(){
  MapBinder<ProgramType,ProgramRunner> defaultProgramRunnerBinder=MapBinder.newMapBinder(binder(),ProgramType.class,ProgramRunner.class);
  defaultProgramRunnerBinder.addBinding(ProgramType.FLOW).to(DistributedFlowProgramRunner.class);
  defaultProgramRunnerBinder.addBinding(ProgramType.MAPREDUCE).to(DistributedMapReduceProgramRunner.class);
  defaultProgramRunnerBinder.addBinding(ProgramType.WORKFLOW).to(DistributedWorkflowProgramRunner.class);
  defaultProgramRunnerBinder.addBinding(ProgramType.WEBAPP).to(DistributedWebappProgramRunner.class);
  defaultProgramRunnerBinder.addBinding(ProgramType.SERVICE).to(DistributedServiceProgramRunner.class);
  defaultProgramRunnerBinder.addBinding(ProgramType.WORKER).to(DistributedWorkerProgramRunner.class);
  bind(ProgramRuntimeProvider.Mode.class).toInstance(ProgramRuntimeProvider.Mode.DISTRIBUTED);
  bind(ProgramRunnerFactory.class).to(DefaultProgramRunnerFactory.class).in(Scopes.SINGLETON);
  bind(ProgramRuntimeService.class).to(DistributedProgramRuntimeService.class).in(Scopes.SINGLETON);
  expose(ProgramRuntimeService.class);
}

Fixed version (ground truth):
@Override protected void configure(){
  MapBinder<ProgramType,ProgramRunner> defaultProgramRunnerBinder=MapBinder.newMapBinder(binder(),ProgramType.class,ProgramRunner.class);
  defaultProgramRunnerBinder.addBinding(ProgramType.FLOW).to(DistributedFlowProgramRunner.class);
  defaultProgramRunnerBinder.addBinding(ProgramType.MAPREDUCE).to(DistributedMapReduceProgramRunner.class);
  defaultProgramRunnerBinder.addBinding(ProgramType.WORKFLOW).to(DistributedWorkflowProgramRunner.class);
  defaultProgramRunnerBinder.addBinding(ProgramType.WEBAPP).to(DistributedWebappProgramRunner.class);
  defaultProgramRunnerBinder.addBinding(ProgramType.SERVICE).to(DistributedServiceProgramRunner.class);
  defaultProgramRunnerBinder.addBinding(ProgramType.WORKER).to(DistributedWorkerProgramRunner.class);
  bind(ProgramRuntimeProvider.Mode.class).toInstance(ProgramRuntimeProvider.Mode.DISTRIBUTED);
  bind(ProgramRunnerFactory.class).to(DefaultProgramRunnerFactory.class).in(Scopes.SINGLETON);
  expose(ProgramRunnerFactory.class);
  bind(ProgramRuntimeService.class).to(DistributedProgramRuntimeService.class).in(Scopes.SINGLETON);
  expose(ProgramRuntimeService.class);
}
Program: 6203
Project: 6203
Buggy source:
/** 
 * Creates   {@link Program} that can be executed by the given {@link ProgramRunner}.
 * @param cConf the CDAP configuration
 * @param programRunner the {@link ProgramRunner} for executing the program
 * @param programJarLocation the {@link Location} of the program jar file
 * @param unpackedDir a directory that the program jar file was unpacked to
 * @return a new {@link Program} instance.
 * @throws IOException If failed to create the program
 */
public static Program create(CConfiguration cConf,ProgramRunner programRunner,Location programJarLocation,File unpackedDir) throws IOException {
  FilterClassLoader.Filter filter;
  if (programRunner instanceof ProgramClassLoaderFilterProvider) {
    filter=((ProgramClassLoaderFilterProvider)programRunner).getFilter();
  }
 else {
    filter=FilterClassLoader.defaultFilter();
  }
  if (filter == null) {
    throw new IOException("String_Node_Str");
  }
  FilterClassLoader parentClassLoader=new FilterClassLoader(programRunner.getClass().getClassLoader(),filter);
  final ProgramClassLoader programClassLoader=new ProgramClassLoader(cConf,unpackedDir,parentClassLoader);
  return new ForwardingProgram(Programs.create(programJarLocation,programClassLoader)){
    @Override public void close() throws IOException {
      Closeables.closeQuietly(programClassLoader);
      super.close();
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Creates a   {@link Program} that can be executed by the given {@link ProgramRunner}.
 * @param cConf the CDAP configuration
 * @param programRunner the {@link ProgramRunner} for executing the program
 * @param programJarLocation the {@link Location} of the program jar file
 * @param unpackedDir a directory that the program jar file was unpacked to
 * @return a new {@link Program} instance.
 * @throws IOException If failed to create the program
 */
public static Program create(CConfiguration cConf,ProgramRunner programRunner,Location programJarLocation,File unpackedDir) throws IOException {
  final ProgramClassLoader programClassLoader;
  if (programRunner instanceof ProgramClassLoaderProvider) {
    programClassLoader=((ProgramClassLoaderProvider)programRunner).createProgramClassLoader(cConf,unpackedDir);
  }
 else {
    programClassLoader=new ProgramClassLoader(cConf,unpackedDir,FilterClassLoader.create(Programs.class.getClassLoader()));
  }
  if (programClassLoader == null) {
    throw new IOException("String_Node_Str");
  }
  return new ForwardingProgram(Programs.create(programJarLocation,programClassLoader)){
    @Override public void close() throws IOException {
      Closeables.closeQuietly(programClassLoader);
      super.close();
    }
  }
;
}
Program: 6204
Project: 6204
Buggy source:
ProgramRunner create(ProgramType programType);

Fixed version (ground truth):
/** 
 * Creates a   {@link ProgramRunner} for the given {@link ProgramType}.
 * @param programType type of program
 * @return a {@link ProgramRunner} that can execute the given program type.
 * @throws IllegalArgumentException if no {@link ProgramRunner} is found for the given program type
 */
ProgramRunner create(ProgramType programType);
Program: 6205
Project: 6205
Buggy source:
ArtifactClassLoaderFactory(CConfiguration cConf,ProgramRuntimeProviderLoader runtimeProviderLoader){
  this.cConf=cConf;
  this.runtimeProviderLoader=runtimeProviderLoader;
  this.tmpDir=new File(cConf.get(Constants.CFG_LOCAL_DATA_DIR),cConf.get(Constants.AppFabric.TEMP_DIR)).getAbsoluteFile();
}

Fixed version (ground truth):
ArtifactClassLoaderFactory(CConfiguration cConf,ProgramRunnerFactory programRunnerFactory){
  this.cConf=cConf;
  this.programRunnerFactory=programRunnerFactory;
  this.tmpDir=new File(cConf.get(Constants.CFG_LOCAL_DATA_DIR),cConf.get(Constants.AppFabric.TEMP_DIR)).getAbsoluteFile();
}
Program: 6207
Project: 6207
Buggy source:
@Override public void close(){
  try {
    Closeables.closeQuietly(programClassLoader);
    DirUtils.deleteDirectoryContents(unpackDir);
  }
 catch (  IOException e) {
    LOG.warn("String_Node_Str",unpackDir,e);
  }
}

Fixed version (ground truth):
@Override public void close(){
  try {
    Closeables.closeQuietly(finalProgramClassLoader);
    DirUtils.deleteDirectoryContents(unpackDir);
  }
 catch (  IOException e) {
    LOG.warn("String_Node_Str",unpackDir,e);
  }
}
Program: 6208
Project: 6208
Buggy source:
@VisibleForTesting @Inject public ArtifactRepository(CConfiguration cConf,ArtifactStore artifactStore,MetadataStore metadataStore,AuthorizerInstantiatorService authorizerInstantiatorService,ProgramRuntimeProviderLoader programRuntimeProviderLoader){
  this.artifactStore=artifactStore;
  this.artifactClassLoaderFactory=new ArtifactClassLoaderFactory(cConf,programRuntimeProviderLoader);
  this.artifactInspector=new ArtifactInspector(cConf,artifactClassLoaderFactory);
  this.systemArtifactDirs=new ArrayList<>();
  for (  String dir : cConf.get(Constants.AppFabric.SYSTEM_ARTIFACTS_DIR).split("String_Node_Str")) {
    File file=new File(dir);
    if (!file.isDirectory()) {
      LOG.warn("String_Node_Str",file);
      continue;
    }
    systemArtifactDirs.add(file);
  }
  this.configReader=new ArtifactConfigReader();
  this.metadataStore=metadataStore;
  this.authorizerInstantiatorService=authorizerInstantiatorService;
  this.instanceId=new InstanceId(cConf.get(Constants.INSTANCE_NAME));
}

Fixed version (ground truth):
@VisibleForTesting @Inject public ArtifactRepository(CConfiguration cConf,ArtifactStore artifactStore,MetadataStore metadataStore,AuthorizerInstantiatorService authorizerInstantiatorService,ProgramRunnerFactory programRunnerFactory){
  this.artifactStore=artifactStore;
  this.artifactClassLoaderFactory=new ArtifactClassLoaderFactory(cConf,programRunnerFactory);
  this.artifactInspector=new ArtifactInspector(cConf,artifactClassLoaderFactory);
  this.systemArtifactDirs=new ArrayList<>();
  for (  String dir : cConf.get(Constants.AppFabric.SYSTEM_ARTIFACTS_DIR).split("String_Node_Str")) {
    File file=new File(dir);
    if (!file.isDirectory()) {
      LOG.warn("String_Node_Str",file);
      continue;
    }
    systemArtifactDirs.add(file);
  }
  this.configReader=new ArtifactConfigReader();
  this.metadataStore=metadataStore;
  this.authorizerInstantiatorService=authorizerInstantiatorService;
  this.instanceId=new InstanceId(cConf.get(Constants.INSTANCE_NAME));
}
Program: 6209
Project: 6209
Buggy source:
@Test public void testInMemoryConfigurator() throws Exception {
  LocationFactory locationFactory=new LocalLocationFactory(TMP_FOLDER.newFolder());
  Location appJar=AppJarHelper.createDeploymentJar(locationFactory,WordCountApp.class);
  Id.Artifact artifactId=Id.Artifact.from(Id.Namespace.DEFAULT,WordCountApp.class.getSimpleName(),"String_Node_Str");
  ArtifactRepository artifactRepo=new ArtifactRepository(conf,null,null,null,new ProgramRuntimeProviderLoader(conf));
  Configurator configurator=new InMemoryConfigurator(conf,Id.Namespace.DEFAULT,artifactId,WordCountApp.class.getName(),appJar,"String_Node_Str",artifactRepo);
  ListenableFuture<ConfigResponse> result=configurator.config();
  ConfigResponse response=result.get(10,TimeUnit.SECONDS);
  Assert.assertNotNull(response);
  ApplicationSpecificationAdapter adapter=ApplicationSpecificationAdapter.create(new ReflectionSchemaGenerator());
  ApplicationSpecification specification=adapter.fromJson(response.get());
  Assert.assertNotNull(specification);
  Assert.assertTrue(specification.getName().equals("String_Node_Str"));
  Assert.assertTrue(specification.getFlows().size() == 1);
}

Fixed version (ground truth):
@Test public void testInMemoryConfigurator() throws Exception {
  LocationFactory locationFactory=new LocalLocationFactory(TMP_FOLDER.newFolder());
  Location appJar=AppJarHelper.createDeploymentJar(locationFactory,WordCountApp.class);
  Id.Artifact artifactId=Id.Artifact.from(Id.Namespace.DEFAULT,WordCountApp.class.getSimpleName(),"String_Node_Str");
  ArtifactRepository artifactRepo=new ArtifactRepository(conf,null,null,null,new DummyProgramRunnerFactory());
  Configurator configurator=new InMemoryConfigurator(conf,Id.Namespace.DEFAULT,artifactId,WordCountApp.class.getName(),appJar,"String_Node_Str",artifactRepo);
  ListenableFuture<ConfigResponse> result=configurator.config();
  ConfigResponse response=result.get(10,TimeUnit.SECONDS);
  Assert.assertNotNull(response);
  ApplicationSpecificationAdapter adapter=ApplicationSpecificationAdapter.create(new ReflectionSchemaGenerator());
  ApplicationSpecification specification=adapter.fromJson(response.get());
  Assert.assertNotNull(specification);
  Assert.assertTrue(specification.getName().equals("String_Node_Str"));
  Assert.assertTrue(specification.getFlows().size() == 1);
}
Program: 6211
Project: 6211
Buggy source:
@BeforeClass public static void setup() throws Exception {
  CConfiguration cConf=CConfiguration.create();
  cConf.set(Constants.CFG_LOCAL_DATA_DIR,TMP_FOLDER.newFolder().getAbsolutePath());
  classLoaderFactory=new ArtifactClassLoaderFactory(cConf,new ProgramRuntimeProviderLoader(cConf));
  artifactInspector=new ArtifactInspector(cConf,classLoaderFactory);
}

Fixed version (ground truth):
@BeforeClass public static void setup() throws Exception {
  CConfiguration cConf=CConfiguration.create();
  cConf.set(Constants.CFG_LOCAL_DATA_DIR,TMP_FOLDER.newFolder().getAbsolutePath());
  classLoaderFactory=new ArtifactClassLoaderFactory(cConf,new DummyProgramRunnerFactory());
  artifactInspector=new ArtifactInspector(cConf,classLoaderFactory);
}
Program: 6213
Project: 6213
Buggy source:
@GET @Path("String_Node_Str") public void getArtifactPluginTypes(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String artifactName,@PathParam("String_Node_Str") String artifactVersion,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") String scope) throws NamespaceNotFoundException, BadRequestException, ArtifactNotFoundException {
  NamespaceId namespace=Ids.namespace(namespaceId);
  NamespaceId artifactNamespace=validateAndGetScopedNamespace(namespace,scope);
  Id.Artifact artifactId=validateAndGetArtifactId(artifactNamespace,artifactName,artifactVersion);
  try {
    SortedMap<ArtifactDescriptor,List<PluginClass>> plugins=artifactRepository.getPlugins(namespace,artifactId);
    Set<String> pluginTypes=Sets.newHashSet();
    for (    List<PluginClass> pluginClasses : plugins.values()) {
      for (      PluginClass pluginClass : pluginClasses) {
        pluginTypes.add(pluginClass.getType());
      }
    }
    responder.sendJson(HttpResponseStatus.OK,pluginTypes);
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str",artifactId,e);
    responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,"String_Node_Str");
  }
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") public void getArtifactPluginTypes(HttpRequest request,HttpResponder responder,@PathParam("String_Node_Str") String namespaceId,@PathParam("String_Node_Str") String artifactName,@PathParam("String_Node_Str") String artifactVersion,@QueryParam("String_Node_Str") @DefaultValue("String_Node_Str") String scope) throws NamespaceNotFoundException, BadRequestException, ArtifactNotFoundException {
  NamespaceId namespace=Ids.namespace(namespaceId);
  NamespaceId artifactNamespace=validateAndGetScopedNamespace(namespace,scope);
  Id.Artifact artifactId=validateAndGetArtifactId(artifactNamespace,artifactName,artifactVersion);
  try {
    SortedMap<ArtifactDescriptor,Set<PluginClass>> plugins=artifactRepository.getPlugins(namespace,artifactId);
    Set<String> pluginTypes=Sets.newHashSet();
    for (    Set<PluginClass> pluginClasses : plugins.values()) {
      for (      PluginClass pluginClass : pluginClasses) {
        pluginTypes.add(pluginClass.getType());
      }
    }
    responder.sendJson(HttpResponseStatus.OK,pluginTypes);
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str",artifactId,e);
    responder.sendString(HttpResponseStatus.INTERNAL_SERVER_ERROR,"String_Node_Str");
  }
}
Program: 6214
Project: 6214
Buggy source:
private void addPluginsToMap(NamespaceId namespace,Id.Artifact parentArtifactId,SortedMap<ArtifactDescriptor,List<PluginClass>> map,Row row) throws IOException {
  for (  Map.Entry<byte[],byte[]> column : row.getColumns().entrySet()) {
    ImmutablePair<ArtifactDescriptor,PluginClass> pluginEntry=getPluginEntry(namespace,parentArtifactId,column);
    if (pluginEntry != null) {
      ArtifactDescriptor artifactDescriptor=pluginEntry.getFirst();
      if (!map.containsKey(artifactDescriptor)) {
        map.put(artifactDescriptor,Lists.<PluginClass>newArrayList());
      }
      map.get(artifactDescriptor).add(pluginEntry.getSecond());
    }
  }
}

Fixed version (ground truth):
private void addPluginsToMap(NamespaceId namespace,Id.Artifact parentArtifactId,SortedMap<ArtifactDescriptor,Set<PluginClass>> map,Row row) throws IOException {
  for (  Map.Entry<byte[],byte[]> column : row.getColumns().entrySet()) {
    ImmutablePair<ArtifactDescriptor,PluginClass> pluginEntry=getPluginEntry(namespace,parentArtifactId,column);
    if (pluginEntry != null) {
      ArtifactDescriptor artifactDescriptor=pluginEntry.getFirst();
      if (!map.containsKey(artifactDescriptor)) {
        map.put(artifactDescriptor,Sets.<PluginClass>newHashSet());
      }
      map.get(artifactDescriptor).add(pluginEntry.getSecond());
    }
  }
}
Program: 6215
Project: 6215
Buggy source:
private SortedMap<ArtifactDescriptor,List<PluginClass>> getPluginsInArtifact(Table table,Id.Artifact artifactId){
  SortedMap<ArtifactDescriptor,List<PluginClass>> result=new TreeMap<>();
  ArtifactCell parentCell=new ArtifactCell(artifactId);
  byte[] parentDataBytes=table.get(parentCell.rowkey,parentCell.column);
  if (parentDataBytes == null) {
    return null;
  }
  ArtifactData parentData=gson.fromJson(Bytes.toString(parentDataBytes),ArtifactData.class);
  Set<PluginClass> parentPlugins=parentData.meta.getClasses().getPlugins();
  if (!parentPlugins.isEmpty()) {
    Location parentLocation=locationFactory.create(parentData.locationURI);
    ArtifactDescriptor descriptor=new ArtifactDescriptor(artifactId.toArtifactId(),parentLocation);
    result.put(descriptor,Lists.newArrayList(parentPlugins));
  }
  return result;
}

Fixed version (ground truth):
private SortedMap<ArtifactDescriptor,Set<PluginClass>> getPluginsInArtifact(Table table,Id.Artifact artifactId,Predicate<PluginClass> filter){
  SortedMap<ArtifactDescriptor,Set<PluginClass>> result=new TreeMap<>();
  ArtifactCell parentCell=new ArtifactCell(artifactId);
  byte[] parentDataBytes=table.get(parentCell.rowkey,parentCell.column);
  if (parentDataBytes == null) {
    return null;
  }
  ArtifactData parentData=gson.fromJson(Bytes.toString(parentDataBytes),ArtifactData.class);
  Set<PluginClass> parentPlugins=parentData.meta.getClasses().getPlugins();
  Set<PluginClass> filteredPlugins=Sets.newLinkedHashSet(Iterables.filter(parentPlugins,filter));
  if (!filteredPlugins.isEmpty()) {
    Location parentLocation=locationFactory.create(parentData.locationURI);
    ArtifactDescriptor descriptor=new ArtifactDescriptor(artifactId.toArtifactId(),parentLocation);
    result.put(descriptor,filteredPlugins);
  }
  return result;
}
Program: 6219
Project: 6219
Buggy source:
private static void usage(){
  HelpFormatter formatter=new HelpFormatter();
  String args="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  formatter.printHelp("String_Node_Str" + args,getOptions());
  System.exit(0);
}

Fixed version (ground truth):
private static void usage(){
  String TOOL_NAME;
  String TOOL_NAME_BASE="String_Node_Str";
  String OS=System.getProperty("String_Node_Str").toLowerCase();
  if (OS.indexOf("String_Node_Str") >= 0) {
    TOOL_NAME=TOOL_NAME_BASE + "String_Node_Str";
  }
 else {
    TOOL_NAME=TOOL_NAME_BASE + "String_Node_Str";
  }
  HelpFormatter formatter=new HelpFormatter();
  String args="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  formatter.printHelp(TOOL_NAME + "String_Node_Str" + args,getOptions());
  System.exit(0);
}
Program: 6220
Project: 6220
Buggy source:
private SortedMap<ArtifactDescriptor,List<PluginClass>> getPluginsInArtifact(Table table,Id.Artifact artifactId){
  SortedMap<ArtifactDescriptor,List<PluginClass>> result=new TreeMap<>();
  ArtifactCell parentCell=new ArtifactCell(artifactId);
  byte[] parentDataBytes=table.get(parentCell.rowkey,parentCell.column);
  if (parentDataBytes == null) {
    return null;
  }
  ArtifactData parentData=gson.fromJson(Bytes.toString(parentDataBytes),ArtifactData.class);
  Set<PluginClass> parentPlugins=parentData.meta.getClasses().getPlugins();
  if (!parentPlugins.isEmpty()) {
    Location parentLocation=locationFactory.create(parentData.locationURI);
    ArtifactDescriptor descriptor=new ArtifactDescriptor(artifactId.toArtifactId(),parentLocation);
    result.put(descriptor,Lists.newArrayList(parentPlugins));
  }
  return result;
}

Fixed version (ground truth):
private SortedMap<ArtifactDescriptor,List<PluginClass>> getPluginsInArtifact(Table table,Id.Artifact artifactId,Predicate<PluginClass> filter){
  SortedMap<ArtifactDescriptor,List<PluginClass>> result=new TreeMap<>();
  ArtifactCell parentCell=new ArtifactCell(artifactId);
  byte[] parentDataBytes=table.get(parentCell.rowkey,parentCell.column);
  if (parentDataBytes == null) {
    return null;
  }
  ArtifactData parentData=gson.fromJson(Bytes.toString(parentDataBytes),ArtifactData.class);
  Set<PluginClass> parentPlugins=parentData.meta.getClasses().getPlugins();
  Set<PluginClass> filteredPlugins=new HashSet<>();
  for (  PluginClass pluginClass : parentPlugins) {
    if (filter.apply(pluginClass)) {
      filteredPlugins.add(pluginClass);
    }
  }
  if (!filteredPlugins.isEmpty()) {
    Location parentLocation=locationFactory.create(parentData.locationURI);
    ArtifactDescriptor descriptor=new ArtifactDescriptor(artifactId.toArtifactId(),parentLocation);
    result.put(descriptor,Lists.newArrayList(filteredPlugins));
  }
  return result;
}
Program: 6227
Project: 6227
Buggy source:
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  PluginInfo that=(PluginInfo)o;
  return super.equals(that) && Objects.equals(properties,that.properties);
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  PluginInfo that=(PluginInfo)o;
  return super.equals(that) && Objects.equals(properties,that.properties) && Objects.equals(endpoints,that.endpoints);
}
Program: 6228
Project: 6228
Buggy source:
public PluginInfo(String name,String type,String description,String className,ArtifactSummary artifact,Map<String,PluginPropertyField> properties){
  super(name,type,description,className,artifact);
  this.properties=properties;
}

Fixed version (ground truth):
public PluginInfo(String name,String type,String description,String className,ArtifactSummary artifact,Map<String,PluginPropertyField> properties,Set<String> endpoints){
  super(name,type,description,className,artifact);
  this.properties=properties;
  this.endpoints=endpoints;
}
Program: 6229
Project: 6229
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + "String_Node_Str" + name + '\''+ "String_Node_Str"+ type+ '\''+ "String_Node_Str"+ description+ '\''+ "String_Node_Str"+ className+ '\''+ "String_Node_Str"+ properties+ "String_Node_Str"+ artifact+ '}';
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + "String_Node_Str" + name + '\''+ "String_Node_Str"+ type+ '\''+ "String_Node_Str"+ description+ '\''+ "String_Node_Str"+ className+ '\''+ "String_Node_Str"+ properties+ "String_Node_Str"+ artifact+ "String_Node_Str"+ endpoints+ '}';
}
Program: 6230
Project: 6230
Buggy source:
/** 
 * Change the number of instances of the running runnable.
 * @param runnableName Name of the runnable
 * @param newCount New instance count
 * @throws java.util.concurrent.ExecutionException
 * @throws InterruptedException
 */
private void changeInstances(String runnableName,final int newCount) throws Exception {
  Map<Integer,ProgramController> liveRunnables=components.row(runnableName);
  int liveCount=liveRunnables.size();
  if (liveCount == newCount) {
    return;
  }
  if (liveCount > newCount) {
    List<ListenableFuture<ProgramController>> futures=Lists.newArrayListWithCapacity(liveCount - newCount);
    for (int instanceId=liveCount - 1; instanceId >= newCount; instanceId--) {
      futures.add(components.remove(runnableName,instanceId).stop());
    }
    Futures.allAsList(futures).get();
  }
  for (int instanceId=liveCount; instanceId < newCount; instanceId++) {
    ProgramOptions programOptions=createComponentOptions(runnableName,instanceId,newCount,getRunId(),options);
    ProgramController controller=createProgramRunner().run(program,programOptions);
    components.put(runnableName,instanceId,controller);
  }
  liveRunnables=components.row(runnableName);
  for (  Map.Entry<Integer,ProgramController> entry : liveRunnables.entrySet()) {
    entry.getValue().command(ProgramOptionConstants.INSTANCES,newCount);
  }
}

Fixed version (ground truth):
/** 
 * Change the number of instances of the running runnable.
 * @param runnableName Name of the runnable
 * @param newCount New instance count
 * @param oldCount Old instance count
 * @throws java.util.concurrent.ExecutionException
 * @throws InterruptedException
 */
private void changeInstances(String runnableName,final int newCount,@SuppressWarnings("String_Node_Str") final int oldCount) throws Exception {
  Map<Integer,ProgramController> liveRunnables=components.row(runnableName);
  int liveCount=liveRunnables.size();
  if (liveCount == newCount) {
    return;
  }
  if (liveCount > newCount) {
    List<ListenableFuture<ProgramController>> futures=Lists.newArrayListWithCapacity(liveCount - newCount);
    for (int instanceId=liveCount - 1; instanceId >= newCount; instanceId--) {
      futures.add(components.remove(runnableName,instanceId).stop());
    }
    Futures.allAsList(futures).get();
  }
  for (int instanceId=liveCount; instanceId < newCount; instanceId++) {
    ProgramOptions programOptions=createComponentOptions(runnableName,instanceId,newCount,getRunId(),options);
    ProgramController controller=createProgramRunner().run(program,programOptions);
    components.put(runnableName,instanceId,controller);
  }
  liveRunnables=components.row(runnableName);
  for (  Map.Entry<Integer,ProgramController> entry : liveRunnables.entrySet()) {
    entry.getValue().command(ProgramOptionConstants.INSTANCES,newCount);
  }
}