Program: 130262
Project: 130262
Buggy source:
/** 
 * @param jobInfo contains the details of the job.
 * @param additionalJobInfo contains the cpuusage,memory usage and task type details.
 * @return the job output containing the details of each phase.
 */
@SuppressWarnings("String_Node_Str") private JobOutput getJobOutput(JobInfo jobInfo){
  JobOutput jobOutput=new JobOutput();
  jobOutput.setJobID(jobInfo.getJobId().toString());
  jobOutput.setJobName(jobInfo.getJobname());
  jobOutput.setUser(jobInfo.getUsername());
  jobOutput.setOutcome(jobInfo.getJobStatus());
  long referencedZeroTime=jobInfo.getSubmitTime();
  long startTime=jobInfo.getSubmitTime();
  long finishTime=jobInfo.getFinishTime();
  long timeInMilliSec=(finishTime - startTime);
  long totalTimeInSecs=timeInMilliSec / CONVERSION_FACTOR_MILLISECS_TO_SECS;
  jobOutput.setTotalTime(totalTimeInSecs);
  LOGGER.info("String_Node_Str" + jobOutput.getTotalTime());
  jobOutput.setTotalTimeInMilliSec(timeInMilliSec);
  PhaseOutput phaseOutput=new PhaseOutput();
  PhaseDetails mapPhaseDetails=new PhaseDetails();
  PhaseDetails reducePhaseDetails=new PhaseDetails();
  Map<TaskAttemptID,TaskAttemptInfo> tasks=jobInfo.getAllCompletedTaskAttempts();
  List<TaskOutputDetails> mapTaskOutputDetails=new ArrayList<TaskOutputDetails>();
  List<TaskOutputDetails> reduceTaskOutputDetails=new ArrayList<TaskOutputDetails>();
  TaskOutputDetails mapTaskDetails=null;
  TaskOutputDetails reduceTaskDetails=null;
  for (  Map.Entry<TaskAttemptID,TaskAttemptInfo> task : tasks.entrySet()) {
    if (TaskType.MAP.equals(task.getKey().getTaskType())) {
      mapTaskDetails=addMapPhaseDetails(task,referencedZeroTime);
      mapTaskOutputDetails.add(mapTaskDetails);
    }
 else     if (TaskType.REDUCE.equals(task.getKey().getTaskType())) {
      reduceTaskDetails=addReducePhaseDetails(task,referencedZeroTime);
      reduceTaskOutputDetails.add(reduceTaskDetails);
    }
  }
  mapPhaseDetails.setTaskOutputDetails(mapTaskOutputDetails);
  long mapDataFlowRate=calculateAvgDataFlow(mapTaskOutputDetails);
  mapPhaseDetails.setAvgDataFlowRate(mapDataFlowRate);
  phaseOutput.setMapDetails(mapPhaseDetails);
  reducePhaseDetails.setTaskOutputDetails(reduceTaskOutputDetails);
  long reduceDataFlowRate=calculateAvgDataFlow(reduceTaskOutputDetails);
  reducePhaseDetails.setAvgDataFlowRate(reduceDataFlowRate);
  phaseOutput.setReduceDetails(reducePhaseDetails);
  PhaseDetails setupDetails=prepareSetupDetails(jobInfo,tasks);
  phaseOutput.setSetupDetails(setupDetails);
  PhaseDetails cleanupDetails=prepareCleanupDetails(jobInfo,tasks);
  phaseOutput.setCleanupDetails(cleanupDetails);
  jobOutput.setPhaseOutput(phaseOutput);
  return jobOutput;
}

Fixed version (ground truth):
/** 
 * @param jobInfo contains the details of the job.
 * @param additionalJobInfo contains the cpuusage,memory usage and task type details.
 * @return the job output containing the details of each phase.
 */
@SuppressWarnings("String_Node_Str") private JobOutput getJobOutput(JobInfo jobInfo){
  JobOutput jobOutput=new JobOutput();
  jobOutput.setJobID(jobInfo.getJobId().toString());
  jobOutput.setJobName(jobInfo.getJobname());
  jobOutput.setUser(jobInfo.getUsername());
  jobOutput.setOutcome(jobInfo.getJobStatus());
  long referencedZeroTime=jobInfo.getSubmitTime();
  long startTime=jobInfo.getSubmitTime();
  long finishTime=jobInfo.getFinishTime();
  long timeInMilliSec=(finishTime - startTime);
  long totalTimeInSecs=timeInMilliSec / CONVERSION_FACTOR_MILLISECS_TO_SECS;
  jobOutput.setTotalTime(totalTimeInSecs);
  jobOutput.setTotalTimeInMilliSec(timeInMilliSec);
  PhaseOutput phaseOutput=new PhaseOutput();
  PhaseDetails mapPhaseDetails=new PhaseDetails();
  PhaseDetails reducePhaseDetails=new PhaseDetails();
  Map<TaskAttemptID,TaskAttemptInfo> tasks=jobInfo.getAllCompletedTaskAttempts();
  List<TaskOutputDetails> mapTaskOutputDetails=new ArrayList<TaskOutputDetails>();
  List<TaskOutputDetails> reduceTaskOutputDetails=new ArrayList<TaskOutputDetails>();
  TaskOutputDetails mapTaskDetails=null;
  TaskOutputDetails reduceTaskDetails=null;
  for (  Map.Entry<TaskAttemptID,TaskAttemptInfo> task : tasks.entrySet()) {
    if (TaskType.MAP.equals(task.getKey().getTaskType())) {
      mapTaskDetails=addMapPhaseDetails(task,referencedZeroTime);
      mapTaskOutputDetails.add(mapTaskDetails);
    }
 else     if (TaskType.REDUCE.equals(task.getKey().getTaskType())) {
      reduceTaskDetails=addReducePhaseDetails(task,referencedZeroTime);
      reduceTaskOutputDetails.add(reduceTaskDetails);
    }
  }
  mapPhaseDetails.setTaskOutputDetails(mapTaskOutputDetails);
  long mapDataFlowRate=calculateAvgDataFlow(mapTaskOutputDetails);
  mapPhaseDetails.setAvgDataFlowRate(mapDataFlowRate);
  phaseOutput.setMapDetails(mapPhaseDetails);
  reducePhaseDetails.setTaskOutputDetails(reduceTaskOutputDetails);
  long reduceDataFlowRate=calculateAvgDataFlow(reduceTaskOutputDetails);
  reducePhaseDetails.setAvgDataFlowRate(reduceDataFlowRate);
  phaseOutput.setReduceDetails(reducePhaseDetails);
  PhaseDetails setupDetails=prepareSetupDetails(jobInfo,tasks);
  phaseOutput.setSetupDetails(setupDetails);
  PhaseDetails cleanupDetails=prepareCleanupDetails(jobInfo,tasks);
  phaseOutput.setCleanupDetails(cleanupDetails);
  jobOutput.setPhaseOutput(phaseOutput);
  return jobOutput;
}