Program: 36408
Project: 36408
Buggy source:
void updateExecutorStats(TopologyInfo info,MetricsState state,long now,boolean firstTime){
  long overallTransferred=0;
  long spoutTransferred=0;
  long spoutAcked=0;
  int executorsWithMetircs=0;
  int spoutExecutors=0;
  Map<String,List<Double>> comLat=new HashMap<String,List<Double>>();
  for (  ExecutorSummary es : info.get_executors()) {
    String id=es.get_component_id();
    if (Utils.isSystemId(id)) {
      continue;
    }
    ExecutorStats exeStats=es.get_stats();
    if (exeStats != null) {
      ExecutorSpecificStats specs=exeStats.get_specific();
      ComponentCommon common=Utils.getComponentCommon(topology,id);
      for (      String stream : common.get_streams().keySet()) {
        executorsWithMetircs++;
        long transferred=MetricsUtils.getTransferred(exeStats,ALL_TIME,stream);
        overallTransferred+=transferred;
        if (isSpout(specs)) {
          if (isDefaultStream(id) || isBatchStream(id)) {
            spoutExecutors++;
            spoutTransferred+=transferred;
            SpoutStats spStats=specs.get_spout();
            spoutAcked+=MetricsUtils.getSpoutAcked(spStats,ALL_TIME,stream);
            if (firstTime) {
              header.add(MetricsUtils.getSpoutAvgCompleteLatencyTitle(id));
            }
            double lat=MetricsUtils.getSpoutCompleteLatency(spStats,ALL_TIME,stream);
            MetricsUtils.addLatency(comLat,id,lat);
          }
        }
      }
    }
  }
  for (  String id : comLat.keySet()) {
    List<Double> latList=comLat.get(id);
    double avg=null == latList ? 0.0 : BenchmarkUtils.avg(latList);
    double max=null == latList ? 0.0 : BenchmarkUtils.max(latList);
    metrics.put(MetricsUtils.getSpoutAvgCompleteLatencyTitle(id),String.format(SPOUT_AVG_LATENCY_FORMAT,avg));
    metrics.put(MetricsUtils.getSpoutMaxCompleteLatencyTitle(id),String.format(SPOUT_MAX_LATENCY_FORMAT,max));
  }
  metrics.put(EXECUTORS_METRICS,Integer.toString(executorsWithMetircs));
  metrics.put(SPOUT_EXECUTORS,Integer.toString(spoutExecutors));
  long timeDiff=now - state.lastTime;
  long overallDiff=overallTransferred - state.overallTransferred;
  long spoutDiff=spoutTransferred - state.spoutTransferred;
  long throughput=(long)MetricsUtils.getThroughput(overallDiff,timeDiff);
  double throughputMB=(long)MetricsUtils.getThroughputMB(overallDiff,timeDiff,msgSize);
  long spoutThroughput=(long)MetricsUtils.getThroughput(spoutDiff,timeDiff);
  double spoutThroughputMB=(long)MetricsUtils.getThroughputMB(spoutDiff,timeDiff,msgSize);
  metrics.put(TRANSFERRED,Long.toString(overallDiff));
  metrics.put(THROUGHPUT,Long.toString(throughput));
  metrics.put(THROUGHPUT_MB,String.format(THROUGHPUT_MB_FORMAT,throughputMB));
  metrics.put(SPOUT_TRANSFERRED,Long.toString(spoutDiff));
  metrics.put(SPOUT_ACKED,Long.toString(spoutAcked));
  metrics.put(SPOUT_THROUGHPUT,Long.toString(spoutThroughput));
  metrics.put(SPOUT_THROUGHPUT_MB,String.format(SPOUT_THROUGHPUT_MB_FORMAT,spoutThroughputMB));
  state.overallTransferred=overallTransferred;
  state.spoutTransferred=spoutTransferred;
}

