Program: 5658
Project: 5658
Buggy source:
@Override protected ProgramController launch(Program program,ProgramOptions options,Map<String,LocalizeResource> localizeResources,File tempDir,ApplicationLauncher launcher){
  ApplicationSpecification appSpec=program.getApplicationSpecification();
  Preconditions.checkNotNull(appSpec,"String_Node_Str");
  ProgramType processorType=program.getType();
  Preconditions.checkNotNull(processorType,"String_Node_Str");
  Preconditions.checkArgument(processorType == ProgramType.WORKFLOW,"String_Node_Str");
  WorkflowSpecification workflowSpec=appSpec.getWorkflows().get(program.getName());
  Preconditions.checkNotNull(workflowSpec,"String_Node_Str",program.getName());
  List<String> extraClassPaths=new ArrayList<>();
  List<Class<?>> extraDependencies=new ArrayList<>();
  extraDependencies.add(YarnClientProtocolProvider.class);
  DriverMeta driverMeta=findDriverResources(program.getApplicationSpecification().getSpark(),program.getApplicationSpecification().getMapReduce(),workflowSpec);
  ProgramRuntimeProvider provider=runtimeProviderLoader.get(ProgramType.SPARK);
  if (provider != null) {
    try {
      String sparkAssemblyJarName=SparkUtils.prepareSparkResources(tempDir,localizeResources);
      extraClassPaths.add(sparkAssemblyJarName);
      extraDependencies.add(provider.getClass());
    }
 catch (    Exception e) {
      if (driverMeta.hasSpark) {
        throw e;
      }
      LOG.debug("String_Node_Str",program.getId(),e);
    }
  }
 else   if (driverMeta.hasSpark) {
    throw new IllegalStateException("String_Node_Str");
  }
  extraClassPaths.addAll(MapReduceContainerHelper.localizeFramework(hConf,localizeResources));
  LOG.info("String_Node_Str" + program.getName() + "String_Node_Str"+ workflowSpec.getName());
  TwillController controller=launcher.launch(new WorkflowTwillApplication(program,options.getUserArguments(),workflowSpec,localizeResources,eventHandler,driverMeta.resources),extraClassPaths,extraDependencies);
  return createProgramController(controller,program.getId(),ProgramRunners.getRunId(options));
}

Fixed version (ground truth):
@Override protected ProgramController launch(Program program,ProgramOptions options,Map<String,LocalizeResource> localizeResources,File tempDir,ApplicationLauncher launcher){
  ApplicationSpecification appSpec=program.getApplicationSpecification();
  Preconditions.checkNotNull(appSpec,"String_Node_Str");
  ProgramType processorType=program.getType();
  Preconditions.checkNotNull(processorType,"String_Node_Str");
  Preconditions.checkArgument(processorType == ProgramType.WORKFLOW,"String_Node_Str");
  WorkflowSpecification workflowSpec=appSpec.getWorkflows().get(program.getName());
  Preconditions.checkNotNull(workflowSpec,"String_Node_Str",program.getName());
  List<String> extraClassPaths=new ArrayList<>();
  List<Class<?>> extraDependencies=new ArrayList<>();
  extraDependencies.add(YarnClientProtocolProvider.class);
  if (SecureStoreUtils.isKMSBacked(cConf) && SecureStoreUtils.isKMSCapable()) {
    extraDependencies.add(SecureStoreUtils.getKMSSecureStore());
  }
  DriverMeta driverMeta=findDriverResources(program.getApplicationSpecification().getSpark(),program.getApplicationSpecification().getMapReduce(),workflowSpec);
  ProgramRuntimeProvider provider=runtimeProviderLoader.get(ProgramType.SPARK);
  if (provider != null) {
    try {
      String sparkAssemblyJarName=SparkUtils.prepareSparkResources(tempDir,localizeResources);
      extraClassPaths.add(sparkAssemblyJarName);
      extraDependencies.add(provider.getClass());
    }
 catch (    Exception e) {
      if (driverMeta.hasSpark) {
        throw e;
      }
      LOG.debug("String_Node_Str",program.getId(),e);
    }
  }
 else   if (driverMeta.hasSpark) {
    throw new IllegalStateException("String_Node_Str");
  }
  extraClassPaths.addAll(MapReduceContainerHelper.localizeFramework(hConf,localizeResources));
  LOG.info("String_Node_Str" + program.getName() + "String_Node_Str"+ workflowSpec.getName());
  TwillController controller=launcher.launch(new WorkflowTwillApplication(program,options.getUserArguments(),workflowSpec,localizeResources,eventHandler,driverMeta.resources),extraClassPaths,extraDependencies);
  return createProgramController(controller,program.getId(),ProgramRunners.getRunId(options));
}