tmf: Bug 488042: TmfStatisticsModule returns null in @NonNull interface
[deliverable/tracecompass.git] / tmf / org.eclipse.tracecompass.tmf.core / src / org / eclipse / tracecompass / tmf / core / statistics / TmfStatisticsModule.java
index 746a892da3832c27b436b1862e3a457c7c2362f6..1996a05abf86c84631c3978f00cbac187aae35b1 100644 (file)
@@ -189,10 +189,16 @@ public class TmfStatisticsModule extends TmfAbstractAnalysisModule
     }
 
     @Override
-    public Iterable<ITmfStateSystem> getStateSystems() {
-        List<ITmfStateSystem> list = new LinkedList<>();
-        list.add(totalsModule.getStateSystem());
-        list.add(eventTypesModule.getStateSystem());
+    public @NonNull Iterable<@NonNull ITmfStateSystem> getStateSystems() {
+        List<@NonNull ITmfStateSystem> list = new LinkedList<>();
+        ITmfStateSystem totalsStateSystem = totalsModule.getStateSystem();
+        if (totalsStateSystem != null) {
+            list.add(totalsStateSystem);
+        }
+        ITmfStateSystem eventTypesStateSystem = eventTypesModule.getStateSystem();
+        if (eventTypesStateSystem != null) {
+            list.add(eventTypesStateSystem);
+        }
         return list;
     }
 }
This page took 0.026473 seconds and 5 git commands to generate.