Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGenevieve Bastien2015-02-05 18:57:01 +0000
committerAlexandre Montplaisir2015-03-06 23:28:08 +0000
commit6cfc180eaf303a3d46cda9dad7b190121712162a (patch)
treed68039e1c0f0214360c670eee97bd2df5788ca42
parente532b4894f77517df203a8b788fae8acf9497499 (diff)
downloadorg.eclipse.tracecompass-6cfc180eaf303a3d46cda9dad7b190121712162a.tar.gz
org.eclipse.tracecompass-6cfc180eaf303a3d46cda9dad7b190121712162a.tar.xz
org.eclipse.tracecompass-6cfc180eaf303a3d46cda9dad7b190121712162a.zip
TMF: Add some non null annotations to TmfTimeRange
And all the required changes and extra annotations to fix all the warnings Change-Id: Ic6f58052550f5f4fcca119ecf6c6d3e2e16d3631 Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net> Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im> Reviewed-on: https://git.eclipse.org/r/41240 Reviewed-by: Hudson CI
-rw-r--r--org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/build.properties2
-rw-r--r--org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/event/TmfTimeRangeTest.java28
-rw-r--r--org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/signal/TmfTimeSynchSignal.java21
-rw-r--r--org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/statesystem/TmfStateSystemAnalysisModule.java5
-rw-r--r--org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/timestamp/ITmfTimestamp.java2
-rw-r--r--org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/timestamp/TmfTimeRange.java19
-rw-r--r--org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/ITmfTrace.java8
-rw-r--r--org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/TmfTrace.java19
-rw-r--r--org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/TmfTraceContext.java15
-rw-r--r--org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/TmfTraceManager.java15
-rw-r--r--org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/experiment/TmfExperiment.java7
-rw-r--r--org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/indexer/checkpoint/TmfCheckpointIndexer.java3
-rw-r--r--org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/event/CtfTmfLostEventsTest.java5
-rw-r--r--org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/temp/tracemanager/TmfTraceManagerTest.java5
-rw-r--r--org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/tmf/ctf/core/trace/CtfTmfTrace.java2
-rw-r--r--org.eclipse.tracecompass.tmf.ctf.ui.swtbot.tests/build.properties2
-rw-r--r--org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/views/uml2sd/loader/TmfUml2SDSyncLoaderSignalTest.java5
-rw-r--r--org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/views/uml2sd/loader/TmfUml2SDSyncLoaderTimeTest.java23
-rw-r--r--org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/TmfEventsTable.java14
-rwxr-xr-xorg.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/uml2sd/DrawableToolTip.java11
-rw-r--r--org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/uml2sd/loader/TmfUml2SDSyncLoader.java24
21 files changed, 120 insertions, 115 deletions
diff --git a/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/build.properties b/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/build.properties
index f6ae25f5ad..cee367fdce 100644
--- a/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/build.properties
+++ b/org.eclipse.tracecompass.lttng2.kernel.ui.swtbot.tests/build.properties
@@ -15,3 +15,5 @@ bin.includes = META-INF/,\
.,\
plugin.properties,\
about.html
+additional.bundles = org.eclipse.jdt.annotation
+jars.extra.classpath = platform:/plugin/org.eclipse.jdt.annotation
diff --git a/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/event/TmfTimeRangeTest.java b/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/event/TmfTimeRangeTest.java
index 8bf52a3ad1..5dec30244c 100644
--- a/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/event/TmfTimeRangeTest.java
+++ b/org.eclipse.tracecompass.tmf.core.tests/src/org/eclipse/tracecompass/tmf/core/tests/event/TmfTimeRangeTest.java
@@ -17,7 +17,6 @@ package org.eclipse.tracecompass.tmf.core.tests.event;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
import org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp;
import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange;
@@ -45,23 +44,6 @@ public class TmfTimeRangeTest {
}
@Test
- public void testBadConstructor() {
- try {
- new TmfTimeRange(TmfTimestamp.BIG_BANG, null);
- fail("TmfTimeRange: bad end time");
- } catch (final IllegalArgumentException e) {
- // Success
- }
-
- try {
- new TmfTimeRange(null, TmfTimestamp.BIG_CRUNCH);
- fail("TmfTimeRange: bad start time");
- } catch (final IllegalArgumentException e) {
- // Success
- }
- }
-
- @Test
public void testOpenRange1() {
final ITmfTimestamp ts2 = new TmfTimestamp(12350);
final TmfTimeRange range = new TmfTimeRange(TmfTimestamp.BIG_BANG, ts2);
@@ -104,16 +86,6 @@ public class TmfTimeRangeTest {
assertEquals("endTime", TmfTimestamp.BIG_CRUNCH, range3.getEndTime());
}
- @Test
- public void testCopyConstructor2() {
- try {
- new TmfTimeRange(null);
- fail("TmfTimeRange: null argument");
- } catch (final IllegalArgumentException e) {
- // Success
- }
- }
-
// ------------------------------------------------------------------------
// hashCode
// ------------------------------------------------------------------------
diff --git a/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/signal/TmfTimeSynchSignal.java b/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/signal/TmfTimeSynchSignal.java
index fb13dca521..161b74d0b8 100644
--- a/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/signal/TmfTimeSynchSignal.java
+++ b/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/signal/TmfTimeSynchSignal.java
@@ -13,6 +13,10 @@
package org.eclipse.tracecompass.tmf.core.signal;
+import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp;
/**
@@ -23,6 +27,7 @@ import org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp;
*
* @author Francois Chouinard
*/
+@NonNullByDefault
public class TmfTimeSynchSignal extends TmfSignal {
private final ITmfTimestamp fBeginTime;
@@ -36,7 +41,7 @@ public class TmfTimeSynchSignal extends TmfSignal {
* @param ts
* Timestamp of selection
*/
- public TmfTimeSynchSignal(Object source, ITmfTimestamp ts) {
+ public TmfTimeSynchSignal(@Nullable Object source, ITmfTimestamp ts) {
super(source);
fBeginTime = ts;
fEndTime = ts;
@@ -52,7 +57,7 @@ public class TmfTimeSynchSignal extends TmfSignal {
* @param end
* Timestamp of end of selection range
*/
- public TmfTimeSynchSignal(Object source, ITmfTimestamp begin, ITmfTimestamp end) {
+ public TmfTimeSynchSignal(@Nullable Object source, ITmfTimestamp begin, ITmfTimestamp end) {
super(source);
fBeginTime = begin;
fEndTime = end;
@@ -76,15 +81,13 @@ public class TmfTimeSynchSignal extends TmfSignal {
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("[TmfTimeSynchSignal ("); //$NON-NLS-1$
- if (fBeginTime != null) {
- sb.append(fBeginTime.toString());
- if (!fBeginTime.equals(fEndTime) && fEndTime != null) {
- sb.append('-');
- sb.append(fEndTime.toString());
- }
+ sb.append(fBeginTime.toString());
+ if (!fBeginTime.equals(fEndTime)) {
+ sb.append('-');
+ sb.append(fEndTime.toString());
}
sb.append(")]"); //$NON-NLS-1$
- return sb.toString();
+ return checkNotNull(sb.toString());
}
}
diff --git a/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/statesystem/TmfStateSystemAnalysisModule.java b/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/statesystem/TmfStateSystemAnalysisModule.java
index e78ec19423..c9981a64ba 100644
--- a/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/statesystem/TmfStateSystemAnalysisModule.java
+++ b/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/statesystem/TmfStateSystemAnalysisModule.java
@@ -410,10 +410,7 @@ public abstract class TmfStateSystemAnalysisModule extends TmfAbstractAnalysisMo
fTimeRange = TmfTimeRange.ETERNITY;
final ITmfTrace trace = provider.getTrace();
if (!isCompleteTrace(trace)) {
- TmfTimeRange traceTimeRange = trace.getTimeRange();
- if (traceTimeRange != null) {
- fTimeRange = traceTimeRange;
- }
+ fTimeRange = trace.getTimeRange();
}
fStateProvider = provider;
diff --git a/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/timestamp/ITmfTimestamp.java b/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/timestamp/ITmfTimestamp.java
index 1d62a57fa4..cc6e79ac04 100644
--- a/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/timestamp/ITmfTimestamp.java
+++ b/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/timestamp/ITmfTimestamp.java
@@ -96,7 +96,7 @@ public interface ITmfTimestamp extends Comparable<ITmfTimestamp> {
* @param ts the other timestamp
* @return the time difference (this - other) as an ITmfTimestamp
*/
- ITmfTimestamp getDelta(ITmfTimestamp ts);
+ @NonNull ITmfTimestamp getDelta(ITmfTimestamp ts);
/**
* Returns if this timestamp intersects the given time range. Borders are
diff --git a/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/timestamp/TmfTimeRange.java b/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/timestamp/TmfTimeRange.java
index 308c98eabb..1f45f57837 100644
--- a/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/timestamp/TmfTimeRange.java
+++ b/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/timestamp/TmfTimeRange.java
@@ -14,6 +14,8 @@
package org.eclipse.tracecompass.tmf.core.timestamp;
import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
/**
* A utility class to define and manage time ranges.
@@ -22,6 +24,7 @@ import org.eclipse.jdt.annotation.NonNull;
*
* @see ITmfTimestamp
*/
+@NonNullByDefault
public class TmfTimeRange {
// ------------------------------------------------------------------------
@@ -31,12 +34,12 @@ public class TmfTimeRange {
/**
* The full possible time range
*/
- public static final @NonNull TmfTimeRange ETERNITY = new EternityTimeRange();
+ public static final TmfTimeRange ETERNITY = new EternityTimeRange();
/**
* The null time range
*/
- public static final @NonNull TmfTimeRange NULL_RANGE = new TmfTimeRange();
+ public static final TmfTimeRange NULL_RANGE = new TmfTimeRange();
// ------------------------------------------------------------------------
// Attributes
@@ -64,9 +67,6 @@ public class TmfTimeRange {
* @param endTime end of the time range
*/
public TmfTimeRange(final ITmfTimestamp startTime, final ITmfTimestamp endTime) {
- if (startTime == null || endTime == null) {
- throw new IllegalArgumentException();
- }
fStartTime = startTime;
fEndTime = endTime;
}
@@ -77,9 +77,6 @@ public class TmfTimeRange {
* @param range the other time range
*/
public TmfTimeRange(final TmfTimeRange range) {
- if (range == null) {
- throw new IllegalArgumentException();
- }
fStartTime = range.getStartTime();
fEndTime = range.getEndTime();
}
@@ -140,7 +137,7 @@ public class TmfTimeRange {
* @param range the other time range
* @return the intersection time range, or null if no intersection exists
*/
- public TmfTimeRange getIntersection(final TmfTimeRange range) {
+ public @Nullable TmfTimeRange getIntersection(final TmfTimeRange range) {
if (fStartTime.compareTo(range.fEndTime) > 0 || fEndTime.compareTo(range.fStartTime) < 0) {
return null; // no intersection
}
@@ -166,7 +163,7 @@ public class TmfTimeRange {
}
@Override
- public boolean equals(final Object obj) {
+ public boolean equals(final @Nullable Object obj) {
if (this == obj) {
return true;
}
@@ -217,7 +214,7 @@ public class TmfTimeRange {
}
@Override
- public TmfTimeRange getIntersection(TmfTimeRange range) {
+ public @NonNull TmfTimeRange getIntersection(TmfTimeRange range) {
return range;
}
}
diff --git a/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/ITmfTrace.java b/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/ITmfTrace.java
index f8e3efceac..7d2d768f69 100644
--- a/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/ITmfTrace.java
+++ b/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/ITmfTrace.java
@@ -286,17 +286,17 @@ public interface ITmfTrace extends ITmfEventProvider {
/**
* @return the trace time range
*/
- TmfTimeRange getTimeRange();
+ @NonNull TmfTimeRange getTimeRange();
/**
* @return the timestamp of the first trace event
*/
- ITmfTimestamp getStartTime();
+ @NonNull ITmfTimestamp getStartTime();
/**
* @return the timestamp of the last trace event
*/
- ITmfTimestamp getEndTime();
+ @NonNull ITmfTimestamp getEndTime();
/**
* @return the streaming interval in ms (0 if not a streaming trace)
@@ -431,6 +431,6 @@ public interface ITmfTrace extends ITmfEventProvider {
* The time in nanoseconds with which to create the timestamp
* @return The new timestamp
*/
- ITmfTimestamp createTimestamp(long ts);
+ @NonNull ITmfTimestamp createTimestamp(long ts);
}
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));
}
diff --git a/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/TmfTraceContext.java b/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/TmfTraceContext.java
index 7a214e6165..f5eaf4965f 100644
--- a/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/TmfTraceContext.java
+++ b/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/TmfTraceContext.java
@@ -15,6 +15,8 @@
package org.eclipse.tracecompass.tmf.core.trace;
import org.eclipse.core.resources.IFile;
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.tracecompass.tmf.core.filter.ITmfFilter;
import org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp;
import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange;
@@ -28,6 +30,7 @@ import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimestamp;
*
* @author Alexandre Montplaisir
*/
+@NonNullByDefault
final class TmfTraceContext {
static final TmfTraceContext NULL_CONTEXT =
@@ -35,10 +38,10 @@ final class TmfTraceContext {
private final TmfTimeRange fSelection;
private final TmfTimeRange fWindowRange;
- private final IFile fEditorFile;
- private final ITmfFilter fFilter;
+ private final @Nullable IFile fEditorFile;
+ private final @Nullable ITmfFilter fFilter;
- public TmfTraceContext(ITmfTimestamp beginTs, ITmfTimestamp endTs, TmfTimeRange tr, IFile editorFile) {
+ public TmfTraceContext(ITmfTimestamp beginTs, ITmfTimestamp endTs, TmfTimeRange tr, @Nullable IFile editorFile) {
fSelection = new TmfTimeRange(beginTs, endTs);
fWindowRange = tr;
fEditorFile = editorFile;
@@ -65,7 +68,7 @@ final class TmfTraceContext {
* @param filter
* The applied filter
*/
- public TmfTraceContext(TmfTraceContext prevCtx, ITmfFilter filter) {
+ public TmfTraceContext(TmfTraceContext prevCtx, @Nullable ITmfFilter filter) {
fSelection = prevCtx.fSelection;
fWindowRange = prevCtx.fWindowRange;
fEditorFile = prevCtx.fEditorFile;
@@ -84,14 +87,14 @@ final class TmfTraceContext {
return fWindowRange;
}
- public IFile getEditorFile() {
+ public @Nullable IFile getEditorFile() {
return fEditorFile;
}
/**
* @return the current filter applied to the trace
*/
- public ITmfFilter getFilter() {
+ public @Nullable ITmfFilter getFilter() {
return fFilter;
}
diff --git a/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/TmfTraceManager.java b/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/TmfTraceManager.java
index b471099fcc..9a061862fd 100644
--- a/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/TmfTraceManager.java
+++ b/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/TmfTraceManager.java
@@ -107,14 +107,14 @@ public final class TmfTraceManager {
/**
* @return The begin timestamp of selection
*/
- public ITmfTimestamp getSelectionBeginTime() {
+ public @NonNull ITmfTimestamp getSelectionBeginTime() {
return getCurrentTraceContext().getSelectionBegin();
}
/**
* @return The end timestamp of selection
*/
- public ITmfTimestamp getSelectionEndTime() {
+ public @NonNull ITmfTimestamp getSelectionEndTime() {
return getCurrentTraceContext().getSelectionEnd();
}
@@ -180,7 +180,7 @@ public final class TmfTraceManager {
return null;
}
- private TmfTraceContext getCurrentTraceContext() {
+ private @NonNull TmfTraceContext getCurrentTraceContext() {
TmfTraceContext curCtx = fTraces.get(fCurrentTrace);
if (curCtx == null) {
/* There are no traces opened at the moment. */
@@ -387,7 +387,7 @@ public final class TmfTraceManager {
for (Map.Entry<ITmfTrace, TmfTraceContext> entry : fTraces.entrySet()) {
final ITmfTrace trace = entry.getKey();
if (beginTs.intersects(getValidTimeRange(trace)) || endTs.intersects(getValidTimeRange(trace))) {
- TmfTraceContext prevCtx = entry.getValue();
+ TmfTraceContext prevCtx = NonNullUtils.checkNotNull(entry.getValue());
TmfTraceContext newCtx = new TmfTraceContext(prevCtx, beginTs, endTs);
entry.setValue(newCtx);
}
@@ -407,12 +407,15 @@ public final class TmfTraceManager {
public synchronized void timeRangeUpdated(final TmfRangeSynchSignal signal) {
for (Map.Entry<ITmfTrace, TmfTraceContext> entry : fTraces.entrySet()) {
final ITmfTrace trace = entry.getKey();
- final TmfTraceContext curCtx = entry.getValue();
+ final TmfTraceContext curCtx = NonNullUtils.checkNotNull(entry.getValue());
final TmfTimeRange validTr = getValidTimeRange(trace);
/* Determine the new time range */
- TmfTimeRange targetTr = signal.getCurrentRange().getIntersection(validTr);
+ TmfTimeRange targetTr = null;
+ if (validTr != null) {
+ targetTr = signal.getCurrentRange().getIntersection(validTr);
+ }
TmfTimeRange newTr = (targetTr == null ? curCtx.getWindowRange() : targetTr);
/* Update the values */
diff --git a/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/experiment/TmfExperiment.java b/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/experiment/TmfExperiment.java
index 5c44bc95f5..86f4171047 100644
--- a/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/experiment/TmfExperiment.java
+++ b/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/experiment/TmfExperiment.java
@@ -600,9 +600,10 @@ public class TmfExperiment extends TmfTrace implements ITmfPersistentlyIndexable
endTimestamp = trace.getEndTime();
}
}
- if (safeTimestamp != null && (lastSafeTimestamp == null || safeTimestamp.compareTo(lastSafeTimestamp) > 0)) {
- timeRange = new TmfTimeRange(startTimestamp, safeTimestamp);
- lastSafeTimestamp = safeTimestamp;
+ ITmfTimestamp safeTs = safeTimestamp;
+ if (safeTs != null && (lastSafeTimestamp == null || safeTs.compareTo(lastSafeTimestamp) > 0)) {
+ timeRange = new TmfTimeRange(startTimestamp, safeTs);
+ lastSafeTimestamp = safeTs;
} else {
timeRange = null;
}
diff --git a/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/indexer/checkpoint/TmfCheckpointIndexer.java b/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/indexer/checkpoint/TmfCheckpointIndexer.java
index 093d95b472..bfc06cb332 100644
--- a/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/indexer/checkpoint/TmfCheckpointIndexer.java
+++ b/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/indexer/checkpoint/TmfCheckpointIndexer.java
@@ -17,6 +17,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.tracecompass.internal.tmf.core.Messages;
import org.eclipse.tracecompass.internal.tmf.core.trace.indexer.TmfMemoryIndex;
import org.eclipse.tracecompass.tmf.core.component.TmfEventProvider;
@@ -239,7 +240,7 @@ public class TmfCheckpointIndexer implements ITmfTraceIndexer {
* @param startTime the new start time
* @param endTime the new end time
*/
- private void signalNewTimeRange(final ITmfTimestamp startTime, final ITmfTimestamp endTime) {
+ private void signalNewTimeRange(final @NonNull ITmfTimestamp startTime, final @NonNull ITmfTimestamp endTime) {
fTrace.broadcast(new TmfTraceUpdatedSignal(fTrace, fTrace, new TmfTimeRange(startTime, endTime), fTrace.getNbEvents()));
}
diff --git a/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/event/CtfTmfLostEventsTest.java b/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/event/CtfTmfLostEventsTest.java
index 7d1af7dd06..af2fc05569 100644
--- a/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/event/CtfTmfLostEventsTest.java
+++ b/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/event/CtfTmfLostEventsTest.java
@@ -17,6 +17,7 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;
+import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
import org.eclipse.tracecompass.tmf.core.event.ITmfLostEvent;
import org.eclipse.tracecompass.tmf.core.request.ITmfEventRequest;
@@ -176,7 +177,7 @@ public class CtfTmfLostEventsTest {
return req.getEvent();
}
- private CtfTmfEvent getOneEventTime(ITmfTimestamp ts) {
+ private CtfTmfEvent getOneEventTime(@NonNull ITmfTimestamp ts) {
OneEventRequestPerTs req = new OneEventRequestPerTs(ts);
fixture.sendRequest(req);
try {
@@ -210,7 +211,7 @@ public class CtfTmfLostEventsTest {
private CtfTmfEvent event = null;
- public OneEventRequestPerTs(ITmfTimestamp ts) {
+ public OneEventRequestPerTs(@NonNull ITmfTimestamp ts) {
super(CtfTmfEvent.class,
new TmfTimeRange(ts, TmfTimestamp.BIG_CRUNCH),
0, 1, ExecutionType.FOREGROUND);
diff --git a/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/temp/tracemanager/TmfTraceManagerTest.java b/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/temp/tracemanager/TmfTraceManagerTest.java
index 03f03eec18..9cc5927c4c 100644
--- a/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/temp/tracemanager/TmfTraceManagerTest.java
+++ b/org.eclipse.tracecompass.tmf.ctf.core.tests/src/org/eclipse/tracecompass/tmf/ctf/core/tests/temp/tracemanager/TmfTraceManagerTest.java
@@ -22,6 +22,7 @@ import java.io.File;
import java.util.Collection;
import java.util.Collections;
+import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
import org.eclipse.tracecompass.tmf.core.signal.TmfRangeSynchSignal;
import org.eclipse.tracecompass.tmf.core.signal.TmfSignalManager;
@@ -142,7 +143,7 @@ public class TmfTraceManagerTest {
TmfSignalManager.dispatchSignal(new TmfTraceSelectedSignal(this, trace));
}
- private void selectTimestamp(ITmfTimestamp ts) {
+ private void selectTimestamp(@NonNull ITmfTimestamp ts) {
TmfSignalManager.dispatchSignal(new TmfTimeSynchSignal(this, ts));
}
@@ -713,7 +714,7 @@ public class TmfTraceManagerTest {
/**
* Basically a "initial + offset" operation, but for ITmfTimetamp objects.
*/
- private static ITmfTimestamp calculateOffset(ITmfTimestamp initialTs, ITmfTimestamp offsetTs) {
+ private static @NonNull ITmfTimestamp calculateOffset(ITmfTimestamp initialTs, ITmfTimestamp offsetTs) {
long start = initialTs.normalize(0, SCALE).getValue();
long offset = offsetTs.normalize(0, SCALE).getValue();
return new TmfTimestamp(start + offset, SCALE);
diff --git a/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/tmf/ctf/core/trace/CtfTmfTrace.java b/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/tmf/ctf/core/trace/CtfTmfTrace.java
index e0d9132994..3efb9dfb2c 100644
--- a/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/tmf/ctf/core/trace/CtfTmfTrace.java
+++ b/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/tmf/ctf/core/trace/CtfTmfTrace.java
@@ -584,7 +584,7 @@ public class CtfTmfTrace extends TmfTrace
// ------------------------------------------------------------------------
@Override
- public CtfTmfTimestamp createTimestamp(long ts) {
+ public @NonNull CtfTmfTimestamp createTimestamp(long ts) {
return new CtfTmfTimestamp(getTimestampTransform().transform(ts));
}
diff --git a/org.eclipse.tracecompass.tmf.ctf.ui.swtbot.tests/build.properties b/org.eclipse.tracecompass.tmf.ctf.ui.swtbot.tests/build.properties
index 308a5fb811..1a4decb395 100644
--- a/org.eclipse.tracecompass.tmf.ctf.ui.swtbot.tests/build.properties
+++ b/org.eclipse.tracecompass.tmf.ctf.ui.swtbot.tests/build.properties
@@ -17,3 +17,5 @@ bin.includes = META-INF/,\
plugin.properties,\
about.html
src.includes = about.html
+additional.bundles = org.eclipse.jdt.annotation
+jars.extra.classpath = platform:/plugin/org.eclipse.jdt.annotation
diff --git a/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/views/uml2sd/loader/TmfUml2SDSyncLoaderSignalTest.java b/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/views/uml2sd/loader/TmfUml2SDSyncLoaderSignalTest.java
index 8b8a3ae11e..dd6cb0e66e 100644
--- a/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/views/uml2sd/loader/TmfUml2SDSyncLoaderSignalTest.java
+++ b/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/views/uml2sd/loader/TmfUml2SDSyncLoaderSignalTest.java
@@ -39,7 +39,6 @@ public class TmfUml2SDSyncLoaderSignalTest {
private static TmfTimeRange range;
private static TmfTimestamp rangeWindow;
- private static TmfTimestamp currentTime;
/**
* Initialization
@@ -52,7 +51,7 @@ public class TmfUml2SDSyncLoaderSignalTest {
range = new TmfTimeRange(new Uml2SDTestTimestamp(9789689220871L), new Uml2SDTestTimestamp(9789773881426L));
// Get range window for tests below
rangeWindow = (TmfTimestamp) range.getEndTime().getDelta(range.getStartTime());
- currentTime = new Uml2SDTestTimestamp(9789773782043L);
+ TmfTimestamp currentTime = new Uml2SDTestTimestamp(9789773782043L);
fFacility.getTrace().broadcast(new TmfRangeSynchSignal(fFacility, range));
fFacility.getTrace().broadcast(new TmfTimeSynchSignal(fFacility, currentTime));
@@ -78,7 +77,7 @@ public class TmfUml2SDSyncLoaderSignalTest {
*/
@Test
public void verifyFirstPageSignal() {
- currentTime = new Uml2SDTestTimestamp(9788641608418L);
+ TmfTimestamp currentTime = new Uml2SDTestTimestamp(9788641608418L);
range = new TmfTimeRange(currentTime, new Uml2SDTestTimestamp(currentTime.getValue() + rangeWindow.getValue()));
fTmfComponent.setSignalError(false);
diff --git a/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/views/uml2sd/loader/TmfUml2SDSyncLoaderTimeTest.java b/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/views/uml2sd/loader/TmfUml2SDSyncLoaderTimeTest.java
index be67b8a3e8..5a3f56d72d 100644
--- a/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/views/uml2sd/loader/TmfUml2SDSyncLoaderTimeTest.java
+++ b/org.eclipse.tracecompass.tmf.ui.tests/src/org/eclipse/tracecompass/tmf/ui/tests/views/uml2sd/loader/TmfUml2SDSyncLoaderTimeTest.java
@@ -20,6 +20,7 @@ import static org.junit.Assert.assertTrue;
import java.util.List;
+import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.tracecompass.tmf.core.signal.TmfRangeSynchSignal;
import org.eclipse.tracecompass.tmf.core.signal.TmfTimeSynchSignal;
import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange;
@@ -42,7 +43,7 @@ public class TmfUml2SDSyncLoaderTimeTest {
// ------------------------------------------------------------------------
// Test case 001 expected values
- final static private Uml2SDTestTimestamp TC_001_TIME_VALUE = new Uml2SDTestTimestamp(9788642228395L);
+ final static private @NonNull Uml2SDTestTimestamp TC_001_TIME_VALUE = new Uml2SDTestTimestamp(9788642228395L);
final static private String TC_001_MESSAGE_NAME = "START_GAME_REPLY";
final static private int TC_001_PAGE_VALUE = 0;
final static private int TC_001_START_OCCURRANCE = 6;
@@ -51,7 +52,7 @@ public class TmfUml2SDSyncLoaderTimeTest {
final static private String TC_001_END_LIFELINE = IUml2SDTestConstants.FIRST_PLAYER_NAME;
// Test case 002 expected values
- final static private Uml2SDTestTimestamp TC_002_TIME_VALUE = new Uml2SDTestTimestamp(9789689830722L);
+ final static private @NonNull Uml2SDTestTimestamp TC_002_TIME_VALUE = new Uml2SDTestTimestamp(9789689830722L);
final static private String TC_002_MESSAGE_NAME = "PAUSE_GAME_REQUEST";
final static private int TC_002_PAGE_VALUE = 2;
final static private int TC_002_START_OCCURRANCE = 7;
@@ -60,7 +61,7 @@ public class TmfUml2SDSyncLoaderTimeTest {
final static private String TC_002_END_LIFELINE = IUml2SDTestConstants.MASTER_PLAYER_NAME;
// Test case 003 expected values
- final static private Uml2SDTestTimestamp TC_003_TIME_VALUE = new Uml2SDTestTimestamp(9790750000000L);
+ final static private @NonNull Uml2SDTestTimestamp TC_003_TIME_VALUE = new Uml2SDTestTimestamp(9790750000000L);
final static private int TC_003_PAGE_VALUE = 4;
// Test case 004 expected values
@@ -70,28 +71,28 @@ public class TmfUml2SDSyncLoaderTimeTest {
final static private int TC_005_PAGE_VALUE = IUml2SDTestConstants.TOTAL_NUMBER_OF_PAGES - 1;
// Test case 006 expected values
- final static private Uml2SDTestTimestamp TC_006_TIME_VALUE = new Uml2SDTestTimestamp(9792420661655L);
+ final static private @NonNull Uml2SDTestTimestamp TC_006_TIME_VALUE = new Uml2SDTestTimestamp(9792420661655L);
final static private int TC_006_PAGE_VALUE = 4;
final static private int TC_006_START_OCCURRANCE = IUml2SDTestConstants.MAX_MESSEAGES_PER_PAGE;
final static private int TC_006_END_OCCURRANCE = TC_006_START_OCCURRANCE;
// Test case 007 expected values
- final static private Uml2SDTestTimestamp TC_007_TIME_VALUE = new Uml2SDTestTimestamp(9792420756010L);
+ final static private @NonNull Uml2SDTestTimestamp TC_007_TIME_VALUE = new Uml2SDTestTimestamp(9792420756010L);
final static private int TC_007_PAGE_VALUE = 5;
final static private int TC_007_START_OCCURRANCE = 1;
final static private int TC_007_END_OCCURRANCE = TC_007_START_OCCURRANCE;
// Test case 008 expected values
- final static private Uml2SDTestTimestamp TC_008_TIME_VALUE = new Uml2SDTestTimestamp(9788642228395L);
+ final static private @NonNull Uml2SDTestTimestamp TC_008_TIME_VALUE = new Uml2SDTestTimestamp(9788642228395L);
final static private int TC_008_PAGE_VALUE = 0;
- final static private Uml2SDTestTimestamp TC_008_START_TIME_VALUE = new Uml2SDTestTimestamp(9788642228395L);
- final static private Uml2SDTestTimestamp TC_008_END_TIME_VALUE = new Uml2SDTestTimestamp(9789164833324L);
+ final static private @NonNull Uml2SDTestTimestamp TC_008_START_TIME_VALUE = new Uml2SDTestTimestamp(9788642228395L);
+ final static private @NonNull Uml2SDTestTimestamp TC_008_END_TIME_VALUE = new Uml2SDTestTimestamp(9789164833324L);
// Test case 009 expected values
- final static private Uml2SDTestTimestamp TC_009_TIME_VALUE = new Uml2SDTestTimestamp(9789689220871L);
+ final static private @NonNull Uml2SDTestTimestamp TC_009_TIME_VALUE = new Uml2SDTestTimestamp(9789689220871L);
final static private int TC_009_PAGE_VALUE = 1;
- final static private Uml2SDTestTimestamp TC_009_START_TIME_VALUE = TC_009_TIME_VALUE;
- final static private Uml2SDTestTimestamp TC_009_END_TIME_VALUE = new Uml2SDTestTimestamp(9789773881426L);
+ final static private @NonNull Uml2SDTestTimestamp TC_009_START_TIME_VALUE = TC_009_TIME_VALUE;
+ final static private @NonNull Uml2SDTestTimestamp TC_009_END_TIME_VALUE = new Uml2SDTestTimestamp(9789773881426L);
// Fields used in tests
private static Uml2SDTestFacility fFacility;
diff --git a/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/TmfEventsTable.java b/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/TmfEventsTable.java
index c95b22fedf..a38ca9a778 100644
--- a/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/TmfEventsTable.java
+++ b/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/TmfEventsTable.java
@@ -106,6 +106,7 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.tracecompass.common.core.NonNullUtils;
import org.eclipse.tracecompass.internal.tmf.core.filter.TmfCollapseFilter;
import org.eclipse.tracecompass.internal.tmf.ui.Activator;
import org.eclipse.tracecompass.internal.tmf.ui.Messages;
@@ -466,18 +467,19 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
fRawViewer.selectAndReveal((Long) e.item.getData(Key.RANK));
}
if (e.item.getData(Key.TIMESTAMP) instanceof ITmfTimestamp) {
- final ITmfTimestamp ts = (ITmfTimestamp) e.item.getData(Key.TIMESTAMP);
+ final ITmfTimestamp ts = NonNullUtils.checkNotNull((ITmfTimestamp) e.item.getData(Key.TIMESTAMP));
if (fTable.getSelectionIndices().length == 1) {
fSelectedBeginTimestamp = ts;
}
- if (fSelectedBeginTimestamp != null) {
- if (fSelectedBeginTimestamp.compareTo(ts) <= 0) {
- broadcast(new TmfTimeSynchSignal(TmfEventsTable.this, fSelectedBeginTimestamp, ts));
+ ITmfTimestamp selectedBeginTimestamp = fSelectedBeginTimestamp;
+ if (selectedBeginTimestamp != null) {
+ if (selectedBeginTimestamp.compareTo(ts) <= 0) {
+ broadcast(new TmfTimeSynchSignal(TmfEventsTable.this, selectedBeginTimestamp, ts));
if (fTable.getSelectionIndices().length == 2) {
- updateStatusLine(ts.getDelta(fSelectedBeginTimestamp));
+ updateStatusLine(ts.getDelta(selectedBeginTimestamp));
}
} else {
- broadcast(new TmfTimeSynchSignal(TmfEventsTable.this, ts, fSelectedBeginTimestamp));
+ broadcast(new TmfTimeSynchSignal(TmfEventsTable.this, checkNotNull(ts), checkNotNull(fSelectedBeginTimestamp)));
updateStatusLine(fSelectedBeginTimestamp.getDelta(ts));
}
}
diff --git a/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/uml2sd/DrawableToolTip.java b/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/uml2sd/DrawableToolTip.java
index 0163ba9889..da7673250a 100755
--- a/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/uml2sd/DrawableToolTip.java
+++ b/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/uml2sd/DrawableToolTip.java
@@ -23,6 +23,7 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp;
import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange;
+import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimestamp;
import org.eclipse.tracecompass.tmf.ui.views.uml2sd.util.Messages;
/**
@@ -223,7 +224,15 @@ public class DrawableToolTip implements PaintListener {
* @param max the scale max
*/
public void showToolTip(ITmfTimestamp value, ITmfTimestamp min, ITmfTimestamp max) {
- fMinMaxRange = new TmfTimeRange(min, max);
+ ITmfTimestamp minTime = min;
+ ITmfTimestamp maxTime = max;
+ if (minTime == null) {
+ minTime = TmfTimestamp.BIG_BANG;
+ }
+ if (maxTime == null) {
+ maxTime = TmfTimestamp.BIG_CRUNCH;
+ }
+ fMinMaxRange = new TmfTimeRange(minTime, maxTime);
fCurrentValue = value;
int w = fToolTipShell.getBounds().width;
diff --git a/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/uml2sd/loader/TmfUml2SDSyncLoader.java b/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/uml2sd/loader/TmfUml2SDSyncLoader.java
index ba5e6cdb90..49ac088db7 100644
--- a/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/uml2sd/loader/TmfUml2SDSyncLoader.java
+++ b/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/uml2sd/loader/TmfUml2SDSyncLoader.java
@@ -318,20 +318,24 @@ public class TmfUml2SDSyncLoader extends TmfComponent implements IUml2SDLoader,
super.handleData(event);
ITmfSyncSequenceDiagramEvent sdEvent = getSequenceDiagramEvent(event);
+ ITmfTimestamp firstTime = fFirstTime;
+ ITmfTimestamp lastTime = fLastTime;
if (sdEvent != null) {
++fNbSeqEvents;
- if (fFirstTime == null) {
- fFirstTime = event.getTimestamp();
+ if (firstTime == null) {
+ firstTime = event.getTimestamp();
+ fFirstTime = firstTime;
}
- fLastTime = event.getTimestamp();
+ lastTime = event.getTimestamp();
+ fLastTime = lastTime;
if ((fNbSeqEvents % MAX_NUM_OF_MSG) == 0) {
fLock.lock();
try {
- fCheckPoints.add(new TmfTimeRange(fFirstTime, fLastTime));
+ fCheckPoints.add(new TmfTimeRange(firstTime, lastTime));
if (fView != null) {
fView.updateCoolBar();
}
@@ -357,11 +361,13 @@ public class TmfUml2SDSyncLoader extends TmfComponent implements IUml2SDLoader,
@Override
public void handleSuccess() {
- if ((fFirstTime != null) && (fLastTime != null)) {
+ final ITmfTimestamp firstTime = fFirstTime;
+ final ITmfTimestamp lastTime = fLastTime;
+ if ((firstTime != null) && (lastTime != null)) {
fLock.lock();
try {
- fCheckPoints.add(new TmfTimeRange(fFirstTime, fLastTime));
+ fCheckPoints.add(new TmfTimeRange(firstTime, lastTime));
if (fView != null) {
fView.updateCoolBar();
}
@@ -577,7 +583,11 @@ public class TmfUml2SDSyncLoader extends TmfComponent implements IUml2SDLoader,
StructuredSelection stSel = (StructuredSelection) sel;
if (stSel.getFirstElement() instanceof TmfSyncMessage) {
TmfSyncMessage syncMsg = ((TmfSyncMessage) stSel.getFirstElement());
- broadcast(new TmfTimeSynchSignal(this, syncMsg.getStartTime()));
+ ITmfTimestamp startTime = syncMsg.getStartTime();
+ if (startTime == null) {
+ startTime = TmfTimestamp.BIG_BANG;
+ }
+ broadcast(new TmfTimeSynchSignal(this, startTime));
}
}
}

Back to the top