From 5f152b9905ec59806e725716f7a4996e7c76638b Mon Sep 17 00:00:00 2001 From: Patrick Tasse Date: Thu, 18 Feb 2016 10:49:02 -0500 Subject: [PATCH] tmf: Annotate list elements as @NonNull in IMarkerEventSource Change-Id: I83946811d96c2d1e30869086ae83ccdeda45597c Signed-off-by: Patrick Tasse Reviewed-on: https://git.eclipse.org/r/66828 Reviewed-by: Hudson CI Reviewed-by: Jean-Christian Kouame --- .../tmf/ui/markers/LostEventsMarkerEventSource.java | 10 +++++----- .../ui/widgets/timegraph/model/IMarkerEventSource.java | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/markers/LostEventsMarkerEventSource.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/markers/LostEventsMarkerEventSource.java index 7e30793bc8..61d9364b23 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/markers/LostEventsMarkerEventSource.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/markers/LostEventsMarkerEventSource.java @@ -42,13 +42,13 @@ import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.MarkerEvent; */ public class LostEventsMarkerEventSource implements IMarkerEventSource { - private static final String LOST_EVENTS = Messages.MarkerEvent_LostEvents; + private static final @NonNull String LOST_EVENTS = checkNotNull(Messages.MarkerEvent_LostEvents); private static final RGBA COLOR = new RGBA(255, 0, 0, 50); private final @NonNull ITmfTrace fTrace; private long[] fLastRequest; - private @NonNull List fLastMarkers = Collections.emptyList(); + private @NonNull List<@NonNull IMarkerEvent> fLastMarkers = Collections.emptyList(); /** * Constructor. @@ -61,12 +61,12 @@ public class LostEventsMarkerEventSource implements IMarkerEventSource { } @Override - public List getMarkerCategories() { + public @NonNull List<@NonNull String> getMarkerCategories() { return Arrays.asList(LOST_EVENTS); } @Override - public synchronized List getMarkerList(String category, long startTime, long endTime, long resolution, IProgressMonitor monitor) { + public synchronized @NonNull List<@NonNull IMarkerEvent> getMarkerList(@NonNull String category, long startTime, long endTime, long resolution, @NonNull IProgressMonitor monitor) { if (!category.equals(LOST_EVENTS)) { return Collections.emptyList(); } @@ -82,7 +82,7 @@ public class LostEventsMarkerEventSource implements IMarkerEventSource { if (Arrays.equals(request, fLastRequest)) { return fLastMarkers; } - List markers = new ArrayList<>(); + List<@NonNull IMarkerEvent> markers = new ArrayList<>(); try { long start = Math.max(startTime, ss.getStartTime()); long end = Math.min(endTime, ss.getCurrentEndTime()); diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/widgets/timegraph/model/IMarkerEventSource.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/widgets/timegraph/model/IMarkerEventSource.java index d9d2d43ec3..632ae9a8ed 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/widgets/timegraph/model/IMarkerEventSource.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/widgets/timegraph/model/IMarkerEventSource.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2015 Ericsson + * Copyright (c) 2015, 2016 Ericsson * * All rights reserved. This program and the accompanying materials are * made available under the terms of the Eclipse Public License v1.0 which @@ -29,7 +29,7 @@ public interface IMarkerEventSource { * * @return The list of marker categories */ - @NonNull List getMarkerCategories(); + @NonNull List<@NonNull String> getMarkerCategories(); /** * Gets the list of marker events of a specific category that intersect the @@ -51,6 +51,6 @@ public interface IMarkerEventSource { * The progress monitor object * @return The list of marker events */ - @NonNull List getMarkerList(@NonNull String category, long startTime, long endTime, long resolution, @NonNull IProgressMonitor monitor); + @NonNull List<@NonNull IMarkerEvent> getMarkerList(@NonNull String category, long startTime, long endTime, long resolution, @NonNull IProgressMonitor monitor); } -- 2.34.1