Source:
protected void updateData(long start, long end, int nb, IProgressMonitor monitor) { double[] xAxis = getXAxis(start, end, nb); if (xAxis.length == 1) { return; } Display.getDefault().syncExec(() -> { if (monitor.isCanceled()) { return; } setXAxis(xAxis); }); try (ScopeLog log = new ScopeLog(LOGGER, Level.FINE, "CounterChartViewer#updateData")) { for (CounterTreeViewerEntry counterEntry : Iterables.filter(fEntries, CounterTreeViewerEntry.class)) { if (monitor.isCanceled()) { return; } double[] steps = new double[xAxis.length]; ITmfStateSystem ss = counterEntry.getStateSystem(); Integer quark = counterEntry.getQuark(); long stateSystemStartTime = ss.getStartTime(); long stateSystemEndTime = ss.getCurrentEndTime(); long prevTime = Math.max(stateSystemStartTime, (long) (start - (xAxis[1]))); if (prevTime <= stateSystemEndTime) { Object prev = ss.querySingleState(prevTime, quark).getValue(); long prevValue = prev instanceof Long ? (long) prev : 0; for (int i = 0; i < xAxis.length; i++) { long nextTime = start + (long) xAxis[i] - 1; if (nextTime >= stateSystemStartTime && nextTime <= stateSystemEndTime) { Object next = ss.querySingleState(nextTime, quark).getValue(); long nextValue = next instanceof Long ? (long) next : 0; long differentialValue = (next == null) ? 0 : nextValue - prevValue; steps[i] = isCumulative ? nextValue : differentialValue; prevValue = nextValue; } else if (isCumulative) { steps[i] = prevValue; } } } Display.getDefault().syncExec(() -> { if (monitor.isCanceled()) { return; } setSeries(counterEntry.getFullPath(), steps); }); } } catch (StateSystemDisposedException e) { return; } updateDisplay(); }

Target:
protected void updateData(long start, long end, int nb, IProgressMonitor monitor) { double[] xAxis = getXAxis(start, end, nb); if (xAxis.length <= 1 || monitor.isCanceled()) { return; } try (ScopeLog log = new ScopeLog(LOGGER, Level.FINE, "CounterChartViewer#updateData")) { for (CounterTreeViewerEntry counterEntry : Iterables.filter(fEntries, CounterTreeViewerEntry.class)) { if (monitor.isCanceled()) { return; } double[] steps = new double[xAxis.length]; ITmfStateSystem ss = counterEntry.getStateSystem(); Integer quark = counterEntry.getQuark(); long stateSystemStartTime = ss.getStartTime(); long stateSystemEndTime = ss.getCurrentEndTime(); long prevTime = Math.max(stateSystemStartTime, (long) (start - (xAxis[1]))); if (prevTime <= stateSystemEndTime) { Object prev = ss.querySingleState(prevTime, quark).getValue(); long prevValue = prev instanceof Long ? (long) prev : 0; for (int i = 0; i < xAxis.length; i++) { long nextTime = start + (long) xAxis[i] - 1; if (nextTime >= stateSystemStartTime && nextTime <= stateSystemEndTime) { Object next = ss.querySingleState(nextTime, quark).getValue(); long nextValue = next instanceof Long ? (long) next : 0; long differentialValue = (next == null) ? 0 : nextValue - prevValue; steps[i] = isCumulative ? nextValue : differentialValue; prevValue = nextValue; } else if (isCumulative) { steps[i] = prevValue; } } } Display.getDefault().syncExec(() -> { if (monitor.isCanceled()) { return; } setXAxis(xAxis); setSeries(counterEntry.getFullPath(), steps); }); } } catch (StateSystemDisposedException e) { return; } updateDisplay(); }