graph: add messages to IllegalStateExceptions
[deliverable/tracecompass.git] / analysis / org.eclipse.tracecompass.analysis.graph.ui / src / org / eclipse / tracecompass / internal / analysis / graph / ui / criticalpath / view / CriticalPathView.java
index cbd7306149171025da4d5e0f4634004e86d67098..115035ddeeb34b767a3877717c42ab450ce59663 100644 (file)
@@ -82,9 +82,9 @@ public class CriticalPathView extends AbstractTimeGraphView {
             COLUMN_PROCESS
     };
 
-    private final Table<ITmfTrace, Object, List<ILinkEvent>> fLinks = NonNullUtils.checkNotNull(HashBasedTable.create());
+    private final Table<ITmfTrace, Object, List<ILinkEvent>> fLinks = HashBasedTable.create();
     /** The trace to entry list hash map */
-    private final Table<ITmfTrace, Object, TmfGraphStatistics> fObjectStatistics = NonNullUtils.checkNotNull(HashBasedTable.create());
+    private final Table<ITmfTrace, Object, TmfGraphStatistics> fObjectStatistics = HashBasedTable.create();
 
     private final CriticalPathContentProvider fContentProvider = new CriticalPathContentProvider();
 
@@ -154,7 +154,7 @@ public class CriticalPathView extends AbstractTimeGraphView {
             public void visit(TmfEdge link, boolean horizontal) {
                 if (horizontal) {
                     Object parent = fGraph.getParentOf(link.getVertexFrom());
-                    CriticalPathEntry entry = checkNotNull(fRootList.get(parent));
+                    CriticalPathEntry entry = fRootList.get(parent);
                     TimeEvent ev = new TimeEvent(entry, link.getVertexFrom().getTs(), link.getDuration(),
                             getMatchingState(link.getType()).ordinal());
                     entry.addEvent(ev);
@@ -228,7 +228,7 @@ public class CriticalPathView extends AbstractTimeGraphView {
 
             return (entries == null) ?
                 new ITimeGraphEntry[0] :
-                NonNullUtils.checkNotNull(entries.toArray(new ITimeGraphEntry[entries.size()]));
+                entries.toArray(new @NonNull ITimeGraphEntry[entries.size()]);
         }
 
         private void buildEntryList(IGraphWorker worker) {
@@ -270,7 +270,7 @@ public class CriticalPathView extends AbstractTimeGraphView {
             }
 
             for (TimeGraphEntry entry : list) {
-                buildStatusEvents(trace, (CriticalPathEntry) NonNullUtils.checkNotNull(entry));
+                buildStatusEvents(trace, (CriticalPathEntry) entry);
             }
             workerEntries.put(worker, list);
         }
@@ -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();
@@ -511,7 +511,7 @@ public class CriticalPathView extends AbstractTimeGraphView {
         while (iterator.hasNext()) {
             ITimeEvent event = iterator.next();
             /* is event visible */
-            if (intersects(realStart, realEnd, NonNullUtils.checkNotNull(event))) {
+            if (intersects(realStart, realEnd, event)) {
                 eventList.add(event);
             }
         }
This page took 0.02787 seconds and 5 git commands to generate.