protected void mergeDuration(Duration old, Duration duration) { old.setValue(duration.getValue()); old.setCount(old.getCount() + duration.getCount()); List<String> messages = old.getMessages(); if (messages.size() < SIZE) { messages.addAll(duration.getMessages()); if (messages.size() > SIZE) { messages = messages.subList(0, SIZE); } } }
@Override public void visitDuration(Duration duration) { int value = duration.getValue(); Duration temp = m_currentEntry.findOrCreateDuration(value); mergeDuration(temp, duration); }