tmf: Add message to state system exceptions
authorPatrick Tasse <patrick.tasse@gmail.com>
Mon, 16 Feb 2015 23:32:47 +0000 (18:32 -0500)
committerPatrick Tasse <patrick.tasse@gmail.com>
Tue, 10 Mar 2015 15:05:30 +0000 (11:05 -0400)
Change-Id: Ic8e75aed32690dae72ba2f907d1fc8ebc170de1e
Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/41977
Reviewed-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
13 files changed:
org.eclipse.tracecompass.statesystem.core/src/org/eclipse/tracecompass/internal/statesystem/core/AttributeTree.java
org.eclipse.tracecompass.statesystem.core/src/org/eclipse/tracecompass/internal/statesystem/core/StateSystem.java
org.eclipse.tracecompass.statesystem.core/src/org/eclipse/tracecompass/internal/statesystem/core/TransientState.java
org.eclipse.tracecompass.statesystem.core/src/org/eclipse/tracecompass/internal/statesystem/core/backend/historytree/HTInterval.java
org.eclipse.tracecompass.statesystem.core/src/org/eclipse/tracecompass/internal/statesystem/core/backend/historytree/HistoryTree.java
org.eclipse.tracecompass.statesystem.core/src/org/eclipse/tracecompass/statesystem/core/StateSystemUtils.java
org.eclipse.tracecompass.statesystem.core/src/org/eclipse/tracecompass/statesystem/core/backend/InMemoryBackend.java
org.eclipse.tracecompass.statesystem.core/src/org/eclipse/tracecompass/statesystem/core/backend/historytree/HistoryTreeBackend.java
org.eclipse.tracecompass.statesystem.core/src/org/eclipse/tracecompass/statesystem/core/exceptions/AttributeNotFoundException.java
org.eclipse.tracecompass.statesystem.core/src/org/eclipse/tracecompass/statesystem/core/exceptions/TimeRangeException.java
org.eclipse.tracecompass.tmf.analysis.xml.core/src/org/eclipse/tracecompass/tmf/analysis/xml/core/model/TmfXmlCondition.java
org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/internal/tmf/core/statesystem/backends/partial/PartialHistoryBackend.java
org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/internal/tmf/core/statesystem/mipmap/TmfStateSystemOperations.java

index bf7f884a5bcbc00dc9b6cc810331091422806d68..1796af3156b0c7c6e2006403dd6f626c75cc1cba 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2012, 2014 Ericsson
+ * Copyright (c) 2012, 2015 Ericsson
  * Copyright (c) 2010, 2011 École Polytechnique de Montréal
  * Copyright (c) 2010, 2011 Alexandre Montplaisir <alexandre.montplaisir@gmail.com>
  *
@@ -8,6 +8,9 @@
  * accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
+ * Contributors:
+ *   Alexandre Montplaisir - Initial API and implementation
+ *   Patrick Tasse - Add message to exceptions
  *******************************************************************************/
 
 package org.eclipse.tracecompass.internal.statesystem.core;
@@ -241,7 +244,7 @@ public final class AttributeTree {
              * The attribute doesn't exist, but we have been specified to NOT
              * add any new attributes.
              */
-            throw new AttributeNotFoundException();
+            throw new AttributeNotFoundException(ss.getSSID() + " Quark:" + startingNodeQuark + ", SubPath:" + Arrays.toString(subPath)); //$NON-NLS-1$ //$NON-NLS-2$
         }
         /*
          * The attribute was already existing, return the quark of that
@@ -325,7 +328,7 @@ public final class AttributeTree {
 
         /* Check if the quark is valid */
         if (attributeQuark < -1 || attributeQuark >= attributeList.size()) {
-            throw new AttributeNotFoundException();
+            throw new AttributeNotFoundException(ss.getSSID() + " Quark:" + attributeQuark); //$NON-NLS-1$
         }
 
         /* Set up the node from which we'll start the search */
