Program: 2145
Project: 2145
Buggy source:
public Collection<? extends TimelineChunkAndTimes> getInMemoryTimelineChunkAndTimes(final String filterHostName,final List<String> filterSampleKinds,@Nullable final DateTime filterStartTime,@Nullable final DateTime filterEndTime) throws IOException, ExecutionException {
  final Integer hostId=timelineDAO.getHostId(filterHostName);
  if (hostId == null) {
    return ImmutableList.of();
  }
  final Map<String,TimelineHostEventAccumulator> hostAccumulators=accumulators.getIfPresent(hostId);
  if (hostAccumulators == null) {
    return ImmutableList.of();
  }
  final List<TimelineChunkAndTimes> samplesByHostName=new ArrayList<TimelineChunkAndTimes>();
  for (  final TimelineHostEventAccumulator accumulator : hostAccumulators.values()) {
    final List<DateTime> accumulatorTimes=accumulator.getTimes();
    final DateTime accumulatorStartTime=accumulator.getStartTime();
    final DateTime accumulatorEndTime=accumulator.getEndTime();
    if ((filterStartTime != null && accumulatorEndTime.isBefore(filterStartTime)) || (filterStartTime != null && accumulatorStartTime.isAfter(filterEndTime))) {
      return ImmutableList.of();
    }
    for (    final TimelineChunkAccumulator chunkAccumulator : accumulator.getTimelines().values()) {
      final TimelineChunkAccumulator chunkAccumulatorCopy=chunkAccumulator.deepCopy();
      final TimelineChunk timelineChunk=chunkAccumulatorCopy.extractTimelineChunkAndReset(-1,accumulatorStartTime);
      final TimelineTimes timelineTimes=new TimelineTimes(-1,hostId,accumulatorStartTime,accumulatorEndTime,accumulatorTimes);
      final String sampleKind=timelineDAO.getSampleKind(timelineChunk.getSampleKindId());
      if (!filterSampleKinds.contains(sampleKind)) {
        continue;
      }
      samplesByHostName.add(new TimelineChunkAndTimes(filterHostName,sampleKind,timelineChunk,timelineTimes));
    }
  }
  return samplesByHostName;
}

Fixed version (ground truth):
public Collection<? extends TimelineChunkAndTimes> getInMemoryTimelineChunkAndTimes(final String filterHostName,final List<String> filterSampleKinds,@Nullable final DateTime filterStartTime,@Nullable final DateTime filterEndTime) throws IOException, ExecutionException {
  final Integer hostId=timelineDAO.getHostId(filterHostName);
  if (hostId == null) {
    return ImmutableList.of();
  }
  final Map<String,TimelineHostEventAccumulator> hostAccumulators=accumulators.getIfPresent(hostId);
  if (hostAccumulators == null) {
    return ImmutableList.of();
  }
  final List<TimelineChunkAndTimes> samplesByHostName=new ArrayList<TimelineChunkAndTimes>();
  for (  final TimelineHostEventAccumulator accumulator : hostAccumulators.values()) {
    final List<DateTime> accumulatorTimes=accumulator.getTimes();
    final DateTime accumulatorStartTime=accumulator.getStartTime();
    final DateTime accumulatorEndTime=accumulator.getEndTime();
    if ((filterStartTime != null && accumulatorEndTime.isBefore(filterStartTime)) || (filterStartTime != null && accumulatorStartTime.isAfter(filterEndTime))) {
      continue;
    }
    for (    final TimelineChunkAccumulator chunkAccumulator : accumulator.getTimelines().values()) {
      final String sampleKind=timelineDAO.getSampleKind(chunkAccumulator.getSampleKindId());
      if (!filterSampleKinds.contains(sampleKind)) {
        continue;
      }
      final TimelineChunkAccumulator chunkAccumulatorCopy=chunkAccumulator.deepCopy();
      final TimelineChunk timelineChunk=chunkAccumulatorCopy.extractTimelineChunkAndReset(-1,accumulatorStartTime);
      final TimelineTimes timelineTimes=new TimelineTimes(-1,hostId,accumulatorStartTime,accumulatorEndTime,accumulatorTimes);
      samplesByHostName.add(new TimelineChunkAndTimes(filterHostName,sampleKind,timelineChunk,timelineTimes));
    }
  }
  return samplesByHostName;
}