TMF: Add some non null annotations to TmfTimeRange
[deliverable/tracecompass.git] / org.eclipse.tracecompass.tmf.core / src / org / eclipse / tracecompass / tmf / core / trace / TmfTrace.java
index bafae0346d87d07d373bd60d2bc5cd1842def6bb..16f60f00a3b4e8e8da598346432141dada0cc14c 100644 (file)
@@ -124,8 +124,8 @@ public abstract class TmfTrace extends TmfEventProvider implements ITmfTrace, IT
     private volatile long fNbEvents = 0;
 
     // The time span of the event stream
-    private ITmfTimestamp fStartTime = TmfTimestamp.BIG_BANG;
-    private ITmfTimestamp fEndTime = TmfTimestamp.BIG_BANG;
+    private @NonNull ITmfTimestamp fStartTime = TmfTimestamp.BIG_BANG;
+    private @NonNull ITmfTimestamp fEndTime = TmfTimestamp.BIG_BANG;
 
     // The trace streaming interval (0 = no streaming)
     private long fStreamingInterval = 0;
@@ -392,7 +392,7 @@ public abstract class TmfTrace extends TmfEventProvider implements ITmfTrace, IT
     }
 
     @Override
-    public TmfTimeRange getTimeRange() {
+    public @NonNull TmfTimeRange getTimeRange() {
         return new TmfTimeRange(fStartTime, fEndTime);
     }
 
@@ -445,7 +445,7 @@ public abstract class TmfTrace extends TmfEventProvider implements ITmfTrace, IT
      *
      * @param range the new time range
      */
-    protected void setTimeRange(final TmfTimeRange range) {
+    protected void setTimeRange(final @NonNull TmfTimeRange range) {
         fStartTime = range.getStartTime();
         fEndTime = range.getEndTime();
     }
@@ -455,7 +455,7 @@ public abstract class TmfTrace extends TmfEventProvider implements ITmfTrace, IT
      *
      * @param startTime the new first event timestamp
      */
-    protected void setStartTime(final ITmfTimestamp startTime) {
+    protected void setStartTime(final @NonNull ITmfTimestamp startTime) {
         fStartTime = startTime;
     }
 
@@ -464,7 +464,7 @@ public abstract class TmfTrace extends TmfEventProvider implements ITmfTrace, IT
      *
      * @param endTime the new last event timestamp
      */
-    protected void setEndTime(final ITmfTimestamp endTime) {
+    protected void setEndTime(final @NonNull ITmfTimestamp endTime) {
         fEndTime = endTime;
     }
 
@@ -550,7 +550,8 @@ public abstract class TmfTrace extends TmfEventProvider implements ITmfTrace, IT
         // parseEvent() does not update the context
         final ITmfEvent event = parseEvent(context);
         if (event != null) {
-            updateAttributes(context, event.getTimestamp());
+            ITmfTimestamp timestamp = event.getTimestamp();
+            updateAttributes(context, timestamp);
             context.setLocation(getCurrentLocation());
             context.increaseRank();
         }
@@ -563,7 +564,7 @@ public abstract class TmfTrace extends TmfEventProvider implements ITmfTrace, IT
      * @param context the current trace context
      * @param timestamp the corresponding timestamp
      */
-    protected synchronized void updateAttributes(final ITmfContext context, final ITmfTimestamp timestamp) {
+    protected synchronized void updateAttributes(final ITmfContext context, final @NonNull ITmfTimestamp timestamp) {
         if (fStartTime.equals(TmfTimestamp.BIG_BANG) || (fStartTime.compareTo(timestamp) > 0)) {
             fStartTime = timestamp;
         }
@@ -704,7 +705,7 @@ public abstract class TmfTrace extends TmfEventProvider implements ITmfTrace, IT
     }
 
     @Override
-    public ITmfTimestamp createTimestamp(long ts) {
+    public @NonNull ITmfTimestamp createTimestamp(long ts) {
         return new TmfNanoTimestamp(getTimestampTransform().transform(ts));
     }
 
This page took 0.025456 seconds and 5 git commands to generate.