Program: 2130
Project: 2130
Buggy source:
/** 
 * This method aggregates candidate timelines
 */
@Managed(description="String_Node_Str") public void getAndProcessTimelineAggregationCandidates(){
  if (!isAggregating.compareAndSet(false,true)) {
    log.info("String_Node_Str");
    return;
  }
 else {
    log.info("String_Node_Str");
  }
  final String[] chunkCountsToAggregate=config.getChunksToAggregate().split("String_Node_Str");
  for (int aggregationLevel=0; aggregationLevel < config.getMaxAggregationLevel(); aggregationLevel++) {
    final Map<String,Long> initialCounters=captureAggregatorCounters();
    final int chunkCountIndex=aggregationLevel >= chunkCountsToAggregate.length ? chunkCountsToAggregate.length - 1 : aggregationLevel;
    final int chunksToAggregate=Integer.parseInt(chunkCountsToAggregate[chunkCountIndex]);
    final List<TimelineChunk> timelineChunkCandidates=aggregatorDao.getTimelineAggregationCandidates(aggregationLevel);
    int lastHostId=0;
    int lastSampleKindId=0;
    final List<TimelineChunk> hostTimelineCandidates=new ArrayList<TimelineChunk>();
    for (    final TimelineChunk candidate : timelineChunkCandidates) {
      timelineChunksConsidered.inc();
      final int hostId=candidate.getHostId();
      final int sampleKindId=candidate.getSampleKindId();
      if (lastHostId == 0) {
        lastHostId=hostId;
        lastSampleKindId=sampleKindId;
      }
      if (lastHostId != hostId || lastSampleKindId != sampleKindId) {
        aggregatesCreated.inc(aggregateTimelineCandidates(hostTimelineCandidates,aggregationLevel,chunksToAggregate));
        hostTimelineCandidates.clear();
        lastHostId=hostId;
        lastSampleKindId=sampleKindId;
      }
      hostTimelineCandidates.add(candidate);
    }
    if (hostTimelineCandidates.size() > 0) {
      aggregatesCreated.inc(aggregateTimelineCandidates(hostTimelineCandidates,aggregationLevel,chunksToAggregate));
    }
    final Map<String,Long> counterDeltas=subtrackFromAggregatorCounters(initialCounters);
    final StringBuilder builder=new StringBuilder();
    builder.append("String_Node_Str").append(aggregationLevel);
    for (    Map.Entry<String,Long> entry : counterDeltas.entrySet()) {
      builder.append("String_Node_Str").append(entry.getKey()).append("String_Node_Str").append(entry.getValue());
    }
    log.info(builder.toString());
  }
  log.info("String_Node_Str");
  isAggregating.set(false);
}

Fixed version (ground truth):
/** 
 * This method aggregates candidate timelines
 */
@Managed(description="String_Node_Str") public void getAndProcessTimelineAggregationCandidates(){
  if (!isAggregating.compareAndSet(false,true)) {
    log.info("String_Node_Str");
    return;
  }
 else {
    log.info("String_Node_Str");
  }
  final String[] chunkCountsToAggregate=config.getChunksToAggregate().split("String_Node_Str");
  for (int aggregationLevel=0; aggregationLevel < config.getMaxAggregationLevel(); aggregationLevel++) {
    final Map<String,Long> initialCounters=captureAggregatorCounters();
    final int chunkCountIndex=aggregationLevel >= chunkCountsToAggregate.length ? chunkCountsToAggregate.length - 1 : aggregationLevel;
    final int chunksToAggregate=Integer.parseInt(chunkCountsToAggregate[chunkCountIndex]);
    final List<TimelineChunk> timelineChunkCandidates=aggregatorDao.getTimelineAggregationCandidates(aggregationLevel);
    int lastHostId=0;
    int lastSampleKindId=0;
    final List<TimelineChunk> hostTimelineCandidates=new ArrayList<TimelineChunk>();
    for (    final TimelineChunk candidate : timelineChunkCandidates) {
      timelineChunksConsidered.inc();
      final int hostId=candidate.getHostId();
      final int sampleKindId=candidate.getSampleKindId();
      if (lastHostId == 0) {
        lastHostId=hostId;
        lastSampleKindId=sampleKindId;
      }
      if (lastHostId != hostId || lastSampleKindId != sampleKindId) {
        aggregatesCreated.inc(aggregateTimelineCandidates(hostTimelineCandidates,aggregationLevel,chunksToAggregate));
        hostTimelineCandidates.clear();
        lastHostId=hostId;
        lastSampleKindId=sampleKindId;
      }
      hostTimelineCandidates.add(candidate);
    }
    if (hostTimelineCandidates.size() > 0) {
      aggregatesCreated.inc(aggregateTimelineCandidates(hostTimelineCandidates,aggregationLevel,chunksToAggregate));
    }
    final Map<String,Long> counterDeltas=subtractFromAggregatorCounters(initialCounters);
    final StringBuilder builder=new StringBuilder();
    builder.append("String_Node_Str").append(aggregationLevel);
    for (    Map.Entry<String,Long> entry : counterDeltas.entrySet()) {
      builder.append("String_Node_Str").append(entry.getKey()).append("String_Node_Str").append(entry.getValue());
    }
    log.info(builder.toString());
  }
  log.info("String_Node_Str");
  isAggregating.set(false);
}