Program: 156233
Project: 156233
Buggy source:
/** 
 * Called after the job DAG has been created, but before any jobs are fired.
 * @param plan the MROperPlan that represents the DAG of operations. Each operation will becomea MapReduce job when it's launched.
 */
@Override public void initialPlanNotification(String scriptId,MROperPlan plan){
  log.info("String_Node_Str" + scriptId + "String_Node_Str"+ plan);
  Preconditions.checkNotNull(pigConfig.getJobClient());
  Preconditions.checkNotNull(pigConfig.getJobGraph());
  Preconditions.checkNotNull(pigConfig.getPigProperties());
  this.workflowVersion=pigConfig.getPigProperties().getProperty("String_Node_Str");
  Map<OperatorKey,MapReduceOper> planKeys=plan.getKeys();
  for (  Map.Entry<OperatorKey,MapReduceOper> entry : planKeys.entrySet()) {
    String nodeName=entry.getKey().toString();
    String[] aliases=toArray(ScriptState.get().getAlias(entry.getValue()).trim());
    String[] features=toArray(ScriptState.get().getPigFeature(entry.getValue()).trim());
    PigJob job=new PigJob();
    job.setAliases(aliases);
    job.setFeatures(features);
    DAGNode<PigJob> node=new DAGNode<PigJob>(nodeName,job);
    this.dagNodeNameMap.put(node.getName(),node);
    log.info("String_Node_Str" + Arrays.toString(aliases) + "String_Node_Str"+ node.getName()+ "String_Node_Str"+ Arrays.toString(features));
  }
  for (  Map.Entry<OperatorKey,MapReduceOper> entry : planKeys.entrySet()) {
    DAGNode node=this.dagNodeNameMap.get(entry.getKey().toString());
    List<DAGNode<? extends Job>> successorNodeList=Lists.newArrayList();
    List<MapReduceOper> successors=plan.getSuccessors(entry.getValue());
    if (successors != null) {
      for (      MapReduceOper successor : successors) {
        DAGNode<? extends Job> successorNode=this.dagNodeNameMap.get(successor.getOperatorKey().toString());
        successorNodeList.add(successorNode);
      }
    }
    node.setSuccessors(successorNodeList);
  }
  AmbroseUtils.sendDagNodeNameMap(statsWriteService,scriptId,dagNodeNameMap);
}

Fixed version (ground truth):
/** 
 * Called after the job DAG has been created, but before any jobs are fired.
 * @param plan the MROperPlan that represents the DAG of operations. Each operation will becomea MapReduce job when it's launched.
 */
@Override public void initialPlanNotification(String scriptId,MROperPlan plan){
  log.info("String_Node_Str" + scriptId + "String_Node_Str"+ plan);
  Preconditions.checkNotNull(pigConfig.getJobClient());
  Preconditions.checkNotNull(pigConfig.getJobGraph());
  Preconditions.checkNotNull(pigConfig.getPigProperties());
  statsWriteService.initialize(pigConfig.getPigProperties());
  this.workflowVersion=pigConfig.getPigProperties().getProperty("String_Node_Str");
  Map<OperatorKey,MapReduceOper> planKeys=plan.getKeys();
  for (  Map.Entry<OperatorKey,MapReduceOper> entry : planKeys.entrySet()) {
    String nodeName=entry.getKey().toString();
    String[] aliases=toArray(ScriptState.get().getAlias(entry.getValue()).trim());
    String[] features=toArray(ScriptState.get().getPigFeature(entry.getValue()).trim());
    PigJob job=new PigJob();
    job.setAliases(aliases);
    job.setFeatures(features);
    DAGNode<PigJob> node=new DAGNode<PigJob>(nodeName,job);
    this.dagNodeNameMap.put(node.getName(),node);
    log.info("String_Node_Str" + Arrays.toString(aliases) + "String_Node_Str"+ node.getName()+ "String_Node_Str"+ Arrays.toString(features));
  }
  for (  Map.Entry<OperatorKey,MapReduceOper> entry : planKeys.entrySet()) {
    DAGNode node=this.dagNodeNameMap.get(entry.getKey().toString());
    List<DAGNode<? extends Job>> successorNodeList=Lists.newArrayList();
    List<MapReduceOper> successors=plan.getSuccessors(entry.getValue());
    if (successors != null) {
      for (      MapReduceOper successor : successors) {
        DAGNode<? extends Job> successorNode=this.dagNodeNameMap.get(successor.getOperatorKey().toString());
        successorNodeList.add(successorNode);
      }
    }
    node.setSuccessors(successorNodeList);
  }
  AmbroseUtils.sendDagNodeNameMap(statsWriteService,scriptId,dagNodeNameMap);
}