Program: 2143
Project: 2143
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 int chunkCountIndex=aggregationLevel >= chunkCountsToAggregate.length ? chunkCountsToAggregate.length - 1 : aggregationLevel;
    final int chunksToAggregate=Integer.parseInt(chunkCountsToAggregate[chunkCountIndex]);
    final List<TimelineTimes> timelineTimesCandidates=aggregatorDao.getTimelineTimesAggregationCandidates(aggregationLevel);
    int lastHostId=0;
    int lastEventCategoryId=0;
    final List<TimelineTimes> hostTimelineCandidates=new ArrayList<TimelineTimes>();
    for (    final TimelineTimes candidate : timelineTimesCandidates) {
      final int hostId=candidate.getHostId();
      final int eventCategoryId=candidate.getEventCategoryId();
      if (lastHostId == 0) {
        lastHostId=hostId;
        lastEventCategoryId=eventCategoryId;
      }
      if (lastHostId != hostId || lastEventCategoryId != eventCategoryId) {
        aggregatesCreated.inc(aggregateTimelineCandidates(hostTimelineCandidates,aggregationLevel,chunksToAggregate));
        hostTimelineCandidates.clear();
        lastHostId=hostId;
        lastEventCategoryId=eventCategoryId;
      }
      hostTimelineCandidates.add(candidate);
    }
    aggregatesCreated.inc(aggregateTimelineCandidates(hostTimelineCandidates,aggregationLevel,chunksToAggregate));
  }
  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() - 1; aggregationLevel++) {
    final int chunkCountIndex=aggregationLevel >= chunkCountsToAggregate.length ? chunkCountsToAggregate.length - 1 : aggregationLevel;
    final int chunksToAggregate=Integer.parseInt(chunkCountsToAggregate[chunkCountIndex]);
    final List<TimelineTimes> timelineTimesCandidates=aggregatorDao.getTimelineTimesAggregationCandidates(aggregationLevel);
    int lastHostId=0;
    int lastEventCategoryId=0;
    final List<TimelineTimes> hostTimelineCandidates=new ArrayList<TimelineTimes>();
    for (    final TimelineTimes candidate : timelineTimesCandidates) {
      final int hostId=candidate.getHostId();
      final int eventCategoryId=candidate.getEventCategoryId();
      if (lastHostId == 0) {
        lastHostId=hostId;
        lastEventCategoryId=eventCategoryId;
      }
      if (lastHostId != hostId || lastEventCategoryId != eventCategoryId) {
        aggregatesCreated.inc(aggregateTimelineCandidates(hostTimelineCandidates,aggregationLevel,chunksToAggregate));
        hostTimelineCandidates.clear();
        lastHostId=hostId;
        lastEventCategoryId=eventCategoryId;
      }
      hostTimelineCandidates.add(candidate);
    }
    aggregatesCreated.inc(aggregateTimelineCandidates(hostTimelineCandidates,aggregationLevel,chunksToAggregate));
  }
  log.info("String_Node_Str");
  isAggregating.set(false);
}