tmf: Annotate list elements as @NonNull in IMarkerEventSource
authorPatrick Tasse <patrick.tasse@gmail.com>
Thu, 18 Feb 2016 15:49:02 +0000 (10:49 -0500)
committerPatrick Tasse <patrick.tasse@gmail.com>
Fri, 19 Feb 2016 00:39:44 +0000 (19:39 -0500)
Change-Id: I83946811d96c2d1e30869086ae83ccdeda45597c
Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/66828
Reviewed-by: Hudson CI
Reviewed-by: Jean-Christian Kouame <jean-christian.kouame@ericsson.com>
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/markers/LostEventsMarkerEventSource.java
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/widgets/timegraph/model/IMarkerEventSource.java

index 7e30793bc8eef5add4b7548dcd4ad39212c98fe0..61d9364b23da1f528bb4cd2e30e3852bd6f8f9c6 100644 (file)
@@ -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<IMarkerEvent> fLastMarkers = Collections.emptyList();
+    private @NonNull List<@NonNull IMarkerEvent> fLastMarkers = Collections.emptyList();
 
     /**
      * Constructor.
@@ -61,12 +61,12 @@ public class LostEventsMarkerEventSource implements IMarkerEventSource {
     }
 
     @Override
-    public List<String> getMarkerCategories() {
+    public @NonNull List<@NonNull String> getMarkerCategories() {
         return Arrays.asList(LOST_EVENTS);
     }
 
     @Override
-    public synchronized List<IMarkerEvent> 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<IMarkerEvent> markers = new ArrayList<>();
+        List<@NonNull IMarkerEvent> markers = new ArrayList<>();
         try {
             long start = Math.max(startTime, ss.getStartTime());
             long end = Math.min(endTime, ss.getCurrentEndTime());
index d9d2d43ec317343d460c68e122dd090921c73cca..632ae9a8ed70873e86a57b1f55d514c765abf4b0 100644 (file)
@@ -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<String> 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<IMarkerEvent> 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);
 
 }
This page took 0.027878 seconds and 5 git commands to generate.