Use the NonNull utility methods where we can
[deliverable/tracecompass.git] / org.eclipse.tracecompass.tmf.pcap.core / src / org / eclipse / tracecompass / internal / tmf / pcap / core / event / PcapEvent.java
index 3dc2b6e7a3b6755f5a61eaa471353fe4ab64440b..8e9c1fc16f2e4e30b3c980bfb40f2300869ff584 100644 (file)
 
 package org.eclipse.tracecompass.internal.tmf.pcap.core.event;
 
+import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
+
 import java.nio.ByteBuffer;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.List;
 import java.util.Map;
 
-import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
 import org.eclipse.tracecompass.internal.pcap.core.packet.Packet;
 import org.eclipse.tracecompass.internal.pcap.core.protocol.PcapProtocol;
@@ -210,9 +210,7 @@ public class PcapEvent extends TmfEvent {
         }
 
         if (packet == null) {
-            @SuppressWarnings("null")
-            @NonNull List<TmfPcapProtocol> emptyList = Collections.EMPTY_LIST;
-            fProtocols = emptyList;
+            fProtocols = checkNotNull(Collections.EMPTY_LIST);
             return fProtocols;
         }
         // Go through all the packets and add them to list.
@@ -224,10 +222,8 @@ public class PcapEvent extends TmfEvent {
             }
         }
 
-        @SuppressWarnings("null")
-        @NonNull ImmutableList<TmfPcapProtocol> immutableList = builder.build();
-        fProtocols = immutableList;
-        return immutableList;
+        fProtocols = checkNotNull(builder.build());
+        return fProtocols;
     }
 
     /**
This page took 0.026485 seconds and 5 git commands to generate.