.,\
plugin.properties,\
about.html
+additional.bundles = org.eclipse.jdt.annotation
+jars.extra.classpath = platform:/plugin/org.eclipse.jdt.annotation
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;
assertEquals("endTime", ts2, range.getEndTime());
}
- @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);
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
// ------------------------------------------------------------------------
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;
/**
*
* @author Francois Chouinard
*/
+@NonNullByDefault
public class TmfTimeSynchSignal extends TmfSignal {
private final ITmfTimestamp fBeginTime;
* @param ts
* Timestamp of selection
*/
- public TmfTimeSynchSignal(Object source, ITmfTimestamp ts) {
+ public TmfTimeSynchSignal(@Nullable Object source, ITmfTimestamp ts) {
super(source);
fBeginTime = ts;
fEndTime = ts;
* @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;
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());
}
}
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;
* @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
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.
*
* @see ITmfTimestamp
*/
+@NonNullByDefault
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
* @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;
}
* @param range the other time range
*/
public TmfTimeRange(final TmfTimeRange range) {
- if (range == null) {
- throw new IllegalArgumentException();
- }
fStartTime = range.getStartTime();
fEndTime = range.getEndTime();
}
* @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
}
}
@Override
- public boolean equals(final Object obj) {
+ public boolean equals(final @Nullable Object obj) {
if (this == obj) {
return true;
}
}
@Override
- public TmfTimeRange getIntersection(TmfTimeRange range) {
+ public @NonNull TmfTimeRange getIntersection(TmfTimeRange range) {
return range;
}
}
/**
* @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)
* The time in nanoseconds with which to create the timestamp
* @return The new timestamp
*/
- ITmfTimestamp createTimestamp(long ts);
+ @NonNull ITmfTimestamp createTimestamp(long ts);
}
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;
}
@Override
- public TmfTimeRange getTimeRange() {
+ public @NonNull TmfTimeRange getTimeRange() {
return new TmfTimeRange(fStartTime, fEndTime);
}
*
* @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();
}
*
* @param startTime the new first event timestamp
*/
- protected void setStartTime(final ITmfTimestamp startTime) {
+ protected void setStartTime(final @NonNull ITmfTimestamp startTime) {
fStartTime = startTime;
}
*
* @param endTime the new last event timestamp
*/
- protected void setEndTime(final ITmfTimestamp endTime) {
+ protected void setEndTime(final @NonNull ITmfTimestamp endTime) {
fEndTime = endTime;
}
// 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();
}
* @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;
}
}
@Override
- public ITmfTimestamp createTimestamp(long ts) {
+ public @NonNull ITmfTimestamp createTimestamp(long ts) {
return new TmfNanoTimestamp(getTimestampTransform().transform(ts));
}
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;
*
* @author Alexandre Montplaisir
*/
+@NonNullByDefault
final class TmfTraceContext {
static final TmfTraceContext NULL_CONTEXT =
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;
* @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;
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;
}
/**
* @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();
}
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. */
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);
}
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 */
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;
}
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;
* @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()));
}
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;
return req.getEvent();
}
- private CtfTmfEvent getOneEventTime(ITmfTimestamp ts) {
+ private CtfTmfEvent getOneEventTime(@NonNull ITmfTimestamp ts) {
OneEventRequestPerTs req = new OneEventRequestPerTs(ts);
fixture.sendRequest(req);
try {
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);
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;
TmfSignalManager.dispatchSignal(new TmfTraceSelectedSignal(this, trace));
}
- private void selectTimestamp(ITmfTimestamp ts) {
+ private void selectTimestamp(@NonNull ITmfTimestamp ts) {
TmfSignalManager.dispatchSignal(new TmfTimeSynchSignal(this, ts));
}
/**
* 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);
// ------------------------------------------------------------------------
@Override
- public CtfTmfTimestamp createTimestamp(long ts) {
+ public @NonNull CtfTmfTimestamp createTimestamp(long ts) {
return new CtfTmfTimestamp(getTimestampTransform().transform(ts));
}
plugin.properties,\
about.html
src.includes = about.html
+additional.bundles = org.eclipse.jdt.annotation
+jars.extra.classpath = platform:/plugin/org.eclipse.jdt.annotation
private static TmfTimeRange range;
private static TmfTimestamp rangeWindow;
- private static TmfTimestamp currentTime;
/**
* Initialization
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));
*/
@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);
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;
// ------------------------------------------------------------------------
// 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;
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;
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
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;
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;
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));
}
}
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;
/**
* @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;
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();
}
@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();
}
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));
}
}
}