ctf: Don't include all test traces in jar
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / exceptions / StateValueTypeException.java
index 2aa04d32ab0259b5c5df35ecb2ee54245325156e..d508cf5633497a620fad060b14a4262863a683c6 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2014 Ericsson
  * Copyright (c) 2010, 2011 École Polytechnique de Montréal
  * Copyright (c) 2010, 2011 Alexandre Montplaisir <alexandre.montplaisir@gmail.com>
  *
@@ -20,10 +20,13 @@ package org.eclipse.linuxtools.tmf.core.exceptions;
  * This exception is thrown if the user tries to unbox a StateValue with an
  * incorrect type (for example, tries to read a String value as an Int).
  *
- * @author Alexandre Montplaisir
+ * To avoid it, always check for the state value's type before attempting to
+ * unbox it, via
+ * {@link org.eclipse.linuxtools.tmf.core.statevalue.ITmfStateValue#getType()}.
  *
+ * @author Alexandre Montplaisir
  */
-public class StateValueTypeException extends Exception {
+public class StateValueTypeException extends RuntimeException {
 
     private static final long serialVersionUID = -4548793451746144513L;
 
@@ -43,4 +46,17 @@ public class StateValueTypeException extends Exception {
     public StateValueTypeException(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 3.0
+     */
+    public StateValueTypeException(String message, Throwable e) {
+        super(message, e);
+    }
 }
This page took 0.024783 seconds and 5 git commands to generate.