ss: Bug 485304: Incorrect interval returned in history tree full query
authorPatrick Tasse <patrick.tasse@gmail.com>
Wed, 6 Jan 2016 23:38:17 +0000 (18:38 -0500)
committerPatrick Tasse <patrick.tasse@gmail.com>
Thu, 14 Jan 2016 19:00:44 +0000 (14:00 -0500)
Change-Id: Ic68f991a168d5156a2d7a22dbc62b63b307f432f
Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/63687
Reviewed-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Reviewed-by: Hudson CI
statesystem/org.eclipse.tracecompass.statesystem.core/src/org/eclipse/tracecompass/internal/statesystem/core/backend/historytree/HTNode.java

index 5a44cfd3336d22ed84f0b6152b6fba920604ff0a..b006d190af7412debc039617d4d84f04e6cdfe20 100644 (file)
@@ -537,25 +537,17 @@ public abstract class HTNode {
              */
             index = -index - 1;
 
-        }
-
-        /* Sometimes binarySearch yields weird stuff... */
-        if (index < 0) {
-            index = 0;
-        }
-        if (index >= fIntervals.size()) {
-            index = fIntervals.size() - 1;
-        }
-
-        /*
-         * Another API quirkiness, the returned index is the one of the *last*
-         * element of a series of equal endtimes, which happens sometimes. We
-         * want the *first* element of such a series, to read through them
-         * again.
-         */
-        while (index > 0
-                && fIntervals.get(index - 1).compareTo(fIntervals.get(index)) == 0) {
-            index--;
+        } else {
+            /*
+             * Another API quirkiness, the returned index is the one of the *last*
+             * element of a series of equal endtimes, which happens sometimes. We
+             * want the *first* element of such a series, to read through them
+             * again.
+             */
+            while (index > 0
+                    && fIntervals.get(index - 1).compareTo(fIntervals.get(index)) == 0) {
+                index--;
+            }
         }
 
         return index;
This page took 0.028269 seconds and 5 git commands to generate.