tmf: Fix wrong interval returns in the history backend
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / statesystem / backend / historytree / HTNode.java
index 60147dbfcb859a7e1111b88c830b011a35ee9a34..7e16a37d362b4c988b6c144feb019afe9bf24d80 100644 (file)
@@ -329,6 +329,7 @@ abstract class HTNode {
     HTInterval getRelevantInterval(int key, long t) throws TimeRangeException {
         assert (this.isDone);
         int startIndex;
+        HTInterval curInterval;
 
         if (intervals.size() == 0) {
             return null;
@@ -337,10 +338,11 @@ abstract class HTNode {
         startIndex = getStartIndexFor(t);
 
         for (int i = startIndex; i < intervals.size(); i++) {
-            if (intervals.get(i).getAttribute() == key) {
-                if (intervals.get(i).getStartTime() <= t) {
-                    return intervals.get(i);
-                }
+            curInterval = intervals.get(i);
+            if (curInterval.getAttribute() == key
+                    && curInterval.getStartTime() <= t
+                    && curInterval.getEndTime() >= t) {
+                return curInterval;
             }
         }
         /* We didn't find the relevant information in this node */
This page took 0.024214 seconds and 5 git commands to generate.