analysis : Remove checkNull() in Segment store statistic viewer
authorJean-Christian Kouame <jean-christian.kouame@ericsson.com>
Fri, 11 Mar 2016 17:40:09 +0000 (12:40 -0500)
committerGenevieve Bastien <gbastien+lttng@versatic.net>
Wed, 23 Mar 2016 15:27:47 +0000 (11:27 -0400)
Previously, if the view was called and the trace is null, an exception
was raised. Now, if the trace is null, the view will do nothing. This situation
happens when using this viewer with XML views, the trace may still be null
when the viewer is updated.

Change-Id: I5f3e7dac7ef93e8b0cf795d7219278aad3fa9c90
Signed-off-by: Jean-Christian Kouame <jean-christian.kouame@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/68228
Reviewed-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-by: Genevieve Bastien <gbastien+lttng@versatic.net>
Tested-by: Genevieve Bastien <gbastien+lttng@versatic.net>
analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/internal/analysis/timing/ui/views/segmentstore/statistics/AbstractSegmentStoreStatisticsViewer.java

index 347aeb664335a723e5ab49cbad9d4bf436b12500..178ee1f6bbf102a6d9854c1fa22f768fad582de6 100644 (file)
@@ -218,18 +218,19 @@ public abstract class AbstractSegmentStoreStatisticsViewer extends AbstractTmfTr
 
     @Override
     public void initializeDataSource() {
-        /* Should not be called while trace is still null */
-        ITmfTrace trace = checkNotNull(getTrace());
-        TmfAbstractAnalysisModule module = createStatisticsAnalysiModule();
-        if (module == null) {
-            return;
-        }
-        try {
-            module.setTrace(trace);
-            module.schedule();
-            fModule = module;
-        } catch (TmfAnalysisException e) {
-            Activator.getDefault().logError("Error initializing statistics analysis module", e); //$NON-NLS-1$
+        ITmfTrace trace = getTrace();
+        if (trace != null) {
+            TmfAbstractAnalysisModule module = createStatisticsAnalysiModule();
+            if (module == null) {
+                return;
+            }
+            try {
+                module.setTrace(trace);
+                module.schedule();
+                fModule = module;
+            } catch (TmfAnalysisException e) {
+                Activator.getDefault().logError("Error initializing statistics analysis module", e); //$NON-NLS-1$
+            }
         }
     }
 
This page took 0.024929 seconds and 5 git commands to generate.