graph: add messages to IllegalStateExceptions
authorMatthew Khouzam <matthew.khouzam@ericsson.com>
Sun, 20 Mar 2016 21:12:01 +0000 (17:12 -0400)
committerMatthew Khouzam <matthew.khouzam@ericsson.com>
Wed, 6 Apr 2016 18:16:12 +0000 (14:16 -0400)
Change-Id: If8efc90b6e55395448abbf3ced6695678dc8b496
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/68876
Reviewed-by: Genevieve Bastien <gbastien+lttng@versatic.net>
Tested-by: Genevieve Bastien <gbastien+lttng@versatic.net>
Reviewed-by: Hudson CI
analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/analysis/graph/core/base/TmfVertex.java
analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/analysis/graph/core/criticalpath/CriticalPathModule.java
analysis/org.eclipse.tracecompass.analysis.graph.ui/src/org/eclipse/tracecompass/internal/analysis/graph/ui/criticalpath/view/CriticalPathView.java

index 1a9aaaa01ad1c86ab2eca6bd5b5d43c1c8c309a6..e2c20089a23c6cd6f7bcf7ce76b6720401a45b01 100644 (file)
@@ -232,7 +232,7 @@ public class TmfVertex implements Comparable<TmfVertex> {
         case INCOMING_HORIZONTAL_EDGE:
             return fIncomingHorizontal;
         default:
-            throw new IllegalStateException();
+            throw new IllegalStateException("Unknown edge direction type : " + dir); //$NON-NLS-1$
         }
     }
 
@@ -258,7 +258,7 @@ public class TmfVertex implements Comparable<TmfVertex> {
             fIncomingHorizontal = null;
             break;
         default:
-            throw new IllegalStateException();
+            throw new IllegalStateException("Unknown edge direction type : " + dir); //$NON-NLS-1$
         }
     }
 
@@ -287,7 +287,7 @@ public class TmfVertex implements Comparable<TmfVertex> {
         case INCOMING_HORIZONTAL_EDGE:
             return edge.getVertexFrom();
         default:
-            throw new IllegalStateException();
+            throw new IllegalStateException("Unknown edge direction type : " + dir); //$NON-NLS-1$
         }
     }
 
index 6064f3b345158bc1e5846e97db3fe3fd34f34e48..9b989ad9563d15720dfaf4792f63731cb8807303 100644 (file)
@@ -85,7 +85,7 @@ public class CriticalPathModule extends TmfAbstractAnalysisModule {
             return false;
         }
         if (!(workerObj instanceof IGraphWorker)) {
-            throw new IllegalStateException();
+            throw new IllegalStateException("Worker parameter must be an IGraphWorker"); //$NON-NLS-1$
         }
         IGraphWorker worker = (IGraphWorker) workerObj;
 
index 1ec8e4278fdf59c01ef234b496956f2f1aaf2128..115035ddeeb34b767a3877717c42ab450ce59663 100644 (file)
@@ -280,7 +280,7 @@ public class CriticalPathView extends AbstractTimeGraphView {
                     TmfTraceUtils.getAnalysisModulesOfClass(trace, CriticalPathModule.class),
                     null);
             if (module == null) {
-                throw new IllegalStateException();
+                throw new IllegalStateException("View requires an analysis module"); //$NON-NLS-1$
             }
 
             module.schedule();
@@ -311,7 +311,7 @@ public class CriticalPathView extends AbstractTimeGraphView {
             CriticalPathModule module = Iterables.<@Nullable CriticalPathModule> getFirst(
                     TmfTraceUtils.getAnalysisModulesOfClass(trace, CriticalPathModule.class), null);
             if (module == null) {
-                throw new IllegalStateException();
+                throw new IllegalStateException("View requires an analysis module"); //$NON-NLS-1$
             }
 
             final TmfGraph graph = module.getCriticalPath();
This page took 0.028905 seconds and 5 git commands to generate.