Program: 4933
Project: 4933
Buggy source:
@Override protected void setupLaunchConfig(LaunchConfig launchConfig,Program program,ProgramOptions options,CConfiguration cConf,Configuration hConf,File tempDir) throws IOException {
  WorkflowSpecification spec=program.getApplicationSpecification().getWorkflows().get(program.getName());
  List<ClassAcceptor> acceptors=new ArrayList<>();
  Set<SchedulableProgramType> runnerTypes=EnumSet.of(SchedulableProgramType.MAPREDUCE,SchedulableProgramType.SPARK);
  for (  WorkflowActionNode node : Iterables.filter(spec.getNodeIdMap().values(),WorkflowActionNode.class)) {
    ScheduleProgramInfo programInfo=node.getProgram();
    if (!runnerTypes.remove(programInfo.getProgramType())) {
      continue;
    }
    ProgramType programType=ProgramType.valueOfSchedulableType(programInfo.getProgramType());
    ProgramRunner runner=programRunnerFactory.create(programType);
    try {
      if (runner instanceof DistributedProgramRunner) {
        ProgramId programId=program.getId().getParent().program(programType,programInfo.getProgramName());
        ((DistributedProgramRunner)runner).setupLaunchConfig(launchConfig,Programs.create(cConf,program,programId,runner),options,cConf,hConf,tempDir);
        acceptors.add(launchConfig.getClassAcceptor());
      }
    }
  finally {
      if (runner instanceof Closeable) {
        Closeables.closeQuietly((Closeable)runner);
      }
    }
  }
  launchConfig.setClassAcceptor(new AndClassAcceptor(acceptors));
  launchConfig.clearRunnables();
  Resources resources=findDriverResources(program.getApplicationSpecification().getSpark(),program.getApplicationSpecification().getMapReduce(),spec);
  resources=SystemArguments.getResources(options.getUserArguments(),resources);
  launchConfig.addRunnable(spec.getName(),new WorkflowTwillRunnable(spec.getName()),resources,1);
}

Fixed version (ground truth):
@Override protected void setupLaunchConfig(LaunchConfig launchConfig,Program program,ProgramOptions options,CConfiguration cConf,Configuration hConf,File tempDir) throws IOException {
  WorkflowSpecification spec=program.getApplicationSpecification().getWorkflows().get(program.getName());
  List<ClassAcceptor> acceptors=new ArrayList<>();
  Set<SchedulableProgramType> runnerTypes=EnumSet.of(SchedulableProgramType.MAPREDUCE,SchedulableProgramType.SPARK);
  for (  WorkflowActionNode node : Iterables.filter(spec.getNodeIdMap().values(),WorkflowActionNode.class)) {
    ScheduleProgramInfo programInfo=node.getProgram();
    if (!runnerTypes.remove(programInfo.getProgramType())) {
      continue;
    }
    ProgramType programType=ProgramType.valueOfSchedulableType(programInfo.getProgramType());
    ProgramRunner runner=programRunnerFactory.create(programType);
    try {
      if (runner instanceof DistributedProgramRunner) {
        ProgramId programId=program.getId().getParent().program(programType,programInfo.getProgramName());
        ((DistributedProgramRunner)runner).setupLaunchConfig(launchConfig,Programs.create(cConf,program,programId,runner),options,cConf,hConf,tempDir);
        acceptors.add(launchConfig.getClassAcceptor());
      }
    }
  finally {
      if (runner instanceof Closeable) {
        Closeables.closeQuietly((Closeable)runner);
      }
    }
  }
  launchConfig.setClassAcceptor(new AndClassAcceptor(acceptors));
  launchConfig.clearRunnables();
  Resources resources=findDriverResources(program.getApplicationSpecification().getSpark(),program.getApplicationSpecification().getMapReduce(),spec);
  resources=SystemArguments.getResources(options.getUserArguments(),resources);
  launchConfig.addRunnable(spec.getName(),new WorkflowTwillRunnable(spec.getName()),resources,1,0);
}