index b4d82d0ff47be18f899c893c828d59b03e1df5c2..2ab23007590920479a728e809fabcb2eb0df9a68 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2012, 2014 Ericsson
+ * Copyright (c) 2012, 2015 Ericsson
  * Copyright (c) 2010, 2011 École Polytechnique de Montréal
  * Copyright (c) 2010, 2011 Alexandre Montplaisir <alexandre.montplaisir@gmail.com>
  *
@@ -8,6 +8,9 @@
  * accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
+ * Contributors:
+ *   Alexandre Montplaisir - Initial API and implementation
+ *   Patrick Tasse - Add message to exceptions
  *******************************************************************************/
 
 package org.eclipse.tracecompass.internal.statesystem.core;
@@ -405,7 +408,7 @@ public class StateSystem implements ITmfStateSystemBuilder {
             stackDepth = previousSV.unboxInt();
         } else {
             /* Previous state of this attribute was another type? Not good! */
-            throw new StateValueTypeException();
+            throw new StateValueTypeException(getSSID() + " Quark:" + attributeQuark + ", Type:" + previousSV.getType() + ", Expected:" + Type.INTEGER); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
         }
 
         if (stackDepth >= 100000) {
@@ -413,8 +416,8 @@ public class StateSystem implements ITmfStateSystemBuilder {
              * Limit stackDepth to 100000, to avoid having Attribute Trees grow
              * out of control due to buggy insertions
              */
-            String message = "Stack limit reached, not pushing"; //$NON-NLS-1$
-            throw new AttributeNotFoundException(message);
+            String message = " Stack limit reached, not pushing"; //$NON-NLS-1$
+            throw new AttributeNotFoundException(getSSID() + " Quark:" + attributeQuark + message); //$NON-NLS-1$
         }
 
         stackDepth++;
@@ -429,7 +432,7 @@ public class StateSystem implements ITmfStateSystemBuilder {
             throws AttributeNotFoundException, TimeRangeException,
             StateValueTypeException {
         /* These are the state values of the stack-attribute itself */
-        ITmfStateValue previousSV = queryOngoingState(attributeQuark);
+        ITmfStateValue previousSV = transState.getOngoingStateValue(attributeQuark);
 
         if (previousSV.isNull()) {
             /*
@@ -445,16 +448,14 @@ public class StateSystem implements ITmfStateSystemBuilder {
              * The existing value was not an integer (which is expected for
              * stack tops), this doesn't look like a valid stack attribute.
              */
-            throw new StateValueTypeException();
+            throw new StateValueTypeException(getSSID() + " Quark:" + attributeQuark + ", Type:" + previousSV.getType() + ", Expected:" + Type.INTEGER); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
         }
 
         int stackDepth = previousSV.unboxInt();
 
         if (stackDepth <= 0) {
             /* This on the other hand should not happen... */
-            String message = "A top-level stack attribute cannot " + //$NON-NLS-1$
-                    "have a value of 0 or less."; //$NON-NLS-1$
-            throw new StateValueTypeException(message);
+            throw new StateValueTypeException(getSSID() + " Quark:" + attributeQuark + ", Stack depth:" + stackDepth);  //$NON-NLS-1$//$NON-NLS-2$
         }
 
         /* The attribute should already exist at this point */
index c69ebe8ca5fc09ca65c69720a5f60a08f7d4b1d9..bfe449dfc2c4fc7557f60bd1c87fe61385118d3c 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2012, 2014 Ericsson
+ * Copyright (c) 2012, 2015 Ericsson
  * Copyright (c) 2010, 2011 École Polytechnique de Montréal
  * Copyright (c) 2010, 2011 Alexandre Montplaisir <alexandre.montplaisir@gmail.com>
  *
@@ -8,6 +8,9 @@
  * accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
+ * Contributors:
+ *   Alexandre Montplaisir - Initial API and implementation
+ *   Patrick Tasse - Add message to exceptions
  *******************************************************************************/
 
 package org.eclipse.tracecompass.internal.statesystem.core;
@@ -198,7 +201,7 @@ public class TransientState {
 
     private void checkValidAttribute(int quark) throws AttributeNotFoundException {
         if (quark > fOngoingStateInfo.size() - 1 || quark < 0) {
-            throw new AttributeNotFoundException();
+            throw new AttributeNotFoundException(fBackend.getSSID() + " Quark:" + quark); //$NON-NLS-1$
         }
     }
 
@@ -299,7 +302,7 @@ public class TransientState {
                  * but for every other types, it needs to match our
                  * expectations!
                  */
-                throw new StateValueTypeException();
+                throw new StateValueTypeException(fBackend.getSSID() + " Quark:" + quark + ", Type:" + value.getType() + ", Expected:" + expectedSvType); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
             }
 
             if (fOngoingStateInfo.get(quark).equals(value)) {
index fc2b6b8beedd10fa60a52a14ec6818c19630f636..2b48afb811d6c99cb6ff8d886b666f505fb65224 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2012, 2014 Ericsson, École Polytechnique de Montréal
+ * Copyright (c) 2012, 2015 Ericsson, École Polytechnique de Montréal
  * Copyright (c) 2010, 2011 Alexandre Montplaisir <alexandre.montplaisir@gmail.com>
  *
  * All rights reserved. This program and the accompanying materials are
@@ -10,6 +10,7 @@
  * Contributors:
  *    Alexandre Montplaisir - Initial API and implementation
  *    Florian Wininger - Allow to change the size of a interval
+ *    Patrick Tasse - Add message to exceptions
  *******************************************************************************/
 
 package org.eclipse.tracecompass.internal.statesystem.core.backend.historytree;
@@ -86,7 +87,7 @@ public final class HTInterval implements ITmfStateInterval, Comparable<HTInterva
     public HTInterval(long intervalStart, long intervalEnd, int attribute,
             TmfStateValue value) throws TimeRangeException {
         if (intervalStart > intervalEnd) {
-            throw new TimeRangeException();
+            throw new TimeRangeException("Start:" + intervalStart + ", End:" + intervalEnd); //$NON-NLS-1$ //$NON-NLS-2$
         }
 
         this.start = intervalStart;
@@ -105,7 +106,7 @@ public final class HTInterval implements ITmfStateInterval, Comparable<HTInterva
     private HTInterval(long intervalStart, long intervalEnd, int attribute,
             TmfStateValue value, int size) throws TimeRangeException {
         if (intervalStart > intervalEnd) {
-            throw new TimeRangeException();
+            throw new TimeRangeException("Start:" + intervalStart + ", End:" + intervalEnd); //$NON-NLS-1$ //$NON-NLS-2$
         }
 
         this.start = intervalStart;
index 7e7d3b4529bc3d4cc6f328ed3e80fa1a87279e8e..e00629f4c83e0b28ae7dc1ec835efa38afc213fe 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2010, 2014 Ericsson, École Polytechnique de Montréal, and others
+ * Copyright (c) 2010, 2015 Ericsson, École Polytechnique de Montréal, and others
  *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
@@ -9,6 +9,7 @@
  * Contributors:
  *   Alexandre Montplaisir - Initial API and implementation
  *   Florian Wininger - Add Extension and Leaf Node
+ *   Patrick Tasse - Add message to exceptions
  *******************************************************************************/
 
 package org.eclipse.tracecompass.internal.statesystem.core.backend.historytree;
@@ -430,7 +431,7 @@ public class HistoryTree {
      */
     public void insertInterval(HTInterval interval) throws TimeRangeException {
         if (interval.getStartTime() < config.getTreeStart()) {
-            throw new TimeRangeException();
+            throw new TimeRangeException("Interval Start:" + interval.getStartTime() + ", Config Start:" + config.getTreeStart()); //$NON-NLS-1$ //$NON-NLS-2$
         }
         tryInsertAtNode(interval, latestBranch.size() - 1);
     }
index 693a309e3e6a687e44218e08bdf5b42730fee2d2..a3f8d70e99fc2332dcea7d24f92c67fc314e7d32 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2014 École Polytechnique de Montréal
+ * Copyright (c) 2014, 2015 École Polytechnique de Montréal
  *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
@@ -9,6 +9,7 @@
  * Contributors:
  *   Geneviève Bastien - Initial API and implementation
  *   Alexandre Montplaisir - Initial API and implementation
+ *   Patrick Tasse - Add message to exceptions
  *******************************************************************************/
 
 package org.eclipse.tracecompass.statesystem.core;
@@ -82,7 +83,7 @@ public final class StateSystemUtils {
              * This attribute is an integer attribute, but it doesn't seem like
              * it's used as a stack-attribute...
              */
-            throw new StateValueTypeException();
+            throw new StateValueTypeException(ss.getSSID() + " Quark:" + stackAttributeQuark + ", Stack depth:" + curStackDepth);  //$NON-NLS-1$//$NON-NLS-2$
         }
 
         int subAttribQuark = ss.getQuarkRelative(stackAttributeQuark, String.valueOf(curStackDepth));
@@ -126,7 +127,7 @@ public final class StateSystemUtils {
 
         /* Make sure the time range makes sense */
         if (t2 < t1) {
-            throw new TimeRangeException();
+            throw new TimeRangeException(ss.getSSID() + " Start:" + t1 + ", End:" + t2); //$NON-NLS-1$ //$NON-NLS-2$
         }
 
         /* Set the actual, valid end time of the range query */
@@ -193,7 +194,7 @@ public final class StateSystemUtils {
 
         /* Make sure the time range makes sense */
         if (t2 < t1 || resolution <= 0) {
-            throw new TimeRangeException();
+            throw new TimeRangeException(ss.getSSID() + " Start:" + t1 + ", End:" + t2 + ", Resolution:" + resolution); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
         }
 
         /* Set the actual, valid end time of the range query */
index ed595c30712682376603141f246701ab0899487f..3378ef32970c6985cdc5a5d79df1bcd10d3a58f5 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2013, 2014 Ericsson
+ * Copyright (c) 2013, 2015 Ericsson
  *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
@@ -9,6 +9,7 @@
  * Contributors:
  *   Alexandre Montplaisir - Initial API and implementation
  *   Matthew Khouzam - Modified to use a TreeSet
+ *   Patrick Tasse - Add message to exceptions
  ******************************************************************************/
 
 package org.eclipse.tracecompass.statesystem.core.backend;
@@ -116,7 +117,7 @@ public class InMemoryBackend implements IStateHistoryBackend {
             int quark, ITmfStateValue value) throws TimeRangeException {
         /* Make sure the passed start/end times make sense */
         if (stateStartTime > stateEndTime || stateStartTime < startTime) {
-            throw new TimeRangeException();
+            throw new TimeRangeException(ssid + " Interval Start:" + stateStartTime + ", Interval End:" + stateEndTime + ", Backend Start:" + startTime); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
         }
 
         ITmfStateInterval interval = new TmfStateInterval(stateStartTime, stateEndTime, quark, value);
@@ -136,7 +137,7 @@ public class InMemoryBackend implements IStateHistoryBackend {
     public void doQuery(List<ITmfStateInterval> currentStateInfo, long t)
             throws TimeRangeException {
         if (!checkValidTime(t)) {
-            throw new TimeRangeException();
+            throw new TimeRangeException(ssid + " Time:" + t + ", Start:" + startTime + ", End:" + latestTime); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
         }
 
         /*
@@ -161,7 +162,7 @@ public class InMemoryBackend implements IStateHistoryBackend {
     public ITmfStateInterval doSingularQuery(long t, int attributeQuark)
             throws TimeRangeException, AttributeNotFoundException {
         if (!checkValidTime(t)) {
-            throw new TimeRangeException();
+            throw new TimeRangeException(ssid + " Time:" + t + ", Start:" + startTime + ", End:" + latestTime); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
         }
 
         /*
@@ -182,7 +183,7 @@ public class InMemoryBackend implements IStateHistoryBackend {
                 }
             }
         }
-        throw new AttributeNotFoundException();
+        throw new AttributeNotFoundException(ssid + " Quark:" + attributeQuark); //$NON-NLS-1$
     }
 
     private boolean checkValidTime(long t) {
index 9fdab2c8ca31b107df8acd4bba245c1c17987fc1..3cf136e4e10d9abd1ae5ae3749ce923014d82ced 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2012, 2014 Ericsson
+ * Copyright (c) 2012, 2015 Ericsson
  * Copyright (c) 2010, 2011 École Polytechnique de Montréal
  * Copyright (c) 2010, 2011 Alexandre Montplaisir <alexandre.montplaisir@gmail.com>
  *
@@ -8,6 +8,9 @@
  * accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
+ * Contributors:
+ *   Alexandre Montplaisir - Initial API and implementation
+ *   Patrick Tasse - Add message to exceptions
  *******************************************************************************/
 
 package org.eclipse.tracecompass.statesystem.core.backend.historytree;
@@ -230,10 +233,7 @@ public class HistoryTreeBackend implements IStateHistoryBackend {
     @Override
     public void doQuery(List<ITmfStateInterval> stateInfo, long t)
             throws TimeRangeException, StateSystemDisposedException {
-        if (!checkValidTime(t)) {
-            /* We can't possibly have information about this query */
-            throw new TimeRangeException();
-        }
+        checkValidTime(t);
 
         /* We start by reading the information in the root node */
         HTNode currentNode = sht.getRootNode();
@@ -262,8 +262,12 @@ public class HistoryTreeBackend implements IStateHistoryBackend {
         return getRelevantInterval(t, attributeQuark);
     }
 
-    private boolean checkValidTime(long t) {
-        return (t >= sht.getTreeStart() && t <= sht.getTreeEnd());
+    private void checkValidTime(long t) {
+        long treeStart = sht.getTreeStart();
+        long treeEnd = sht.getTreeEnd();
+        if (t < treeStart || t > treeEnd) {
+            throw new TimeRangeException(ssid + " Time:" + t + ", Start:" + treeStart + ", End:" + treeEnd); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+        }
     }
 
     /**
@@ -276,9 +280,7 @@ public class HistoryTreeBackend implements IStateHistoryBackend {
      */
     private HTInterval getRelevantInterval(long t, int key)
             throws TimeRangeException, StateSystemDisposedException {
-        if (!checkValidTime(t)) {
-            throw new TimeRangeException();
-        }
+        checkValidTime(t);
 
         HTNode currentNode = sht.getRootNode();
         HTInterval interval = currentNode.getRelevantInterval(key, t);
index b3130e3aaed5b05d22364e7231e131c8792c9c2d..a216fd1979f4e9ca0887922eb8f5e282fee7b80b 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2012, 2014 Ericsson
+ * Copyright (c) 2012, 2015 Ericsson
  * Copyright (c) 2010, 2011 École Polytechnique de Montréal
  * Copyright (c) 2010, 2011 Alexandre Montplaisir <alexandre.montplaisir@gmail.com>
  *
@@ -8,6 +8,9 @@
  * accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
+ * Contributors:
+ *   Alexandre Montplaisir - Initial API and implementation
+ *   Patrick Tasse - Add message to exceptions
  *******************************************************************************/
 
 package org.eclipse.tracecompass.statesystem.core.exceptions;
@@ -39,4 +42,16 @@ public class AttributeNotFoundException extends Exception {
         super(message);
     }
 
+    /**
+     * Constructor with both a message and a cause.
+     *
+     * @param message
+     *            Message to attach to this exception
+     * @param e
+     *            Cause of this exception
+     * @since 1.0
+     */
+    public AttributeNotFoundException(String message, Throwable e) {
+        super(message, e);
+    }
 }
index 712206a38ded32649dda17d07d140f064f5bd67a..cbe38984bf9406f9ae7d2d1e53e2bcb43e2e3746 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2012, 2014 Ericsson
+ * Copyright (c) 2012, 2015 Ericsson
  * Copyright (c) 2010, 2011 École Polytechnique de Montréal
  * Copyright (c) 2010, 2011 Alexandre Montplaisir <alexandre.montplaisir@gmail.com>
  *
@@ -8,6 +8,9 @@
  * accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
+ * Contributors:
+ *   Alexandre Montplaisir - Initial API and implementation
+ *   Patrick Tasse - Add message to exceptions
  *******************************************************************************/
 
 package org.eclipse.tracecompass.statesystem.core.exceptions;
@@ -26,4 +29,33 @@ public class TimeRangeException extends RuntimeException {
 
     private static final long serialVersionUID = -4067685227260254532L;
 
+    /**
+     * Default constructor
+     */
+    public TimeRangeException() {
+    }
+
+    /**
+     * Constructor with a message
+     *
+     * @param message
+     *            Message to attach to this exception
+     * @since 1.0
+     */
+    public TimeRangeException(String message) {
+        super(message);
+    }
+
+    /**
+     * Constructor with both a message and a cause.
+     *
+     * @param message
+     *            Message to attach to this exception
+     * @param e
+     *            Cause of this exception
+     * @since 1.0
+     */
+    public TimeRangeException(String message, Throwable e) {
+        super(message, e);
+    }
 }
index 6d33a8bca6507b6b332418f867ac0423db0c8938..51a0d6774fff9ef397de49cb7e8a3414843f4595 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2014 Ecole Polytechnique de Montreal
+ * Copyright (c) 2014, 2015 Ecole Polytechnique de Montreal
  *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
@@ -9,6 +9,7 @@
  * Contributors:
  *   Florian Wininger - Initial API and implementation
  *   Naser Ezzati - Add the comparison operators
+ *   Patrick Tasse - Add message to exceptions
  ******************************************************************************/
 
 package org.eclipse.tracecompass.tmf.analysis.xml.core.model;
@@ -221,7 +222,7 @@ public class TmfXmlCondition {
                  * check
                  */
                 if (quark == IXmlStateSystemContainer.ERROR_QUARK) {
-                    throw new AttributeNotFoundException();
+                    throw new AttributeNotFoundException(ss.getSSID() + " Attribute:" + attribute); //$NON-NLS-1$
                 }
             }
 
index 869c0e759b0e54c180b7b4c95041bf82ae2f9eca..e9b269c014fc61454fa57195c7e4af1b81664ee4 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2013, 2014 Ericsson
+ * Copyright (c) 2013, 2015 Ericsson
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
  * accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
  *
  * Contributors:
  *   Alexandre Montplaisir - Initial API and implementation
+ *   Patrick Tasse - Add message to exceptions
  *******************************************************************************/
 
 package org.eclipse.tracecompass.internal.tmf.core.statesystem.backends.partial;
@@ -210,7 +211,7 @@ public class PartialHistoryBackend implements IStateHistoryBackend {
         fPartialSS.getUpstreamSS().waitUntilBuilt();
 
         if (!checkValidTime(t)) {
-            throw new TimeRangeException();
+            throw new TimeRangeException(fSSID + " Time:" + t + ", Start:" + getStartTime() + ", End:" + getEndTime()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
         }
 
         /* Reload the previous checkpoint */
index 08c03c352034b166702176da236d093afff8f0d2..b6fd0c8e2ed1fe0e3c35b127d77d1de5dd4e8774 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2013, 2014 Ericsson
+ * Copyright (c) 2013, 2015 Ericsson
  *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
@@ -86,7 +86,7 @@ public final class TmfStateSystemOperations {
             case NULL:
             case STRING:
             default:
-                throw new StateValueTypeException();
+                throw new StateValueTypeException(ss.getSSID() + " Quark:" + quark + ", Type:" + value.getType()); //$NON-NLS-1$ //$NON-NLS-2$
             }
         }
         return max;
@@ -141,7 +141,7 @@ public final class TmfStateSystemOperations {
             case NULL:
             case STRING:
             default:
-                throw new StateValueTypeException();
+                throw new StateValueTypeException(ss.getSSID() + " Quark:" + quark + ", Type:" + value.getType()); //$NON-NLS-1$ //$NON-NLS-2$
             }
         }
         return min;
This page took 0.037652 seconds and 5 git commands to generate.