From 6db459836f8788ba4c72c9d1cbd04366af58b299 Mon Sep 17 00:00:00 2001 From: Alexandre Montplaisir Date: Tue, 15 May 2012 10:43:15 -0400 Subject: [PATCH] tmf: Also pick the interval at the end time of range queries When doing a range query with resolution, include the end time of the range (t2) as the last "resolution point". This means that the interval crossing t2 will be returned no matter what, which is consistent with range queries with no resolution. Signed-off-by: Alexandre Montplaisir --- .../internal/tmf/core/statesystem/StateHistorySystem.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/StateHistorySystem.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/StateHistorySystem.java index 53748351b4..9fc11e715d 100644 --- a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/StateHistorySystem.java +++ b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/StateHistorySystem.java @@ -249,6 +249,13 @@ public class StateHistorySystem extends StateSystem implements intervals.add(currentInterval); } + + /* Add the interval at t2, if it wasn't included already. */ + if (currentInterval.getEndTime() < t2 && + t2 <= this.getCurrentEndTime()) { + currentInterval = querySingleState(t2, attributeQuark); + intervals.add(currentInterval); + } return intervals; } -- 2.34.1