Fixed version (ground truth):
void updateExecutorStats(TopologyInfo info,MetricsState state,long now,boolean firstTime){
  long overallTransferred=0;
  long spoutTransferred=0;
  long spoutAcked=0;
  int executorsWithMetircs=0;
  int spoutExecutors=0;
  Map<String,List<Double>> comLat=new HashMap<String,List<Double>>();
  for (  ExecutorSummary es : info.get_executors()) {
    String id=es.get_component_id();
    LOG.debug("String_Node_Str" + id);
    if (Utils.isSystemId(id)) {
      LOG.debug("String_Node_Str" + id);
      continue;
    }
    ExecutorStats exeStats=es.get_stats();
    if (exeStats != null) {
      ExecutorSpecificStats specs=exeStats.get_specific();
      ComponentCommon common=Utils.getComponentCommon(topology,id);
      for (      String stream : common.get_streams().keySet()) {
        LOG.debug("String_Node_Str" + stream + "String_Node_Str"+ id);
        executorsWithMetircs++;
        long transferred=MetricsUtils.getTransferred(exeStats,ALL_TIME,stream);
        overallTransferred+=transferred;
        if (isSpout(specs)) {
          if (isDefaultStream(stream) || isBatchStream(stream)) {
            spoutExecutors++;
            spoutTransferred+=transferred;
            SpoutStats spStats=specs.get_spout();
            spoutAcked+=MetricsUtils.getSpoutAcked(spStats,ALL_TIME,stream);
            if (firstTime) {
              header.add(MetricsUtils.getSpoutAvgCompleteLatencyTitle(id));
            }
            double lat=MetricsUtils.getSpoutCompleteLatency(spStats,ALL_TIME,stream);
            MetricsUtils.addLatency(comLat,id,lat);
          }
        }
      }
    }
 else {
      LOG.error("String_Node_Str" + id);
    }
  }
  for (  String id : comLat.keySet()) {
    List<Double> latList=comLat.get(id);
    double avg=null == latList ? 0.0 : BenchmarkUtils.avg(latList);
    double max=null == latList ? 0.0 : BenchmarkUtils.max(latList);
    metrics.put(MetricsUtils.getSpoutAvgCompleteLatencyTitle(id),String.format(SPOUT_AVG_LATENCY_FORMAT,avg));
    metrics.put(MetricsUtils.getSpoutMaxCompleteLatencyTitle(id),String.format(SPOUT_MAX_LATENCY_FORMAT,max));
  }
  metrics.put(EXECUTORS_METRICS,Integer.toString(executorsWithMetircs));
  metrics.put(SPOUT_EXECUTORS,Integer.toString(spoutExecutors));
  long timeDiff=now - state.lastTime;
  long overallDiff=overallTransferred - state.overallTransferred;
  long spoutDiff=spoutTransferred - state.spoutTransferred;
  long throughput=(long)MetricsUtils.getThroughput(overallDiff,timeDiff);
  double throughputMB=(long)MetricsUtils.getThroughputMB(overallDiff,timeDiff,msgSize);
  long spoutThroughput=(long)MetricsUtils.getThroughput(spoutDiff,timeDiff);
  double spoutThroughputMB=(long)MetricsUtils.getThroughputMB(spoutDiff,timeDiff,msgSize);
  metrics.put(TRANSFERRED,Long.toString(overallDiff));
  metrics.put(THROUGHPUT,Long.toString(throughput));
  metrics.put(THROUGHPUT_MB,String.format(THROUGHPUT_MB_FORMAT,throughputMB));
  metrics.put(SPOUT_TRANSFERRED,Long.toString(spoutDiff));
  metrics.put(SPOUT_ACKED,Long.toString(spoutAcked));
  metrics.put(SPOUT_THROUGHPUT,Long.toString(spoutThroughput));
  metrics.put(SPOUT_THROUGHPUT_MB,String.format(SPOUT_THROUGHPUT_MB_FORMAT,spoutThroughputMB));
  state.overallTransferred=overallTransferred;
  state.spoutTransferred=spoutTransferred;
}