tmf: Make sure the resolution in range queries is valid
authorAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Thu, 17 May 2012 15:30:58 +0000 (11:30 -0400)
committerAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Thu, 17 May 2012 15:35:33 +0000 (11:35 -0400)
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/StateHistorySystem.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statesystem/IStateSystemQuerier.java

index fcc35bf8a34b526f435b718176ea54604cdb2c71..6ec94b3d39cb4c53eae40f8483e0734ea96f4f13 100644 (file)
@@ -221,7 +221,7 @@ public class StateHistorySystem extends StateSystem implements
         long ts;
 
         /* Make sure the time range makes sense */
-        if (t2 <= t1) {
+        if (t2 <= t1 || resolution <= 0) {
             throw new TimeRangeException();
         }
 
index 3261caef0fddbdef9c9f0895a4245e8b853bc445..12610444b81e0655661bcbb266d2cdc0fec6e874 100644 (file)
@@ -263,7 +263,8 @@ public interface IStateSystemQuerier {
      *            The "step" of this query
      * @return The List of states that happened between t1 and t2
      * @throws TimeRangeException
-     *             If t1 is invalid, or if t2 <= t1
+     *             If t1 is invalid, if t2 <= t1, or if the resolution isn't
+     *             greater than zero.
      * @throws AttributeNotFoundException
      *             If the attribute doesn't exist
      */
This page took 0.027994 seconds and 5 git commands to generate.