Source:
<code>public boolean isActive(ITimeGraphEntry element) { if (element instanceof ControlFlowEntry) { ControlFlowEntry cfe = (ControlFlowEntry) element; TmfTraceManager traceManager = TmfTraceManager.getInstance(); TmfTraceContext traceContext = traceManager.getCurrentTraceContext(); TmfTimeRange winRange = traceContext.getWindowRange(); TmfTimeRange selRange = traceContext.getSelectionRange(); long beginTS = selRange.getStartTime().getValue(); long endTS = selRange.getEndTime().getValue(); if (beginTS == endTS) { beginTS = winRange.getStartTime().getValue(); endTS = winRange.getEndTime().getValue(); } ITmfTrace trace = cfe.getTrace(); ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(trace, KernelAnalysis.ID); if (ssq != null) { try { int statusQuark = ssq.getQuarkRelative(cfe.getThreadQuark(), Attributes.STATUS); long ssqEndTS = ssq.getCurrentEndTime(); long ssqBeginTS = ssq.getStartTime(); if (beginTS < ssqBeginTS) { beginTS = ssqBeginTS; } if (endTS > ssqEndTS) { endTS = ssqEndTS; <START> } <END> ITmfStateInterval currentInterval = ssq.querySingleState(beginTS, statusQuark); if (isIntervalInStateActive(currentInterval)) { return true; } long ts = currentInterval.getEndTime(); while (ts != -1 && ts < endTS) { ts++; currentInterval = ssq.querySingleState(ts, statusQuark); if (isIntervalInStateActive(currentInterval)) { return true; } ts = currentInterval.getEndTime(); } } catch (AttributeNotFoundException | StateSystemDisposedException e) { } } } return false; }</code><technical_language>pattern mistake... ;) If current time window is completely of range of this trace, beginTs > endTs. In case return false immediately, get a TimeRangeException. While here, consider Math.min Math.max</technical_language>

Target:
public boolean isActive(ITimeGraphEntry element) { if (element instanceof ControlFlowEntry) { ControlFlowEntry cfe = (ControlFlowEntry) element; TmfTraceManager traceManager = TmfTraceManager.getInstance(); TmfTraceContext traceContext = traceManager.getCurrentTraceContext(); TmfTimeRange winRange = traceContext.getWindowRange(); TmfTimeRange selRange = traceContext.getSelectionRange(); long beginTS = selRange.getStartTime().getValue(); long endTS = selRange.getEndTime().getValue(); if (beginTS == endTS) { beginTS = winRange.getStartTime().getValue(); endTS = winRange.getEndTime().getValue(); } ITmfTrace trace = cfe.getTrace(); ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(trace, KernelAnalysis.ID); if (ssq != null) { beginTS = Math.max(beginTS, ssq.getStartTime()); endTS = Math.min(endTS, ssq.getCurrentEndTime()); if (beginTS > endTS) { return false; } try { int statusQuark = ssq.getQuarkRelative(cfe.getThreadQuark(), Attributes.STATUS); ITmfStateInterval currentInterval = ssq.querySingleState(beginTS, statusQuark); if (isIntervalInStateActive(currentInterval)) { return true; } long ts = currentInterval.getEndTime(); while (ts != -1 && ts < endTS) { ts++; currentInterval = ssq.querySingleState(ts, statusQuark); if (isIntervalInStateActive(currentInterval)) { return true; } ts = currentInterval.getEndTime(); } } catch (AttributeNotFoundException | StateSystemDisposedException e) { } } } return false; }