tmf : add waitForInitialization() to ITmfAnalysisModuleWithStateSystem
[deliverable/tracecompass.git] / tmf / org.eclipse.tracecompass.tmf.core / src / org / eclipse / tracecompass / tmf / core / statistics / TmfStatisticsModule.java
index 746a892da3832c27b436b1862e3a457c7c2362f6..d1281311c63254517038eb8df67510a086a8dada 100644 (file)
@@ -66,6 +66,7 @@ public class TmfStatisticsModule extends TmfAbstractAnalysisModule
     /**
      * Wait until the analyses/state systems underneath are ready to be queried.
      */
+    @Override
     public void waitForInitialization() {
         try {
             fInitialized.await();
@@ -189,10 +190,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.028904 seconds and 5 git commands to generate.