Fix some null warnings
[deliverable/tracecompass.git] / ctf / org.eclipse.tracecompass.ctf.core / src / org / eclipse / tracecompass / ctf / core / trace / CTFStream.java
index 5c4b008eb847dc7366d081853f27fd84dfdc1e32..b0fb0e54fc19456b5c9f515747d1574a8f5de6ca 100644 (file)
@@ -14,7 +14,6 @@ package org.eclipse.tracecompass.ctf.core.trace;
 
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
@@ -226,9 +225,13 @@ public class CTFStream {
      *
      * @return The event declarations for this stream
      */
-    public @NonNull Collection<IEventDeclaration> getEventDeclarations() {
-        List<IEventDeclaration> retVal = new ArrayList<>(fEvents);
-        retVal.removeAll(Collections.<IEventDeclaration> singletonList(null));
+    public @NonNull Collection<@NonNull IEventDeclaration> getEventDeclarations() {
+        List<@NonNull IEventDeclaration> retVal = new ArrayList<>();
+        for (IEventDeclaration eventDeclaration : fEvents) {
+            if (eventDeclaration != null) {
+                retVal.add(eventDeclaration);
+            }
+        }
         return retVal;
     }
 
This page took 0.029229 seconds and 5 git commands to generate.