Source:
<code>protected @NonNull List<IMarkerEvent> getViewMarkerList(long startTime, long endTime, long resolution, @NonNull IProgressMonitor monitor) { List<IMarkerEvent> viewMarkerList = super.getViewMarkerList(startTime, endTime, resolution, monitor); List<@NonNull TimeGraphEntry> traceEntries = getEntryList(getTrace()); if (traceEntries == null) { return viewMarkerList; } List<@NonNull Long> times = StateSystemUtils.getTimes(startTime, endTime, resolution); for (TraceEntry traceEntry : Iterables.filter(traceEntries, TraceEntry.class)) { Multimap<ITimeGraphDataProvider<? extends TimeGraphEntryModel>, Long> providersToModelIds = filterGroupEntries(Utils.flatten(traceEntry), startTime, endTime); ITimeGraphDataProvider<? extends TimeGraphEntryModel> provider = traceEntry.getProvider(); if (provider instanceof IOutputAnnotationProvider) { SelectionTimeQueryFilter queryFilter = new SelectionTimeQueryFilter(times, providersToModelIds.get(provider)); TmfModelResponse<@NonNull AnnotationModel> response = ((IOutputAnnotationProvider) provider).fetchAnnotations(FetchParametersUtils.selectionTimeQueryToMap(queryFilter), new NullProgressMonitor()); AnnotationModel model = response.getModel(); if (model != null) { for (Entry<String, Collection<Annotation>> entry : model.getAnnotations().entrySet()) { String category = entry.getKey(); for (Annotation annotation : entry.getValue()) { TimeGraphState <START> timeGraphState = <END> new TimeGraphState(annotation.getTime(), annotation.getDuration(), annotation.getLabel(), annotation.getStyle()); ITimeGraphEntry markerEntry = null; if (annotation.getEntryId() != -1) { markerEntry = fEntries.get(provider, annotation.getEntryId()); } MarkerEvent markerEvent = new MarkerEvent(timeGraphState, markerEntry, category, true); viewMarkerList.add(markerEvent); } } } } } return viewMarkerList; }</code><technical_language>Do need a TimeGraphState here? is create a MarkerEvent pass annotation instead of timeGraphState constructor? I a MarkerEvent is a TimeEvent is avoid that? create timeGraphState in MarkerEvent</technical_language>

Target:
protected @NonNull List<IMarkerEvent> getViewMarkerList(long startTime, long endTime, long resolution, @NonNull IProgressMonitor monitor) { List<IMarkerEvent> viewMarkerList = super.getViewMarkerList(startTime, endTime, resolution, monitor); List<@NonNull TimeGraphEntry> traceEntries = getEntryList(getTrace()); if (traceEntries == null) { return viewMarkerList; } List<@NonNull Long> times = StateSystemUtils.getTimes(startTime, endTime, resolution); for (TraceEntry traceEntry : Iterables.filter(traceEntries, TraceEntry.class)) { Multimap<ITimeGraphDataProvider<? extends TimeGraphEntryModel>, Long> providersToModelIds = filterGroupEntries(Utils.flatten(traceEntry), startTime, endTime); ITimeGraphDataProvider<? extends TimeGraphEntryModel> provider = traceEntry.getProvider(); if (provider instanceof IOutputAnnotationProvider) { SelectionTimeQueryFilter queryFilter = new SelectionTimeQueryFilter(times, providersToModelIds.get(provider)); TmfModelResponse<@NonNull AnnotationModel> response = ((IOutputAnnotationProvider) provider).fetchAnnotations(FetchParametersUtils.selectionTimeQueryToMap(queryFilter), new NullProgressMonitor()); AnnotationModel model = response.getModel(); if (model != null) { for (Entry<String, Collection<Annotation>> entry : model.getAnnotations().entrySet()) { String category = entry.getKey(); for (Annotation annotation : entry.getValue()) { ITimeGraphEntry markerEntry = null; if (annotation.getEntryId() != -1) { markerEntry = fEntries.get(provider, annotation.getEntryId()); } MarkerEvent markerEvent = new MarkerEvent(annotation, markerEntry, category, true); viewMarkerList.add(markerEvent); } } } } } return viewMarkerList; }