Program: 5923
Project: 5923
Buggy source:
private void addProgram(String phaseName,WorkflowProgramAdder programAdder){
  PipelinePhase phase=plan.getPhase(phaseName);
  if (phase == null) {
    return;
  }
  String programName="String_Node_Str" + phaseNum;
  phaseNum++;
  for (  StageInfo connectorInfo : phase.getStagesOfType(Constants.CONNECTOR_TYPE)) {
    String connectorName=connectorInfo.getName();
    String datasetName=connectorDatasets.get(connectorName);
    if (datasetName == null) {
      datasetName=UUID.randomUUID().toString();
      connectorDatasets.put(connectorName,datasetName);
      ConnectorSource connectorSource=new ConnectorSource(datasetName,null);
      connectorSource.configure(getConfigurer());
    }
  }
  Map<String,String> phaseConnectorDatasets=new HashMap<>();
  for (  StageInfo connectorStage : phase.getStagesOfType(Constants.CONNECTOR_TYPE)) {
    phaseConnectorDatasets.put(connectorStage.getName(),connectorDatasets.get(connectorStage.getName()));
  }
  BatchPhaseSpec batchPhaseSpec=new BatchPhaseSpec(programName,phase,spec.getResources(),spec.getDriverResources(),spec.isStageLoggingEnabled(),phaseConnectorDatasets);
  boolean hasCustomAction=batchPhaseSpec.getPhase().getSources().isEmpty() && batchPhaseSpec.getPhase().getSinks().isEmpty();
  if (hasCustomAction) {
    programAdder.addAction(new PipelineAction(batchPhaseSpec));
    return;
  }
  if (useSpark) {
    applicationConfigurer.addSpark(new ETLSpark(batchPhaseSpec));
    programAdder.addSpark(programName);
  }
 else {
    applicationConfigurer.addMapReduce(new ETLMapReduce(batchPhaseSpec));
    programAdder.addMapReduce(programName);
  }
}

Fixed version (ground truth):
private void addProgram(String phaseName,WorkflowProgramAdder programAdder){
  PipelinePhase phase=plan.getPhase(phaseName);
  if (phase == null) {
    return;
  }
  String programName="String_Node_Str" + phaseNum;
  phaseNum++;
  for (  StageInfo connectorInfo : phase.getStagesOfType(Constants.CONNECTOR_TYPE)) {
    String connectorName=connectorInfo.getName();
    String datasetName=connectorDatasets.get(connectorName);
    if (datasetName == null) {
      datasetName="String_Node_Str" + connectorNum++;
      connectorDatasets.put(connectorName,datasetName);
      ConnectorSource connectorSource=new ConnectorSource(datasetName,null);
      connectorSource.configure(getConfigurer());
    }
  }
  Map<String,String> phaseConnectorDatasets=new HashMap<>();
  for (  StageInfo connectorStage : phase.getStagesOfType(Constants.CONNECTOR_TYPE)) {
    phaseConnectorDatasets.put(connectorStage.getName(),connectorDatasets.get(connectorStage.getName()));
  }
  BatchPhaseSpec batchPhaseSpec=new BatchPhaseSpec(programName,phase,spec.getResources(),spec.getDriverResources(),spec.isStageLoggingEnabled(),phaseConnectorDatasets);
  boolean hasCustomAction=batchPhaseSpec.getPhase().getSources().isEmpty() && batchPhaseSpec.getPhase().getSinks().isEmpty();
  if (hasCustomAction) {
    programAdder.addAction(new PipelineAction(batchPhaseSpec));
    return;
  }
  if (useSpark) {
    applicationConfigurer.addSpark(new ETLSpark(batchPhaseSpec));
    programAdder.addSpark(programName);
  }
 else {
    applicationConfigurer.addMapReduce(new ETLMapReduce(batchPhaseSpec));
    programAdder.addMapReduce(programName);
  }
}