Program: 130268
Project: 130268
Buggy source:
/** 
 * Sets the job counter map.
 * @param processName the process name
 * @param response the response
 * @param loader the loader
 * @throws IOException Signals that an I/O exception has occurred.
 */
public static void setJobCounterBeans(String processName,String response,Loader loader) throws IOException {
  YamlLoader yamlLoader=(YamlLoader)loader;
  List<String> jobs=new LinkedList<String>();
  Map<String,String> map=null;
  BufferedReader reader=new BufferedReader(new StringReader(response));
  String line=null;
  String jobName=null;
  boolean isYarnJob=false;
  JobCounterBean jobCounterBean=new JobCounterBean();
  isYarnJob=FileUtil.getPropertyFromFile(fetchClusterConfigurationProperties(loader),HADOOP_TYPE).equalsIgnoreCase("String_Node_Str");
  while (true) {
    line=reader.readLine();
    if (line == null) {
      break;
    }
    map=new HashMap<String,String>();
    if (line.contains(RUNNING_JOB)) {
      jobName=line.split(RUNNING_JOB)[1];
      jobs.add(jobName);
    }
 else     if (line.contains(COUNTERS)) {
      int count=new Integer(line.split(COUNTERS)[1].trim());
      while (count > 0) {
        line=reader.readLine();
        if (line == null) {
          break;
        }
        if (line.contains("String_Node_Str")) {
          String[] counterDetail=null;
          if (isYarnJob) {
            counterDetail=line.split("String_Node_Str");
          }
 else {
            counterDetail=line.split(MAPRED_JOBCLIENT)[1].split("String_Node_Str");
          }
          map.put(counterDetail[0].trim(),counterDetail[1].trim());
          count--;
        }
      }
      jobCounterBean.setProcessName(processName);
      jobCounterBean.setJobName(jobName);
      jobCounterBean.setJobStatsMap(map);
      jobCounterBeans.add(jobCounterBean);
      jobName=null;
    }
 else     if (line.contains("String_Node_Str") || line.contains("String_Node_Str")) {
      processExceptionCondition(processName,map,reader,jobName,line);
    }
  }
  if (reader != null) {
    reader.close();
  }
}

Fixed version (ground truth):
/** 
 * Sets the job counter map.
 * @param processName the process name
 * @param response the response
 * @param loader the loader
 * @throws IOException Signals that an I/O exception has occurred.
 */
public void setJobCounterBeans(String processName,String response,Loader loader) throws IOException {
  YamlLoader yamlLoader=(YamlLoader)loader;
  List<String> jobs=new LinkedList<String>();
  Map<String,String> map=null;
  BufferedReader reader=new BufferedReader(new StringReader(response));
  String line=null;
  String jobName=null;
  boolean isYarnJob=false;
  JobCounterBean jobCounterBean=new JobCounterBean();
  isYarnJob=FileUtil.getPropertyFromFile(fetchClusterConfigurationProperties(loader),HADOOP_TYPE).equalsIgnoreCase("String_Node_Str");
  while (true) {
    line=reader.readLine();
    if (line == null) {
      break;
    }
    map=new HashMap<String,String>();
    if (line.contains(RUNNING_JOB)) {
      jobName=line.split(RUNNING_JOB)[1];
      jobs.add(jobName);
    }
 else     if (line.contains(COUNTERS)) {
      int count=new Integer(line.split(COUNTERS)[1].trim());
      while (count > 0) {
        line=reader.readLine();
        if (line == null) {
          break;
        }
        if (line.contains("String_Node_Str")) {
          String[] counterDetail=null;
          if (isYarnJob) {
            counterDetail=line.split("String_Node_Str");
          }
 else {
            counterDetail=line.split(MAPRED_JOBCLIENT)[1].split("String_Node_Str");
          }
          map.put(counterDetail[0].trim(),counterDetail[1].trim());
          count--;
        }
      }
      jobCounterBean.setProcessName(processName);
      jobCounterBean.setJobName(jobName);
      jobCounterBean.setJobStatsMap(map);
      jobCounterBeans.add(jobCounterBean);
      jobName=null;
    }
 else     if (line.contains("String_Node_Str") || line.contains("String_Node_Str")) {
      processExceptionCondition(processName,map,reader,jobName,line);
    }
  }
  if (reader != null) {
    reader.close();
  }
}