X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=org.eclipse.tracecompass.tmf.core%2Fsrc%2Forg%2Feclipse%2Ftracecompass%2Ftmf%2Fcore%2Ftrace%2FTmfTrace.java;h=16f60f00a3b4e8e8da598346432141dada0cc14c;hb=6cfc180eaf303a3d46cda9dad7b190121712162a;hp=bafae0346d87d07d373bd60d2bc5cd1842def6bb;hpb=e532b4894f77517df203a8b788fae8acf9497499;p=deliverable%2Ftracecompass.git diff --git a/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/TmfTrace.java b/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/TmfTrace.java index bafae0346d..16f60f00a3 100644 --- a/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/TmfTrace.java +++ b/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/TmfTrace.java @@ -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)); }