Program: 7504
Project: 7504
Buggy source:
/** 
 * Build the instance of   {@link BasicMapReduceContext}.
 * @param runId program run id
 * @param logicalStartTime The logical start time of the job.
 * @param workflowBatch Tells whether the batch job is started by workflow.
 * @param tx transaction to use
 * @param classLoader classloader to use
 * @param programLocation program location
 * @param inputDataSetName name of the input dataset if specified for this mapreduce job, null otherwise
 * @param inputSplits input splits if specified for this mapreduce job, null otherwise
 * @param outputDataSetName name of the output dataset if specified for this mapreduce job, null otherwise
 * @return instance of {@link BasicMapReduceContext}
 */
public BasicMapReduceContext build(MapReduceMetrics.TaskType type,String runId,long logicalStartTime,String workflowBatch,Arguments runtimeArguments,Transaction tx,ClassLoader classLoader,URI programLocation,@Nullable String inputDataSetName,@Nullable List<Split> inputSplits,@Nullable String outputDataSetName){
}

Fixed version (ground truth):
/** 
 * Build the instance of   {@link BasicMapReduceContext}.
 * @param runId program run id
 * @param logicalStartTime The logical start time of the job.
 * @param workflowBatch Tells whether the batch job is started by workflow.
 * @param tx transaction to use
 * @param classLoader classloader to use
 * @param programLocation program location
 * @param inputDataSetName name of the input dataset if specified for this mapreduce job, null otherwise
 * @param inputSplits input splits if specified for this mapreduce job, null otherwise
 * @param outputDataSetName name of the output dataset if specified for this mapreduce job, null otherwise
 * @return instance of {@link BasicMapReduceContext}
 */
public BasicMapReduceContext build(MapReduceMetrics.TaskType type,String runId,long logicalStartTime,String workflowBatch,Arguments runtimeArguments,Transaction tx,ClassLoader classLoader,URI programLocation,@Nullable String inputDataSetName,@Nullable List<Split> inputSplits,@Nullable String outputDataSetName){
  Injector injector=prepare();
  LocationFactory locationFactory=injector.getInstance(LocationFactory.class);
  Program program;
  try {
    program=Programs.create(locationFactory.create(programLocation),classLoader);
    if (workflowBatch != null) {
      MapReduceSpecification mapReduceSpec=program.getSpecification().getMapReduce().get(workflowBatch);
      Preconditions.checkArgument(mapReduceSpec != null,"String_Node_Str",workflowBatch);
      program=new WorkflowMapReduceProgram(program,mapReduceSpec);
    }
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str" + programLocation);
    throw Throwables.propagate(e);
  }
  DatasetFramework datasetFramework=injector.getInstance(DatasetFramework.class);
  CConfiguration configuration=injector.getInstance(CConfiguration.class);
  ApplicationSpecification programSpec=program.getSpecification();
  MetricsCollectionService metricsCollectionService=(type == null) ? null : injector.getInstance(MetricsCollectionService.class);
  ProgramServiceDiscovery serviceDiscovery=injector.getInstance(ProgramServiceDiscovery.class);
  DiscoveryServiceClient discoveryServiceClient=injector.getInstance(DiscoveryServiceClient.class);
  MapReduceSpecification spec=program.getSpecification().getMapReduce().get(program.getName());
  BasicMapReduceContext context=new BasicMapReduceContext(program,type,RunIds.fromString(runId),runtimeArguments,programSpec.getDatasets().keySet(),spec,logicalStartTime,workflowBatch,serviceDiscovery,discoveryServiceClient,metricsCollectionService,datasetFramework,configuration);
  for (  TransactionAware txAware : context.getDatasetInstantiator().getTransactionAware()) {
    txAware.startTx(tx);
  }
  if (inputDataSetName != null && inputSplits != null) {
    context.setInput(inputDataSetName,inputSplits);
  }
  if (outputDataSetName != null) {
    context.setOutput(outputDataSetName);
  }
  return context;
}