pcap: fix sonar warnings for null references
authorBernd Hufmann <Bernd.Hufmann@ericsson.com>
Thu, 22 Oct 2015 17:40:50 +0000 (13:40 -0400)
committerBernd Hufmann <bernd.hufmann@ericsson.com>
Mon, 26 Oct 2015 13:49:59 +0000 (09:49 -0400)
Change-Id: I8f1834d47609e3a4aeb2792f0fafe609ae7326fb
Signed-off-by: Bernd Hufmann <Bernd.Hufmann@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/58757
Reviewed-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
pcap/org.eclipse.tracecompass.tmf.pcap.core/src/org/eclipse/tracecompass/internal/tmf/pcap/core/trace/PcapTrace.java

index 25387d8bd6488b907a3648d1fe371a363bce9733..bc43a39492dce3598454840fe12b48081d0787f3 100644 (file)
@@ -28,6 +28,7 @@ import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
 import org.eclipse.tracecompass.internal.pcap.core.packet.BadPacketException;
 import org.eclipse.tracecompass.internal.pcap.core.protocol.pcap.PcapPacket;
@@ -68,7 +69,7 @@ public class PcapTrace extends TmfTrace implements ITmfTraceProperties {
     /** pcap trace type id as defined in plugin.xml */
     public static final String TRACE_TYPE_ID = "org.eclipse.linuxtools.tmf.pcap.core.pcaptrace"; //$NON-NLS-1$
 
-    private static final Collection<ITmfEventAspect> PCAP_ASPECTS =
+    private @NonNull static final Collection<ITmfEventAspect> PCAP_ASPECTS =
             checkNotNull(ImmutableList.of(
                     ITmfEventAspect.BaseAspects.TIMESTAMP,
                     PcapSourceAspect.INSTANCE,
@@ -78,7 +79,7 @@ public class PcapTrace extends TmfTrace implements ITmfTraceProperties {
                     ITmfEventAspect.BaseAspects.CONTENTS
                     ));
 
-    private static final String EMPTY_STRING = ""; //$NON-NLS-1$
+    private @NonNull static final String EMPTY_STRING = ""; //$NON-NLS-1$
     private static final int CONFIDENCE = 50;
     private @Nullable PcapFile fPcapFile;
     private @Nullable Map<String, String> fTraceProperties = null;
This page took 0.026037 seconds and 5 git commands to generate.