/**
* @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 */