Remove unneeded checkNotNull() calls
authorAlexandre Montplaisir <alexmonthy@efficios.com>
Wed, 9 Mar 2016 22:49:15 +0000 (17:49 -0500)
committerAlexandre Montplaisir <alexmonthy@efficios.com>
Tue, 15 Mar 2016 00:34:02 +0000 (20:34 -0400)
With the introduction of Java 8 type annotations and external
@NonNull annotations, some of our checkNotNull() checks are no
longer needed, we can simply remove them.

Change-Id: I00b39d7428e042ae2d93b15d37dda5cbd50f52c2
Signed-off-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Reviewed-on: https://git.eclipse.org/r/68101
Reviewed-by: Hudson CI
95 files changed:
analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/analysis/graph/core/base/TmfGraph.java
analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/internal/analysis/graph/core/criticalpath/AbstractCriticalPathAlgorithm.java
analysis/org.eclipse.tracecompass.analysis.graph.ui/src/org/eclipse/tracecompass/internal/analysis/graph/ui/criticalpath/view/CriticalPathView.java
analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/cpuusage/KernelCpuUsageAnalysis.java
analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/kernelanalysis/KernelThreadInformationProvider.java
analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/latency/SystemCall.java
analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/latency/SystemCallLatencyAnalysis.java
analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/trace/DefaultEventLayout.java
analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/internal/analysis/os/linux/core/kernel/KernelStateProvider.java
analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/internal/analysis/os/linux/core/latency/statistics/SystemCallLatencyStatisticsAnalysisModule.java
analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/analysis/os/linux/ui/views/cpuusage/CpuUsageComposite.java
analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/latency/SystemCallLatencyDensityView.java
analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/latency/statistics/SystemCallLatencyStatisticsView.java
analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/analysis/timing/ui/views/segmentstore/scatter/AbstractSegmentStoreScatterGraphViewer.java
analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/internal/analysis/timing/ui/views/segmentstore/scatter/SegmentStoreScatterGraphTooltipProvider.java
analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/internal/analysis/timing/ui/views/segmentstore/statistics/AbstractSegmentStoreStatisticsViewer.java
btf/org.eclipse.tracecompass.btf.core/src/org/eclipse/tracecompass/btf/core/trace/BtfEventAspects.java
common/org.eclipse.tracecompass.common.core.tests/src/org/eclipse/tracecompass/common/core/tests/collect/BufferedBlockingQueueTest.java
common/org.eclipse.tracecompass.common.core/src/org/eclipse/tracecompass/common/core/TraceCompassActivator.java
ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/types/StringDeclaration.java
ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/types/StructDeclaration.java
ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/types/ArrayDeclaration.java
ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/types/ArrayDefinition.java
ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/types/ByteArrayDefinition.java
ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/types/SequenceDeclaration.java
ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/trace/CTFStream.java
ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/tmf/ctf/core/event/CtfTmfEvent.java
ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/tmf/ctf/core/event/CtfTmfEventField.java
ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/tmf/ctf/core/trace/CtfTmfTrace.java
doc/org.eclipse.tracecompass.examples/src/org/eclipse/tracecompass/examples/ui/viewers/histogram/NewHistogramViewer.java
gdbtrace/org.eclipse.tracecompass.gdbtrace.core/src/org/eclipse/tracecompass/internal/gdbtrace/core/trace/GdbEventAspects.java
lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/tracecompass/internal/lttng2/control/stubs/shells/LTTngToolsFileShell.java
lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/shared/org/eclipse/tracecompass/lttng2/lttng/kernel/core/tests/shared/vm/VmTestExperiment.java
lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/tracecompass/lttng2/kernel/core/tests/analysis/vm/VirtualMachineAnalysisTest.java
lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/analysis/graph/handlers/BaseHandler.java
lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/analysis/graph/model/LttngSystemModel.java
lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/analysis/vm/model/qemukvm/QemuKvmVmModel.java
lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/analysis/vm/module/VirtualMachineCpuAnalysis.java
lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/LttngEventLayout.java
lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/PerfEventLayout.java
lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/lttng2/kernel/core/trace/LttngKernelTrace.java
lttng/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/tracecompass/internal/lttng2/kernel/ui/criticalpath/CriticalPathParameterProvider.java
lttng/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/tracecompass/internal/lttng2/kernel/ui/views/vm/vcpuview/VirtualMachineView.java
lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/internal/lttng2/ust/core/analysis/debuginfo/FileOffsetMapper.java
lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/internal/lttng2/ust/core/analysis/debuginfo/UstDebugInfoStateProvider.java
lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/internal/lttng2/ust/core/analysis/memory/UstMemoryStateProvider.java
lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/internal/lttng2/ust/core/callstack/LttngUstCallStackProvider.java
lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/lttng2/ust/core/analysis/debuginfo/UstDebugInfoAnalysisModule.java
lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/lttng2/ust/core/analysis/memory/UstMemoryAnalysisModule.java
lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/lttng2/ust/core/trace/LttngUstTrace.java
pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/ethernet2/EthernetIIPacket.java
pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/ipv4/IPv4Packet.java
pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/pcap/PcapPacket.java
pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/tcp/TCPEndpoint.java
pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/tcp/TCPPacket.java
pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/udp/UDPEndpoint.java
pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/udp/UDPPacket.java
pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/unknown/UnknownPacket.java
pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/stream/PacketStream.java
pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/trace/PcapFile.java
pcap/org.eclipse.tracecompass.tmf.pcap.core/src/org/eclipse/tracecompass/internal/tmf/pcap/core/event/PcapEvent.java
pcap/org.eclipse.tracecompass.tmf.pcap.core/src/org/eclipse/tracecompass/internal/tmf/pcap/core/trace/PcapTrace.java
pcap/org.eclipse.tracecompass.tmf.pcap.core/src/org/eclipse/tracecompass/internal/tmf/pcap/core/util/PcapEventFactory.java
statesystem/org.eclipse.tracecompass.segmentstore.core/src/org/eclipse/tracecompass/segmentstore/core/treemap/TreeMapStore.java
statesystem/org.eclipse.tracecompass.statesystem.core.tests/stubs/org/eclipse/tracecompass/statesystem/core/tests/stubs/backend/HistoryTreeStub.java
tmf/org.eclipse.tracecompass.tmf.analysis.xml.core/src/org/eclipse/tracecompass/tmf/analysis/xml/core/model/TmfXmlStateValue.java
tmf/org.eclipse.tracecompass.tmf.analysis.xml.core/src/org/eclipse/tracecompass/tmf/analysis/xml/core/module/TmfAnalysisModuleHelperXml.java
tmf/org.eclipse.tracecompass.tmf.analysis.xml.ui/src/org/eclipse/tracecompass/internal/tmf/analysis/xml/ui/views/xychart/XmlXYViewer.java
tmf/org.eclipse.tracecompass.tmf.core.tests/stubs/org/eclipse/tracecompass/tmf/tests/stubs/analysis/AnalysisModuleTestHelper.java
tmf/org.eclipse.tracecompass.tmf.core.tests/stubs/org/eclipse/tracecompass/tmf/tests/stubs/trace/text/SyslogTrace.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/internal/tmf/core/analysis/TmfAnalysisModuleSourceConfigElement.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/internal/tmf/core/parsers/custom/CustomEventAspects.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/analysis/TmfAbstractAnalysisModule.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/analysis/TmfAnalysisManager.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/event/TmfEventField.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/event/aspect/ITmfEventAspect.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/parsers/custom/CustomTxtTraceDefinition.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/parsers/custom/CustomXmlTraceDefinition.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/signal/TmfSelectionRangeUpdatedSignal.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/statesystem/AbstractTmfStateProvider.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/statesystem/TmfStateSystemAnalysisModule.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/TmfTrace.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/TmfTraceManager.java
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/experiment/TmfExperimentUtils.java
tmf/org.eclipse.tracecompass.tmf.remote.core.tests/src/org/eclipse/tracecompass/tmf/remote/core/tests/shell/CommandShellTest.java
tmf/org.eclipse.tracecompass.tmf.remote.core/src/org/eclipse/tracecompass/internal/tmf/remote/core/shell/CommandInput.java
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/markers/LostEventsMarkerEventSource.java
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/project/operations/NewExperimentOperation.java
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/project/operations/SelectTracesOperation.java
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/viewers/statistics/TmfStatisticsViewer.java
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/editors/TmfEventsEditor.java
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/editors/TmfTraceColumnManager.java
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/TmfEventsTable.java
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/xycharts/TmfClosestDataPointTooltipProvider.java
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/timegraph/AbstractTimeGraphView.java

index 1e0ec7cd88ccf416f9585922026d59df2a5ea4a8..d59a8bc6069b17d2641ad427f6ad20d4c132d679 100644 (file)
@@ -265,7 +265,7 @@ public class TmfGraph {
      * @return The list of vertices for the object
      */
     public List<TmfVertex> getNodesOf(IGraphWorker obj) {
-        return NonNullUtils.checkNotNull(fNodeMap.get(obj));
+        return fNodeMap.get(obj);
     }
 
     /**
@@ -285,7 +285,7 @@ public class TmfGraph {
      * @return The vertex map
      */
     public Set<IGraphWorker> getWorkers() {
-        return NonNullUtils.checkNotNull(ImmutableSet.copyOf(fNodeMap.keySet()));
+        return ImmutableSet.copyOf(fNodeMap.keySet());
     }
 
     /**
@@ -345,7 +345,7 @@ public class TmfGraph {
         HashSet<TmfVertex> visited = new HashSet<>();
         stack.add(start);
         while (!stack.isEmpty()) {
-            TmfVertex curr = NonNullUtils.checkNotNull(stack.pop());
+            TmfVertex curr = stack.pop();
             if (visited.contains(curr)) {
                 continue;
             }
index ce9051f8665dc26588cddee2cf7e77f48e313f95..38e75d4973153131cb780662ad198d746b554404 100644 (file)
@@ -16,7 +16,6 @@ import org.eclipse.tracecompass.analysis.graph.core.base.TmfGraph;
 import org.eclipse.tracecompass.analysis.graph.core.base.TmfVertex;
 import org.eclipse.tracecompass.analysis.graph.core.base.TmfVertex.EdgeDirection;
 import org.eclipse.tracecompass.analysis.graph.core.criticalpath.ICriticalPathAlgorithm;
-import org.eclipse.tracecompass.common.core.NonNullUtils;
 
 /**
  * Abstract class for critical path algorithms
@@ -110,12 +109,12 @@ public abstract class AbstractCriticalPathAlgorithm implements ICriticalPathAlgo
 
     @Override
     public String getID() {
-        return NonNullUtils.checkNotNull(getClass().getName());
+        return getClass().getName();
     }
 
     @Override
     public String getDisplayName() {
-        return NonNullUtils.checkNotNull(getClass().getSimpleName());
+        return getClass().getSimpleName();
     }
 
 }
index 2ceed26e2adc2429e4dd5e5ee5ca83d20e2669bd..1ec8e4278fdf59c01ef234b496956f2f1aaf2128 100644 (file)
@@ -154,7 +154,7 @@ public class CriticalPathView extends AbstractTimeGraphView {
             public void visit(TmfEdge link, boolean horizontal) {
                 if (horizontal) {
                     Object parent = fGraph.getParentOf(link.getVertexFrom());
-                    CriticalPathEntry entry = checkNotNull(fRootList.get(parent));
+                    CriticalPathEntry entry = fRootList.get(parent);
                     TimeEvent ev = new TimeEvent(entry, link.getVertexFrom().getTs(), link.getDuration(),
                             getMatchingState(link.getType()).ordinal());
                     entry.addEvent(ev);
@@ -270,7 +270,7 @@ public class CriticalPathView extends AbstractTimeGraphView {
             }
 
             for (TimeGraphEntry entry : list) {
-                buildStatusEvents(trace, (CriticalPathEntry) NonNullUtils.checkNotNull(entry));
+                buildStatusEvents(trace, (CriticalPathEntry) entry);
             }
             workerEntries.put(worker, list);
         }
@@ -511,7 +511,7 @@ public class CriticalPathView extends AbstractTimeGraphView {
         while (iterator.hasNext()) {
             ITimeEvent event = iterator.next();
             /* is event visible */
-            if (intersects(realStart, realEnd, NonNullUtils.checkNotNull(event))) {
+            if (intersects(realStart, realEnd, event)) {
                 eventList.add(event);
             }
         }
index 24e496d3a1756b727c9b9bfc1fc1f99eaa6e4298..045d634a88d036df3540ef02ed43f0ca37f538f3 100644 (file)
@@ -239,10 +239,10 @@ public class KernelCpuUsageAnalysis extends TmfStateSystemAnalysisModule {
 
                     long currentCount = countAtEnd - countAtStart;
                     if (currentCount < 0) {
-                        Activator.getDefault().logWarning(checkNotNull(String.format("Negative count: start %d, end %d", countAtStart, countAtEnd))); //$NON-NLS-1$
+                        Activator.getDefault().logWarning(String.format("Negative count: start %d, end %d", countAtStart, countAtEnd)); //$NON-NLS-1$
                         currentCount = 0;
                     } else if (currentCount > endTime - startTime) {
-                        Activator.getDefault().logWarning(checkNotNull(String.format("CPU Usage: Spent more time on CPU than allowed: %s spent %d when max should be %d", curTidName, currentCount, endTime - startTime))); //$NON-NLS-1$
+                        Activator.getDefault().logWarning(String.format("CPU Usage: Spent more time on CPU than allowed: %s spent %d when max should be %d", curTidName, currentCount, endTime - startTime)); //$NON-NLS-1$
                         currentCount = 0;
                     }
                     cpuTotal += currentCount;
index 874020e14ca278e0085855aacc13fdfb66a4a9d4..88d13b51134d50c21a3bec81a82ccc35f94d8b73 100644 (file)
@@ -176,7 +176,7 @@ public final class KernelThreadInformationProvider {
                 execNameValue = interval.getStateValue();
                 switch (execNameValue.getType()) {
                 case STRING:
-                    execName = NonNullUtils.checkNotNull(execNameValue.unboxStr());
+                    execName = execNameValue.unboxStr();
                     break;
                 case DOUBLE:
                 case LONG:
index d89ff4e46dffe8c22f2a8f339c13e85272717d89..0ccaadc8d004b3315c0b4c3d54992bcc88f2ee2a 100644 (file)
@@ -13,7 +13,6 @@ import java.io.Serializable;
 import java.util.Map;
 
 import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.tracecompass.common.core.NonNullUtils;
 import org.eclipse.tracecompass.segmentstore.core.ISegment;
 
 import com.google.common.collect.ImmutableMap;
@@ -53,7 +52,7 @@ public class SystemCall implements ISegment {
                 Map<String, String> arguments) {
             fStartTime = startTime;
             fName = name;
-            fArgs = NonNullUtils.checkNotNull(ImmutableMap.copyOf(arguments));
+            fArgs = ImmutableMap.copyOf(arguments);
         }
     }
 
index 1f12df8f839a2937736b566e8a04bac92e1227f0..9db321fa6abe7185b4e6cbb8839877bc0b630416 100644 (file)
@@ -47,7 +47,7 @@ public class SystemCallLatencyAnalysis extends AbstractSegmentStoreAnalysisModul
     private static final String DATA_FILENAME = "latency-analysis.dat"; //$NON-NLS-1$
 
     private static final Collection<ISegmentAspect> BASE_ASPECTS =
-            checkNotNull(ImmutableList.of(SyscallNameAspect.INSTANCE));
+            ImmutableList.of(SyscallNameAspect.INSTANCE);
 
     @Override
     public String getId() {
@@ -88,7 +88,7 @@ public class SystemCallLatencyAnalysis extends AbstractSegmentStoreAnalysisModul
             super.handleData(event);
             IKernelAnalysisEventLayout layout = fLayout;
             if (layout == null) {
-                IKernelTrace trace = checkNotNull((IKernelTrace) event.getTrace());
+                IKernelTrace trace = (IKernelTrace) event.getTrace();
                 layout = trace.getKernelEventLayout();
                 fLayout = layout;
             }
index b593e94995f7d44cb99077385b81a7a0c085ca93..149600c72d21997b14355ccdf391bca6931032e9 100644 (file)
@@ -12,8 +12,6 @@
 
 package org.eclipse.tracecompass.analysis.os.linux.core.trace;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import java.util.Collection;
 
 import org.eclipse.jdt.annotation.NonNull;
@@ -50,7 +48,7 @@ public class DefaultEventLayout implements IKernelAnalysisEventLayout {
     private static final String SCHED_WAKEUP = "sched_wakeup"; //$NON-NLS-1$
     private static final String SCHED_WAKEUP_NEW = "sched_wakeup_new"; //$NON-NLS-1$
     private static final Collection<String> SCHED_WAKEUP_EVENTS =
-            checkNotNull(ImmutableList.of(SCHED_WAKEUP, SCHED_WAKEUP_NEW));
+            ImmutableList.of(SCHED_WAKEUP, SCHED_WAKEUP_NEW);
 
     private static final String SCHED_PROCESS_FORK = "sched_process_fork"; //$NON-NLS-1$
     private static final String SCHED_PROCESS_EXIT = "sched_process_exit"; //$NON-NLS-1$
index 808784877c5dfd83b4165dcd35e06afe21595172..a250921b99d903528b9d3c102efe9951a57ef830 100644 (file)
@@ -120,7 +120,7 @@ public class KernelStateProvider extends AbstractTmfStateProvider {
             builder.put(eventSchedWakeup, new SchedWakeupHandler(layout));
         }
 
-        return NonNullUtils.checkNotNull(builder.build());
+        return builder.build();
     }
 
     // ------------------------------------------------------------------------
index 3dbc8f352f5cf5eecbd009c1effbcd21423ed049..f7e97cb5ee5d7ffe3b04875b510179426ba3d311 100644 (file)
@@ -11,8 +11,6 @@
  *******************************************************************************/
 package org.eclipse.tracecompass.internal.analysis.os.linux.core.latency.statistics;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
@@ -52,10 +50,10 @@ public class SystemCallLatencyStatisticsAnalysisModule extends TmfAbstractAnalys
     protected Iterable<IAnalysisModule> getDependentAnalyses() {
         ITmfTrace trace = getTrace();
         if (trace != null) {
-            SystemCallLatencyAnalysis module = TmfTraceUtils.getAnalysisModuleOfClass(trace, SystemCallLatencyAnalysis.class, checkNotNull(SystemCallLatencyAnalysis.ID));
+            SystemCallLatencyAnalysis module = TmfTraceUtils.getAnalysisModuleOfClass(trace, SystemCallLatencyAnalysis.class, SystemCallLatencyAnalysis.ID);
             if (module != null) {
                 fLatencyModule = module;
-                return checkNotNull(ImmutableList.of((IAnalysisModule) module));
+                return ImmutableList.of((IAnalysisModule) module);
             }
         }
         return super.getDependentAnalyses();
@@ -96,7 +94,7 @@ public class SystemCallLatencyStatisticsAnalysisModule extends TmfAbstractAnalys
                 return false;
             }
             ISegment segment = iter.next();
-            total.update(checkNotNull(segment));
+            total.update(segment);
         }
         fTotalStats = total;
         return true;
index f1b7e03655a70d87913278d17b663471647762ff..162096356d2efb2e360d6baf49a4ff39be12846d 100644 (file)
@@ -184,7 +184,7 @@ public class CpuUsageComposite extends AbstractTmfTreeViewer {
             for (ITmfTreeViewerEntry entry : rootEntry.getChildren()) {
                 if (entry instanceof CpuUsageEntry) {
                     if (selectedThread.equals(((CpuUsageEntry) entry).getTid())) {
-                        List<ITmfTreeViewerEntry> list = checkNotNull(Collections.singletonList(entry));
+                        List<ITmfTreeViewerEntry> list = Collections.singletonList(entry);
                         super.setSelection(list);
                         return;
                     }
index 304d55c9f99097d68ee657d7fe244c508d609c9f..1f4617f4a4c9a5b5951b6457539c38e4b57c49ce 100644 (file)
@@ -16,7 +16,6 @@ import org.eclipse.swt.widgets.Table;
 import org.eclipse.tracecompass.analysis.timing.ui.views.segmentstore.density.AbstractSegmentStoreDensityView;
 import org.eclipse.tracecompass.analysis.timing.ui.views.segmentstore.density.AbstractSegmentStoreDensityViewer;
 import org.eclipse.tracecompass.analysis.timing.ui.views.segmentstore.table.AbstractSegmentStoreTableViewer;
-import org.eclipse.tracecompass.common.core.NonNullUtils;
 
 /**
  * System Call Density view
@@ -50,7 +49,7 @@ public class SystemCallLatencyDensityView extends AbstractSegmentStoreDensityVie
 
     @Override
     protected AbstractSegmentStoreDensityViewer createSegmentStoreDensityViewer(Composite parent) {
-        return new SystemCallDensityViewer(NonNullUtils.checkNotNull(parent));
+        return new SystemCallDensityViewer(parent);
     }
 
 }
index 9aca6e8a6221b7601eeda4cbcf85f2a3aeac8de0..daf9f9e3d05e53c8c850cd52a0f54d72adb6c75c 100644 (file)
@@ -11,8 +11,6 @@
  *******************************************************************************/
 package org.eclipse.tracecompass.internal.analysis.os.linux.ui.views.latency.statistics;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.tracecompass.internal.analysis.timing.ui.views.segmentstore.statistics.AbstractSegmentStoreStatisticsView;
 import org.eclipse.tracecompass.internal.analysis.timing.ui.views.segmentstore.statistics.AbstractSegmentStoreStatisticsViewer;
@@ -30,7 +28,7 @@ public class SystemCallLatencyStatisticsView extends AbstractSegmentStoreStatist
 
     @Override
     protected AbstractSegmentStoreStatisticsViewer createSegmentStoreStatisticsViewer(Composite parent) {
-        return checkNotNull((AbstractSegmentStoreStatisticsViewer) new SystemCallLatencyStatisticsViewer(checkNotNull(parent)));
+        return new SystemCallLatencyStatisticsViewer(parent);
     }
 
 }
index 015140f0b046c57f8cf2c418c11bdbe3fe0752c6..1017c9f58173ba804373fe482a621055509bd13e 100644 (file)
@@ -118,9 +118,9 @@ public abstract class AbstractSegmentStoreScatterGraphViewer extends TmfCommonXL
             redraw(statusMonitor, startTime, endTime, displayData);
 
             if (statusMonitor.isCanceled()) {
-                return NonNullUtils.checkNotNull(Status.CANCEL_STATUS);
+                return Status.CANCEL_STATUS;
             }
-            return NonNullUtils.checkNotNull(Status.OK_STATUS);
+            return Status.OK_STATUS;
 
         }
 
index 7225d92c4b6383c731926f196521bb5c47a64fcc..50d22ce38c90602bd53ea78c37564a1f12b3c554 100644 (file)
@@ -14,7 +14,6 @@ package org.eclipse.tracecompass.internal.analysis.timing.ui.views.segmentstore.
 import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
 
 import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.tracecompass.internal.analysis.timing.ui.views.segmentstore.scatter.Messages;
 import org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp;
 import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimestamp;
 import org.eclipse.tracecompass.tmf.ui.viewers.xycharts.ITmfChartTimeProvider;
index 7a76933128928165695f8758a05d19d8984b290a..347aeb664335a723e5ab49cbad9d4bf436b12500 100644 (file)
@@ -79,7 +79,7 @@ public abstract class AbstractSegmentStoreStatisticsViewer extends AbstractTmfTr
             } else if (element instanceof SegmentStoreStatisticsEntry) {
                 SegmentStoreStatisticsEntry entry = (SegmentStoreStatisticsEntry) element;
                 if (columnIndex == 0) {
-                    return checkNotNull(String.valueOf(entry.getName()));
+                    return String.valueOf(entry.getName());
                 }
                 if (entry.getEntry().getNbSegments() > 0) {
                     if (columnIndex == 1) {
@@ -243,7 +243,7 @@ public abstract class AbstractSegmentStoreStatisticsViewer extends AbstractTmfTr
     protected static String toFormattedString(double value) {
         // The cast to long is needed because the formatter cannot truncate the
         // number.
-        String percentageString = checkNotNull(String.format("%s", FORMATTER.format(value))); //$NON-NLS-1$
+        String percentageString = String.format("%s", FORMATTER.format(value)); //$NON-NLS-1$
         return percentageString;
     }
 
@@ -274,7 +274,7 @@ public abstract class AbstractSegmentStoreStatisticsViewer extends AbstractTmfTr
          * @return statistics object
          */
         public SegmentStoreStatistics getEntry() {
-            return checkNotNull(fEntry);
+            return fEntry;
         }
 
     }
index d09819841e8a6f94c2d512ba868a57e7fd64809c..e14a70305b232b4b770c1021054e57b44aacb5ab 100644 (file)
@@ -17,7 +17,6 @@ package org.eclipse.tracecompass.btf.core.trace;
 import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.eclipse.jdt.annotation.Nullable;
 import org.eclipse.tracecompass.btf.core.event.BtfEvent;
-import org.eclipse.tracecompass.common.core.NonNullUtils;
 import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
 import org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect;
 import org.eclipse.tracecompass.tmf.core.event.aspect.TmfContentFieldAspect;
@@ -35,7 +34,7 @@ public final class BtfEventAspects {
     private BtfEventAspects() {}
 
     private static final Iterable<ITmfEventAspect> BTF_ASPECTS =
-            NonNullUtils.checkNotNull(ImmutableList.of(
+            ImmutableList.of(
                     ITmfEventAspect.BaseAspects.TIMESTAMP,
                     new BtfSourceAspect(),
                     new TmfContentFieldAspect(BtfColumnNames.SOURCE_INSTANCE.toString(), BtfColumnNames.SOURCE_INSTANCE.toString()),
@@ -44,7 +43,7 @@ public final class BtfEventAspects {
                     new TmfContentFieldAspect(BtfColumnNames.TARGET_INSTANCE.toString(), BtfColumnNames.TARGET_INSTANCE.toString()),
                     new TmfContentFieldAspect(BtfColumnNames.EVENT.toString(), BtfColumnNames.EVENT.toString()),
                     new TmfContentFieldAspect(BtfColumnNames.NOTES.toString(), BtfColumnNames.NOTES.toString())
-                    ));
+                    );
 
     /**
      * The "source" aspect, whose value comes from {@link ITmfEvent#getSource()}
index f027fa7e1a467c0e7007ff8d3fb3155781dc71c5..d0b3095d514fcd8dadae06b8fb802dd959271616 100644 (file)
@@ -33,7 +33,6 @@ import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 
 import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.tracecompass.common.core.NonNullUtils;
 import org.eclipse.tracecompass.common.core.collect.BufferedBlockingQueue;
 import org.junit.Before;
 import org.junit.Rule;
@@ -160,10 +159,10 @@ public class BufferedBlockingQueueTest {
              * fill it up here!
              */
             for (int j = 0; j < 50; j++) {
-                Integer testInt = NonNullUtils.checkNotNull(rnd.nextInt());
-                Long testLong = NonNullUtils.checkNotNull(rnd.nextLong());
-                Double testDouble = NonNullUtils.checkNotNull(rnd.nextDouble());
-                Double testGaussian = NonNullUtils.checkNotNull(rnd.nextGaussian());
+                Integer testInt = rnd.nextInt();
+                Long testLong = rnd.nextLong();
+                Double testDouble = rnd.nextDouble();
+                Double testGaussian = rnd.nextGaussian();
 
                 expectedValues.add(testInt);
                 expectedValues.add(testLong);
index 5e2cc18feae4f427e61104f21b209ec21fd0686d..39266d6f0c4e2fe79686d5eeb27ba4d537f48f2c 100644 (file)
@@ -12,7 +12,6 @@
 
 package org.eclipse.tracecompass.common.core;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
 import static org.eclipse.tracecompass.common.core.NonNullUtils.nullToEmptyString;
 
 import java.util.Collections;
@@ -38,7 +37,7 @@ public abstract class TraceCompassActivator extends Plugin {
 
     /** Map of all the registered activators, indexed by plugin ID */
     private static final Map<String, TraceCompassActivator> ACTIVATORS =
-            checkNotNull(Collections.synchronizedMap(new HashMap<String, TraceCompassActivator>()));
+            Collections.synchronizedMap(new HashMap<String, TraceCompassActivator>());
 
     /** This instance's plug-in ID */
     private final String fPluginId;
index 045e12d3e50cc0bd8e4850e2d1093c8f7d87d66f..4e6afd0bbab2ca25901389ed7024e4366a9f59ed 100644 (file)
@@ -14,7 +14,6 @@ package org.eclipse.tracecompass.ctf.core.event.types;
 
 import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.tracecompass.common.core.NonNullUtils;
 import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.io.BitBuffer;
 import org.eclipse.tracecompass.ctf.core.event.scope.IDefinitionScope;
@@ -138,7 +137,7 @@ public class StringDeclaration extends Declaration {
             sb.append(c);
             c = (char) input.get(BITS_PER_BYTE, false);
         }
-        return NonNullUtils.checkNotNull(sb.toString());
+        return sb.toString();
     }
 
     @Override
index be18d3837c9caede6e85209cc115d97f224f6061..ff4482f5d164dd15715bb4235a335f727a1cfcb8 100644 (file)
@@ -171,7 +171,7 @@ public class StructDeclaration extends Declaration {
         final Definition[] myFields = new Definition[fFieldMap.size()];
 
         StructDefinition structDefinition = new StructDefinition(this, definitionScope,
-                fieldScope, fieldScope.getName(), checkNotNull(fFieldMap.keySet()), myFields);
+                fieldScope, fieldScope.getName(), fFieldMap.keySet(), myFields);
         fillStruct(input, myFields, structDefinition);
         return structDefinition;
     }
@@ -223,7 +223,7 @@ public class StructDeclaration extends Declaration {
             merged = new InternalDef(definitionScope, eventHeaderDef);
         }
         StructDefinition structDefinition = new StructDefinition(this, merged,
-                fields, fields.getName(), checkNotNull(fFieldMap.keySet()), myFields);
+                fields, fields.getName(), fFieldMap.keySet(), myFields);
         if (merged instanceof InternalDef) {
             InternalDef internalDef = (InternalDef) merged;
             internalDef.setDefinition(structDefinition);
index 410012c408696067e4cee57bb420c01e778853da..4a4572c4d366bd06160aae05a7c7f06e09ff2430 100644 (file)
@@ -12,8 +12,6 @@
 
 package org.eclipse.tracecompass.internal.ctf.core.event.types;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import java.util.List;
 
 import org.eclipse.jdt.annotation.NonNull;
@@ -138,7 +136,7 @@ public final class ArrayDeclaration extends CompoundDeclaration {
             }
             definitions.add(fElemType.createDefinition(definitionScope, name, input));
         }
-        return checkNotNull(definitions.build());
+        return definitions.build();
     }
 
     @Override
index 5a70f024a5d41be38cc2646bb4374bdbe8287cff..77dbe482cbb72f2c0c0da44df026a5363e2a8bea 100644 (file)
@@ -12,8 +12,6 @@
 
 package org.eclipse.tracecompass.internal.ctf.core.event.types;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import java.util.List;
 
 import org.eclipse.jdt.annotation.NonNullByDefault;
@@ -66,7 +64,7 @@ public final class ArrayDefinition extends AbstractArrayDefinition {
             String fieldName,
             List<Definition> definitions) {
         super(declaration, definitionScope, fieldName);
-        fDefinitions = checkNotNull(ImmutableList.copyOf(definitions));
+        fDefinitions = ImmutableList.copyOf(definitions);
     }
 
     // ------------------------------------------------------------------------
@@ -94,6 +92,6 @@ public final class ArrayDefinition extends AbstractArrayDefinition {
         Joiner joiner = Joiner.on(", ").skipNulls(); //$NON-NLS-1$
         b.append(joiner.join(fDefinitions));
         b.append(']');
-        return checkNotNull(b.toString());
+        return b.toString();
     }
 }
\ No newline at end of file
index 4964bfed45b42d3b150610c5313dc3e24a6f764a..cde364096ddb62580c25b90b0e85c1e37e1e4267 100644 (file)
 
 package org.eclipse.tracecompass.internal.ctf.core.event.types;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import java.util.Arrays;
 import java.util.List;
 
 import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.tracecompass.common.core.NonNullUtils;
 import org.eclipse.tracecompass.ctf.core.event.scope.IDefinitionScope;
 import org.eclipse.tracecompass.ctf.core.event.types.AbstractArrayDefinition;
 import org.eclipse.tracecompass.ctf.core.event.types.CompoundDeclaration;
@@ -79,7 +76,7 @@ public final class ByteArrayDefinition extends AbstractArrayDefinition {
                 byte fieldValue = fContent[i];
                 builder.add(new IntegerDefinition(charDecl, getDefinitionScope(), fieldName, fieldValue));
             }
-            fDefs = NonNullUtils.checkNotNull(builder.build());
+            fDefs = builder.build();
             return fDefs;
         }
 
@@ -107,7 +104,7 @@ public final class ByteArrayDefinition extends AbstractArrayDefinition {
         b.append('[');
         Joiner.on(", ").appendTo(b, Arrays.asList(fContent)); //$NON-NLS-1$
         b.append(']');
-        return checkNotNull(b.toString());
+        return b.toString();
     }
 
     /**
index 1a871ddbb1a8a99af9cf8f2fefab92259c9ed839..76a5dc608af94861a1bb3cc8b71e5dec1dd113b8 100644 (file)
@@ -135,7 +135,7 @@ public class SequenceDeclaration extends CompoundDeclaration {
             String elemName = checkNotNull(paths.get(i));
             definitions.add(fElemType.createDefinition(definitionScope, elemName, input));
         }
-        List<@NonNull Definition> list = checkNotNull(definitions.build());
+        List<@NonNull Definition> list = definitions.build();
         return new ArrayDefinition(this, definitionScope, fieldName, list);
     }
 
index 663dae05e816ddff22f32d2e3d0a640741434e53..e4988c22fde1d3b9feea98fc244b4cf3583e37f3 100644 (file)
@@ -20,7 +20,6 @@ import java.util.List;
 import java.util.Set;
 
 import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.tracecompass.common.core.NonNullUtils;
 import org.eclipse.tracecompass.ctf.core.CTFException;
 import org.eclipse.tracecompass.ctf.core.event.IEventDeclaration;
 import org.eclipse.tracecompass.ctf.core.event.types.IDeclaration;
@@ -195,7 +194,7 @@ public class CTFStream implements ICTFStream {
      */
     @Override
     public List<@Nullable IEventDeclaration> getEventDeclarations() {
-        return NonNullUtils.checkNotNull(Collections.unmodifiableList(fEvents));
+        return Collections.unmodifiableList(fEvents);
     }
 
     @Override
index d76e26da977f4c533dc18e91dfb19eb8ce8fd5e6..32e7d8ed1af918105b2c5ed5e3727edcd29b7fb6 100644 (file)
@@ -293,8 +293,7 @@ public class CtfTmfEvent extends TmfEvent
         ICompositeDefinition structFields = eventDef.getFields();
         if (structFields != null) {
             if (structFields.getFieldNames() != null) {
-                for (String curFieldName : structFields.getFieldNames()) {
-                    String fn = checkNotNull(curFieldName);
+                for (String fn : structFields.getFieldNames()) {
                     fields.add(CtfTmfEventField.parseField((IDefinition) structFields.getDefinition(fn), fn));
                 }
             }
@@ -309,7 +308,7 @@ public class CtfTmfEvent extends TmfEvent
             }
         }
 
-        return checkNotNull(fields.toArray(new @NonNull CtfTmfEventField[fields.size()]));
+        return fields.toArray(new @NonNull CtfTmfEventField[fields.size()]);
     }
 
     // ------------------------------------------------------------------------
index d6a0bdd2d07a869f94fe524cab8e7f091083b9b3..c64c28de1b64594263226b51eb3b0079f20a0a03 100644 (file)
@@ -189,8 +189,7 @@ public abstract class CtfTmfEventField extends TmfEventField {
 
             List<ITmfEventField> list = new ArrayList<>();
             /* Recursively parse the fields */
-            for (String curFieldName : strDef.getFieldNames()) {
-                String fn = checkNotNull(curFieldName);
+            for (String fn : strDef.getFieldNames()) {
                 list.add(CtfTmfEventField.parseField((IDefinition) strDef.getDefinition(fn), fn));
             }
             field = new CTFStructField(fieldName, list.toArray(new CtfTmfEventField[list.size()]));
index 6ad176f06b1c56d217a3c4916a21a15d8cd1c6d0..76591c698938f219dff617e2c6943ce88acdba19 100644 (file)
@@ -104,13 +104,13 @@ public class CtfTmfTrace extends TmfTrace
      * @since 1.0
      */
     protected static final @NonNull Collection<@NonNull ITmfEventAspect> CTF_ASPECTS =
-            checkNotNull(ImmutableList.of(
+            ImmutableList.of(
                     ITmfEventAspect.BaseAspects.TIMESTAMP,
                     new CtfChannelAspect(),
                     new CtfCpuAspect(),
                     ITmfEventAspect.BaseAspects.EVENT_TYPE,
                     ITmfEventAspect.BaseAspects.CONTENTS
-                    ));
+                    );
 
     /**
      * The Ctf clock unique identifier field
index 413d33b881ad78b3f2f7cd070c4c134321507a46..61d0ba3e2976a8f638e2303138424a329745c86b 100644 (file)
@@ -12,8 +12,6 @@
  *******************************************************************************/
 package org.eclipse.tracecompass.examples.ui.viewers.histogram;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import java.util.Arrays;
 import java.util.List;
 
@@ -76,7 +74,6 @@ public class NewHistogramViewer extends TmfBarChartViewer {
 
                     /* Add the values for each trace */
                     for (ITmfTrace trace : TmfTraceManager.getTraceSet(getTrace())) {
-                        trace = checkNotNull(trace);
                         /* Retrieve the statistics object */
                         final TmfStatisticsModule statsMod =
                                TmfTraceUtils.getAnalysisModuleOfClass(trace, TmfStatisticsModule.class, TmfStatisticsModule.ID);
index 9c1b7719b639011943fb04011bf4cda409f4539e..188c14bd48c98b84b642f0fa7e79b2550bda9bf4 100644 (file)
@@ -13,8 +13,6 @@
 
 package org.eclipse.tracecompass.internal.gdbtrace.core.trace;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.tracecompass.internal.gdbtrace.core.event.GdbTraceEvent;
 import org.eclipse.tracecompass.internal.gdbtrace.core.event.GdbTraceEventContent;
@@ -34,12 +32,12 @@ public final class GdbEventAspects {
     private GdbEventAspects() {}
 
     private static final @NonNull Iterable<ITmfEventAspect> GDB_ASPECTS =
-            checkNotNull(ImmutableList.of(
+            ImmutableList.of(
                     new TmfContentFieldAspect(GdbTraceEventContent.TRACE_FRAME, GdbTraceEventContent.TRACE_FRAME),
                     new TmfContentFieldAspect(GdbTraceEventContent.TRACEPOINT, GdbTraceEventContent.TRACEPOINT),
                     new GdbFileAspect(),
                     ITmfEventAspect.BaseAspects.CONTENTS
-                    ));
+                    );
 
     private static class GdbFileAspect implements ITmfEventAspect {
 
index 676675923e215ffd14b464761ce127a9fc8f1521..ebcd00e29db329ecb4dcf55b7f2ba943802b04d5 100644 (file)
@@ -239,8 +239,8 @@ public class LTTngToolsFileShell extends TestCommandShell {
                             // Save output/result in command map
                             if (output != null && errorOutput != null) {
                                 commandMap.put(input, createCommandResult(result,
-                                        checkNotNull(output.toArray(new @NonNull String[output.size()])),
-                                        checkNotNull(errorOutput.toArray(new @NonNull String[errorOutput.size()]))));
+                                        output.toArray(new @NonNull String[output.size()]),
+                                        errorOutput.toArray(new @NonNull String[errorOutput.size()])));
                             }
                             inOutput = false;
                         } else if (OUTPUT_KEY.equals(strLine)) {
index e9ffc3357b078c2a7c2c6c47825b021b42113cce..ba963ec0a8fd601cbfe3523fc906fc5fa81a48a6 100644 (file)
@@ -12,8 +12,6 @@
 
 package org.eclipse.tracecompass.lttng2.lttng.kernel.core.tests.shared.vm;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import java.io.File;
 import java.util.HashSet;
 import java.util.Set;
@@ -68,7 +66,7 @@ public enum VmTestExperiment {
                 traces.add(tmfTrace);
             }
         }
-        String expName = checkNotNull(this.name());
+        String expName = name();
         VirtualMachineExperiment experiment = new VirtualMachineExperiment(expName, traces);
         if (deleteSuppFiles) {
             /*
index e5cd79b54271006348d2900efd94e348e29f2faa..4b28bea7205d81c398fad312d090390decc4ceec 100644 (file)
@@ -12,7 +12,6 @@
 
 package org.eclipse.tracecompass.lttng2.kernel.core.tests.analysis.vm;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.fail;
@@ -97,7 +96,6 @@ public class VirtualMachineAnalysisTest {
          * is implemented, we can remove this
          */
         for (ITmfTrace trace : experiment.getTraces()) {
-            trace = checkNotNull(trace);
             for (KernelAnalysisModule module : TmfTraceUtils.getAnalysisModulesOfClass(trace, KernelAnalysisModule.class)) {
                 module.schedule();
                 module.waitForCompletion();
index f0d6ef964d6de35c0da174d00adbaa8d2b24d383..6f6101872543cedbdabc76f52567f8579b664695 100644 (file)
@@ -104,7 +104,7 @@ public class BaseHandler extends AbstractTraceEventHandler {
      * @return the graph provider
      */
     public LttngKernelExecGraphProvider getProvider() {
-        return NonNullUtils.checkNotNull(fProvider);
+        return fProvider;
     }
 
     /**
index 6d553fa934dea016fb684a4a2a5862a4ec997f35..45fcf2b92468dd07f64c6bbd457ed935c301f85c 100644 (file)
@@ -16,7 +16,6 @@ import java.util.Stack;
 
 import org.eclipse.jdt.annotation.Nullable;
 import org.eclipse.tracecompass.analysis.os.linux.core.model.HostThread;
-import org.eclipse.tracecompass.common.core.NonNullUtils;
 
 import com.google.common.collect.HashBasedTable;
 import com.google.common.collect.Table;
@@ -95,7 +94,7 @@ public class LttngSystemModel {
      * @return The list of workers on the system
      */
     public Collection<LttngWorker> getWorkers() {
-        return NonNullUtils.checkNotNull(fWorkerMap.values());
+        return fWorkerMap.values();
     }
 
     /**
index 525631b7c651065d33a4376f5bfcc1b849f52830..dad3991fc1b36802723ec891175ebb1b80444508 100644 (file)
@@ -22,7 +22,6 @@ import org.eclipse.jdt.annotation.Nullable;
 import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelAnalysisModule;
 import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelThreadInformationProvider;
 import org.eclipse.tracecompass.analysis.os.linux.core.model.HostThread;
-import org.eclipse.tracecompass.common.core.NonNullUtils;
 import org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.model.IVirtualMachineModel;
 import org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.model.VirtualCPU;
 import org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.model.VirtualMachine;
@@ -57,14 +56,14 @@ public class QemuKvmVmModel implements IVirtualMachineModel {
 
     private final TmfExperiment fExperiment;
 
-    static final ImmutableSet<String> REQUIRED_EVENTS = NonNullUtils.checkNotNull(ImmutableSet.of(
+    static final ImmutableSet<String> REQUIRED_EVENTS = ImmutableSet.of(
             QemuKvmStrings.KVM_ENTRY,
             QemuKvmStrings.KVM_EXIT,
             QemuKvmStrings.VMSYNC_GH_GUEST,
             QemuKvmStrings.VMSYNC_GH_HOST,
             QemuKvmStrings.VMSYNC_HG_GUEST,
             QemuKvmStrings.VMSYNC_HG_HOST
-            ));
+            );
 
     /**
      * Constructor
index fa41caba3795bba238d8f424b95b2bb0989c72a4..93e31a8b503f7da12e00629067bcf06b8c307716 100644 (file)
@@ -13,8 +13,6 @@
 
 package org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.module;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import java.util.Comparator;
 import java.util.HashSet;
 import java.util.Set;
@@ -23,7 +21,6 @@ import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelAnalysisModule;
 import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelThreadInformationProvider;
-import org.eclipse.tracecompass.common.core.NonNullUtils;
 import org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.VcpuStateValues;
 import org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.VmAttributes;
 import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
@@ -60,9 +57,9 @@ public class VirtualMachineCpuAnalysis extends TmfStateSystemAnalysisModule {
     public static final String ID = "org.eclipse.tracecompass.lttng2.analysis.vm.core.VirtualMachineAnalysisModule"; //$NON-NLS-1$
 
     // TODO: Update with event layout when requirements are back */
-    static final Set<String> REQUIRED_EVENTS = NonNullUtils.checkNotNull(ImmutableSet.of(
+    static final Set<String> REQUIRED_EVENTS = ImmutableSet.of(
             // LttngStrings.SCHED_SWITCH
-            ));
+            );
 
     /* State value for a preempted virtual CPU */
     private static final ITmfStateValue VCPU_PREEMPT_VALUE = TmfStateValue.newValueInt(VcpuStateValues.VCPU_PREEMPT);
@@ -98,7 +95,6 @@ public class VirtualMachineCpuAnalysis extends TmfStateSystemAnalysisModule {
         Set<IAnalysisModule> modules = new HashSet<>();
         /* Depends on the LTTng Kernel analysis modules */
         for (ITmfTrace trace : TmfTraceManager.getTraceSet(getTrace())) {
-            trace = checkNotNull(trace);
             for (KernelAnalysisModule module : TmfTraceUtils.getAnalysisModulesOfClass(trace, KernelAnalysisModule.class)) {
                 modules.add(module);
             }
@@ -171,7 +167,7 @@ public class VirtualMachineCpuAnalysis extends TmfStateSystemAnalysisModule {
             return map;
         }
 
-        String vmHostId = NonNullUtils.checkNotNull(ss.getAttributeName(vmQuark));
+        String vmHostId = ss.getAttributeName(vmQuark);
         KernelAnalysisModule kernelModule = TmfExperimentUtils.getAnalysisModuleOfClassForHost((TmfExperiment) trace, vmHostId, KernelAnalysisModule.class);
         if (kernelModule == null) {
             return map;
@@ -224,7 +220,7 @@ public class VirtualMachineCpuAnalysis extends TmfStateSystemAnalysisModule {
             }
         } catch (AttributeNotFoundException | StateSystemDisposedException e) {
         }
-        return NonNullUtils.checkNotNull(map);
+        return map;
     }
 
 }
index 80dcf265e9b3f1a3d996ffeb0daeeb9d813af1de..72c26b0611bf346e8cd22c72d8e54fae08f58202 100644 (file)
@@ -12,8 +12,6 @@
 
 package org.eclipse.tracecompass.internal.lttng2.kernel.core.trace.layout;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import java.util.Collection;
 
 import org.eclipse.jdt.annotation.NonNull;
@@ -51,7 +49,7 @@ public class LttngEventLayout implements IKernelAnalysisEventLayout {
     private static final String SCHED_WAKEUP = "sched_wakeup";
     private static final String SCHED_WAKEUP_NEW = "sched_wakeup_new";
     private static final Collection<String> SCHED_WAKEUP_EVENTS =
-            checkNotNull(ImmutableList.of(SCHED_WAKEUP, SCHED_WAKEUP_NEW));
+            ImmutableList.of(SCHED_WAKEUP, SCHED_WAKEUP_NEW);
 
     private static final String SCHED_PROCESS_FORK = "sched_process_fork";
     private static final String SCHED_PROCESS_EXIT = "sched_process_exit";
index 1b927c4c828b4e76f750ca3a0076d2383ccec621..4fa93c93e022136a0a688f538c6e32ebf063e3b5 100644 (file)
@@ -12,8 +12,6 @@
 
 package org.eclipse.tracecompass.internal.lttng2.kernel.core.trace.layout;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import java.util.Collection;
 
 import org.eclipse.jdt.annotation.Nullable;
@@ -81,7 +79,7 @@ public class PerfEventLayout implements IKernelAnalysisEventLayout {
     }
 
     private static final Collection<String> WAKEUP_EVENTS =
-            checkNotNull(ImmutableList.of("sched:sched_wakeup", "sched:sched_wakeup_new")); //$NON-NLS-1$ //$NON-NLS-2$
+            ImmutableList.of("sched:sched_wakeup", "sched:sched_wakeup_new"); //$NON-NLS-1$ //$NON-NLS-2$
 
     @Override
     public Collection<String> eventsSchedWakeup() {
index 00e813be8c416803fdf98cdede3a70965dac149e..f415947023f25a3d718124c33f9463aa59c65a1d 100644 (file)
@@ -26,7 +26,6 @@ import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelTidA
 import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.ThreadPriorityAspect;
 import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelAnalysisEventLayout;
 import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelTrace;
-import org.eclipse.tracecompass.common.core.NonNullUtils;
 import org.eclipse.tracecompass.internal.lttng2.kernel.core.Activator;
 import org.eclipse.tracecompass.internal.lttng2.kernel.core.trace.layout.Lttng26EventLayout;
 import org.eclipse.tracecompass.internal.lttng2.kernel.core.trace.layout.Lttng27EventLayout;
@@ -79,7 +78,7 @@ public class LttngKernelTrace extends CtfTmfTrace implements IKernelTrace {
         builder.addAll(CtfTmfTrace.CTF_ASPECTS);
         builder.add(KernelTidAspect.INSTANCE);
         builder.add(ThreadPriorityAspect.INSTANCE);
-        LTTNG_KERNEL_ASPECTS = NonNullUtils.checkNotNull(builder.build());
+        LTTNG_KERNEL_ASPECTS = builder.build();
     }
 
     /**
index 102b76f3ee76d697c77d2464f568ab15a83c07af..c09da07ec5195e402031592a606667fbd7d13bcb 100644 (file)
@@ -15,7 +15,6 @@ import org.eclipse.tracecompass.analysis.graph.core.criticalpath.CriticalPathMod
 import org.eclipse.tracecompass.analysis.os.linux.core.model.HostThread;
 import org.eclipse.tracecompass.analysis.os.linux.ui.views.controlflow.ControlFlowEntry;
 import org.eclipse.tracecompass.analysis.os.linux.ui.views.controlflow.ControlFlowView;
-import org.eclipse.tracecompass.common.core.NonNullUtils;
 import org.eclipse.tracecompass.internal.analysis.graph.ui.criticalpath.view.CriticalPathView;
 import org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.graph.model.LttngWorker;
 import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule;
@@ -138,7 +137,7 @@ public class CriticalPathParameterProvider extends TmfAbstractAnalysisParamProvi
             /* Try to find the worker for the critical path */
             IAnalysisModule mod = getModule();
             if ((mod != null) && (mod instanceof CriticalPathModule)) {
-                Integer threadId = NonNullUtils.checkNotNull(fCurrentEntry.getThreadId());
+                Integer threadId = fCurrentEntry.getThreadId();
                 HostThread ht = new HostThread(fCurrentEntry.getTrace().getHostId(), threadId);
                 LttngWorker worker = new LttngWorker(ht, "", 0); //$NON-NLS-1$
                 return worker;
index abc44a3479d95defab6e6a58c0ef7b1e8eb84564..1bb049c4e3bca6bad828d8343a6c95921a6282f6 100644 (file)
@@ -191,7 +191,7 @@ public class VirtualMachineView extends AbstractTimeGraphView {
             for (Integer vmQuark : vmQuarks) {
 
                 /* Display an entry for the virtual machine */
-                String vmHostId = NonNullUtils.checkNotNull(ssq.getAttributeName(vmQuark));
+                String vmHostId = ssq.getAttributeName(vmQuark);
                 ITmfStateInterval vmNameInterval = StateSystemUtils.queryUntilNonNullValue(ssq, vmQuark, startTime, endTime);
                 String vmName = vmHostId;
                 if (vmNameInterval != null) {
@@ -283,7 +283,7 @@ public class VirtualMachineView extends AbstractTimeGraphView {
              * FIXME: Only add threads that are active during the trace
              */
             String threadName = KernelThreadInformationProvider.getExecutableName(kernelModule, threadId);
-            String tidString = NonNullUtils.checkNotNull(threadId.toString());
+            String tidString = threadId.toString();
             threadName = (threadName != null) ? tidString + ':' + ' ' + threadName : tidString;
             oneThreadEntry = new VirtualMachineViewEntry.VmEntryBuilder(threadName, startTime, endTime, vmExperiment).setId(threadName).setVmName(vmName).setNumericId(threadId).setType(Type.THREAD).build();
 
@@ -480,9 +480,9 @@ public class VirtualMachineView extends AbstractTimeGraphView {
     @Override
     protected Iterable<ITmfTrace> getTracesToBuild(@Nullable ITmfTrace trace) {
         if (trace == null) {
-            return NonNullUtils.checkNotNull(Collections.EMPTY_SET);
+            return Collections.EMPTY_SET;
         }
-        return NonNullUtils.checkNotNull(Collections.singleton(trace));
+        return Collections.singleton(trace);
     }
 
 }
index 5acb66c8a93f076bff415a6904d8b8d98ab4886c..838fa727384df6cd2f2c66f373215b87b0c48f30 100644 (file)
@@ -9,8 +9,6 @@
 
 package org.eclipse.tracecompass.internal.lttng2.ust.core.analysis.debuginfo;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.IOException;
@@ -62,8 +60,8 @@ public final class FileOffsetMapper {
         List<TmfCallsite> callsites = new LinkedList<>();
 
         // FIXME Could eventually use CDT's Addr2line class once it imlements --inlines
-        List<String> output = getOutputFromCommand(checkNotNull(Arrays.asList(
-                ADDR2LINE_EXECUTABLE, "-i", "-e", file.toString(), "0x" + Long.toHexString(offset))));  //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
+        List<String> output = getOutputFromCommand(Arrays.asList(
+                ADDR2LINE_EXECUTABLE, "-i", "-e", file.toString(), "0x" + Long.toHexString(offset)));  //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
 
         if (output == null) {
             /* Command returned an error */
index 9ef8441220cf2ed19f44d3b75a538d8b30719436..3d1b831faa82f2ce69315e4afcb738c2c1579cdd 100644 (file)
@@ -119,7 +119,7 @@ public class UstDebugInfoStateProvider extends AbstractTmfStateProvider {
         builder.put(layout.eventStatedumpSoInfo(), STATEDUMP_SOINFO_INDEX);
         builder.put(layout.eventStateDumpBuildId(), STATEDUMP_BUILD_ID_INDEX);
         builder.put(layout.eventStateDumpDebugLink(), STATEDUMP_DEBUG_LINK_INDEX);
-        return checkNotNull(builder.build());
+        return builder.build();
     }
 
     @Override
index 4834f9c0780e44df2d079eb1628b907f63d31546..68d5426e2463afa85c6bd1ac05cdf252a9e3b5d9 100644 (file)
@@ -83,7 +83,7 @@ public class UstMemoryStateProvider extends AbstractTmfStateProvider {
         builder.put(layout.eventLibcRealloc(), REALLOC_INDEX);
         builder.put(layout.eventLibcMemalign(), MEMALIGN_INDEX);
         builder.put(layout.eventLibcPosixMemalign(), POSIX_MEMALIGN_INDEX);
-        return checkNotNull(builder.build());
+        return builder.build();
     }
 
     @Override
index 6f7bfb41c8fcfbf4cbda7f85bcdfed5fb18065f9..cd89b401143b6d8926850d78dc98984837b5dd75 100644 (file)
@@ -13,8 +13,6 @@
 
 package org.eclipse.tracecompass.internal.lttng2.ust.core.callstack;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import java.util.Set;
 
 import org.eclipse.jdt.annotation.NonNull;
@@ -78,13 +76,13 @@ public class LttngUstCallStackProvider extends CallStackStateProvider {
             fLayout = LttngUst20EventLayout.getInstance();
         }
 
-        funcEntryEvents = checkNotNull(ImmutableSet.of(
+        funcEntryEvents = ImmutableSet.of(
                 fLayout.eventCygProfileFuncEntry(),
-                fLayout.eventCygProfileFastFuncEntry()));
+                fLayout.eventCygProfileFastFuncEntry());
 
-        funcExitEvents = checkNotNull(ImmutableSet.of(
+        funcExitEvents = ImmutableSet.of(
                 fLayout.eventCygProfileFuncExit(),
-                fLayout.eventCygProfileFastFuncExit()));
+                fLayout.eventCygProfileFastFuncExit());
     }
 
     // ------------------------------------------------------------------------
index c6308d13d1313f93e919d0d7eab9d634a875ed41..7108e1de4e9c6aeb3f770f936927ac9475d507c8 100644 (file)
@@ -184,7 +184,7 @@ public class UstDebugInfoAnalysisModule extends TmfStateSystemAnalysisModule {
         /* Get the most probable base address from all the known ones */
         NavigableSet<Long> possibleBaddrs = possibleBaddrQuarks.stream()
             .map(quark -> {
-                String baddrStr = ss.getAttributeName(checkNotNull(quark).intValue());
+                String baddrStr = ss.getAttributeName(quark.intValue());
                 return checkNotNull(Long.valueOf(baddrStr));
             })
             .collect(Collectors.toCollection(TreeSet::new));
@@ -216,7 +216,7 @@ public class UstDebugInfoAnalysisModule extends TmfStateSystemAnalysisModule {
             List<Integer> buildIds = ss.getSubAttributes(baddrQuark, false);
             Optional<Integer> potentialBuildIdQuark = buildIds.stream()
                 .filter(id -> {
-                    int quark = checkNotNull(id).intValue();
+                    int quark = id.intValue();
                     ITmfStateValue value = fullState.get(quark).getStateValue();
                     return (!value.isNull());
                 })
index 82f87e56b5bee4e92915cb51f91a36ad907b68fe..c5df05d2ff9952baf93b976bf20e43bb974a3a6c 100644 (file)
@@ -108,7 +108,7 @@ public class UstMemoryAnalysisModule extends TmfStateSystemAnalysisModule {
         TmfAnalysisRequirement domainReq = new TmfAnalysisRequirement(SessionConfigStrings.CONFIG_ELEMENT_DOMAIN);
         domainReq.addValue(SessionConfigStrings.CONFIG_DOMAIN_TYPE_UST, ValuePriorityLevel.MANDATORY);
 
-        return checkNotNull(ImmutableSet.of(domainReq, eventsReq));
+        return ImmutableSet.of(domainReq, eventsReq);
     }
 
     @Override
index 8f159f498f7c720a349039ac1018e8e8928f1348..6e9345cd4c69bc0f1d292ad187ecdd35769c13ba 100644 (file)
@@ -23,7 +23,6 @@ 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.common.core.NonNullUtils;
 import org.eclipse.tracecompass.internal.lttng2.ust.core.Activator;
 import org.eclipse.tracecompass.internal.lttng2.ust.core.trace.layout.LttngUst20EventLayout;
 import org.eclipse.tracecompass.internal.lttng2.ust.core.trace.layout.LttngUst27EventLayout;
@@ -65,7 +64,7 @@ public class LttngUstTrace extends CtfTmfTrace {
         builder.addAll(CtfTmfTrace.CTF_ASPECTS);
         builder.add(UstDebugInfoBinaryAspect.INSTANCE);
         builder.add(UstDebugInfoSourceAspect.INSTANCE);
-        LTTNG_UST_ASPECTS = NonNullUtils.checkNotNull(builder.build());
+        LTTNG_UST_ASPECTS = builder.build();
     }
 
     private @Nullable ILttngUstEventLayout fLayout = null;
index 2f64df9fc59990928b85e15c4c2b62a136293cda..1a11da071a1e49355a08e23a27c249b637b533fe 100644 (file)
@@ -211,7 +211,7 @@ public class EthernetIIPacket extends Packet {
             builder.put("Destination MAC Address", ConversionHelper.toMacAddress(fDestinationMacAddress)); //$NON-NLS-1$
             builder.put("Ethertype", String.valueOf(EthertypeHelper.toEtherType(fType))); //$NON-NLS-1$
 
-            fFields = checkNotNull(builder.build());
+            fFields = builder.build();
             return fFields;
         }
         return map;
index 5574fddab37a79ad8c2e4bfbcafc62b5025c402d..e83d34049d98d42a47a32800a9bb632a2dc1f715 100644 (file)
@@ -459,7 +459,7 @@ public class IPv4Packet extends Packet {
                 builder.put("Options", ConversionHelper.bytesToHex(options, true)); //$NON-NLS-1$
 
             }
-            fFields = checkNotNull(builder.build());
+            fFields = builder.build();
             return fFields;
         }
         return map;
index cd0ad45cfe0a63980f04aeefff93097fd875dd4d..56d5ee3361df64ee5d4eced24d29f61b913fc9e5 100644 (file)
@@ -267,7 +267,7 @@ public class PcapPacket extends Packet {
             builder.put("Capture Length", String.valueOf(fIncludedLength) + " bytes"); //$NON-NLS-1$ //$NON-NLS-2$
             builder.put("Capture Time", ConversionHelper.toGMTTime(fTimestamp, getTimestampScale())); //$NON-NLS-1$
 
-            fFields = NonNullUtils.checkNotNull(builder.build());
+            fFields = builder.build();
             return fFields;
         }
         return map;
index a5d400413acdc48159b2fd9625c2a987675907cd..78d861b055f6c02aac7990a03329447809e04f49 100644 (file)
@@ -12,8 +12,6 @@
 
 package org.eclipse.tracecompass.internal.pcap.core.protocol.tcp;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import org.eclipse.jdt.annotation.Nullable;
 import org.eclipse.tracecompass.internal.pcap.core.endpoint.ProtocolEndpoint;
 
@@ -87,7 +85,7 @@ public class TCPEndpoint extends ProtocolEndpoint {
     public String toString() {
         ProtocolEndpoint endpoint = getParentEndpoint();
         if (endpoint == null) {
-            return checkNotNull(String.valueOf(fPort));
+            return String.valueOf(fPort);
         }
         return endpoint.toString() + '/' + fPort;
     }
index 574b0112796c70eebbc9c8232d5d43dc24934cd5..5259ec13f172e2a99268bad90a8c5b53efd6ee71 100644 (file)
@@ -12,8 +12,6 @@
 
 package org.eclipse.tracecompass.internal.pcap.core.protocol.tcp;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 import java.util.Arrays;
@@ -451,7 +449,7 @@ public class TCPPacket extends Packet {
                 builder.put("Options", ConversionHelper.bytesToHex(options, true)); //$NON-NLS-1$
 
             }
-            fFields = checkNotNull(builder.build());
+            fFields = builder.build();
             return fFields;
         }
         return map;
index 7367e8a1284565e6aa28b7db015070d5599a1a39..d13174c45914ee7bf9ca7f5874adc8b1053a76d3 100644 (file)
@@ -12,8 +12,6 @@
 
 package org.eclipse.tracecompass.internal.pcap.core.protocol.udp;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import org.eclipse.jdt.annotation.Nullable;
 import org.eclipse.tracecompass.internal.pcap.core.endpoint.ProtocolEndpoint;
 
@@ -87,7 +85,7 @@ public class UDPEndpoint extends ProtocolEndpoint {
     public String toString() {
         ProtocolEndpoint endpoint = getParentEndpoint();
         if (endpoint == null) {
-            return checkNotNull(String.valueOf(fPort));
+            return String.valueOf(fPort);
         }
         return endpoint.toString() + '/' + fPort;
     }
index 169c2f51d3a7f93adb765f8bf18f678312481cbd..8503ba2ee2ba572bea50b27422b1addbd4f52876 100644 (file)
@@ -212,7 +212,7 @@ public class UDPPacket extends Packet {
                     .put("Length", String.valueOf(fTotalLength) + " bytes") //$NON-NLS-1$ //$NON-NLS-2$
                     .put("Checksum", String.format("%s%04x", "0x", fChecksum)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 
-            fFields = NonNullUtils.checkNotNull(builder.build());
+            fFields = builder.build();
             return fFields;
         }
         return map;
index c214995b416236441a1699cd74afac3c2eb3d06a..ac181a95b48d788f604627352f682a36a84f4dc5 100644 (file)
@@ -143,7 +143,7 @@ public class UnknownPacket extends Packet {
             } catch (UnsupportedEncodingException e) {
                 // Do nothing. The string won't be added to the map anyway.
             }
-            fFields = checkNotNull(builder.build());
+            fFields = builder.build();
             return fFields;
         }
         return map;
index ddb835a3193b6c357475fb9aa59a6d0c07cfe8df..aa738bd58e3e3ab8346d21c5a08deb3ee74e0900 100644 (file)
@@ -12,8 +12,6 @@
 
 package org.eclipse.tracecompass.internal.pcap.core.stream;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import org.eclipse.tracecompass.internal.pcap.core.endpoint.ProtocolEndpointPair;
 import org.eclipse.tracecompass.internal.pcap.core.packet.Packet;
 import org.eclipse.tracecompass.internal.pcap.core.protocol.PcapProtocol;
@@ -156,7 +154,7 @@ public class PacketStream {
         StringBuilder sb = new StringBuilder();
         sb.append("Stream " + getUniqueID() + ", Number of Packets: " + getNbPackets() + "\n"); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
 
-        return checkNotNull(sb.toString());
+        return sb.toString();
 
     }
 
index 08bc61fcc0b56aa5ac252de77a73a84fbfab91e3..e2932fa89e65024e07af059fdcf5f938475d32c4 100644 (file)
@@ -98,19 +98,19 @@ public class PcapFile implements Closeable {
 
         switch (magicNumber) {
         case PcapFileValues.MAGIC_BIG_ENDIAN_MICRO: // file is big endian
-            fByteOrder = checkNotNull(ByteOrder.BIG_ENDIAN);
+            fByteOrder = ByteOrder.BIG_ENDIAN;
             fTimestampPrecision = PcapTimestampScale.MICROSECOND;
             break;
         case PcapFileValues.MAGIC_LITTLE_ENDIAN_MICRO: // file is little endian
-            fByteOrder = checkNotNull(ByteOrder.LITTLE_ENDIAN);
+            fByteOrder = ByteOrder.LITTLE_ENDIAN;
             fTimestampPrecision = PcapTimestampScale.MICROSECOND;
             break;
         case PcapFileValues.MAGIC_BIG_ENDIAN_NANO: // file is big endian
-            fByteOrder = checkNotNull(ByteOrder.BIG_ENDIAN);
+            fByteOrder = ByteOrder.BIG_ENDIAN;
             fTimestampPrecision = PcapTimestampScale.NANOSECOND;
             break;
         case PcapFileValues.MAGIC_LITTLE_ENDIAN_NANO: // file is little endian
-            fByteOrder = checkNotNull(ByteOrder.LITTLE_ENDIAN);
+            fByteOrder = ByteOrder.LITTLE_ENDIAN;
             fTimestampPrecision = PcapTimestampScale.NANOSECOND;
             break;
         default:
index 33d84f43ba3246afe6f3dd329b35bf843b7a09d8..6ec95cde7916f25147206f40058cfa2befd4b090 100644 (file)
@@ -12,8 +12,6 @@
 
 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;
@@ -222,7 +220,7 @@ public class PcapEvent extends TmfEvent {
             }
         }
 
-        fProtocols = checkNotNull(builder.build());
+        fProtocols = builder.build();
         return fProtocols;
     }
 
index c3ffe5d9542acb3df3fa8fa4dbbc80871b7ea24a..624334cf82acd7042b8c826d06139cd51cad79a7 100644 (file)
@@ -70,14 +70,14 @@ public class PcapTrace extends TmfTrace implements ITmfPropertiesProvider {
     public static final String TRACE_TYPE_ID = "org.eclipse.linuxtools.tmf.pcap.core.pcaptrace"; //$NON-NLS-1$
 
     private static final Collection<ITmfEventAspect> PCAP_ASPECTS =
-            checkNotNull(ImmutableList.of(
+            ImmutableList.of(
                     ITmfEventAspect.BaseAspects.TIMESTAMP,
                     PcapSourceAspect.INSTANCE,
                     PcapDestinationAspect.INSTANCE,
                     PcapReferenceAspect.INSTANCE,
                     PcapProtocolAspect.INSTANCE,
                     ITmfEventAspect.BaseAspects.CONTENTS
-                    ));
+                    );
 
     private static final String EMPTY_STRING = ""; //$NON-NLS-1$
     private static final int CONFIDENCE = 50;
index 91f47dd6e48269c8ee67567c4bae1d427a94f422..5bbac26769424293fdc804127bfcffc13d445e66 100644 (file)
@@ -111,7 +111,7 @@ public class PcapEventFactory {
         while (localPacket != null) {
             subfieldList.clear();
             for (Map.Entry<String, String> entry : localPacket.getFields().entrySet()) {
-                String key = checkNotNull(entry.getKey());
+                String key = entry.getKey();
                 String value = entry.getValue();
                 subfieldList.add(new TmfEventField(key, value, null));
             }
index c32c8e9dcfc716095d3d1c211ec200342793b955..452862ff8b29214bfcc5f0a42ddd357d1dc8d0fb 100644 (file)
@@ -101,7 +101,7 @@ public class TreeMapStore<@NonNull E extends ISegment> implements ISegmentStore<
         try {
             Iterable<E> lastSnapshot = fLastSnapshot;
             if (lastSnapshot == null) {
-                lastSnapshot = checkNotNull(ImmutableList.copyOf(fStartTimesIndex.values()));
+                lastSnapshot = ImmutableList.copyOf(fStartTimesIndex.values());
                 fLastSnapshot = lastSnapshot;
             }
             return checkNotNull(lastSnapshot.iterator());
index d83fceb714c4e5094782e7dd279172824c5a9e47..63ba47c5450f08506cefbd38f90537b7de736792 100644 (file)
@@ -56,7 +56,7 @@ public class HistoryTreeStub extends HistoryTree {
      */
     public HTNode getLatestLeaf() {
         List<HTNode> latest = getLatestBranch();
-        return checkNotNull(Iterables.getLast(latest));
+        return Iterables.getLast(latest);
     }
 
     /**
@@ -69,7 +69,7 @@ public class HistoryTreeStub extends HistoryTree {
      */
     public HTNode getNodeAt(int pos) {
         List<HTNode> latest = getLatestBranch();
-        return checkNotNull(latest.get(pos));
+        return latest.get(pos);
     }
 
     /**
index 4c20d8cd8774ecfb21efd41068db2722050b1c35..e2e793981d5f2158903ae41ebfb06a02fba19ec3 100644 (file)
@@ -12,8 +12,6 @@
 
 package org.eclipse.tracecompass.tmf.analysis.xml.core.model;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import java.util.List;
 
 import org.eclipse.jdt.annotation.NonNull;
@@ -148,7 +146,7 @@ public abstract class TmfXmlStateValue implements ITmfXmlStateValue {
         /*
          * Stack Actions : allow to define a stack with PUSH/POP/PEEK methods
          */
-        String stack = checkNotNull(node.getAttribute(TmfXmlStrings.ATTRIBUTE_STACK));
+        String stack = node.getAttribute(TmfXmlStrings.ATTRIBUTE_STACK);
         fStackType = ValueTypeStack.getTypeFromString(stack);
     }
 
index 79d42453cae0c9ed6ef525541405e94f5a17008f..8f88f33837cb52b4ecfe8d48647afd392dda9ab6 100644 (file)
@@ -9,8 +9,6 @@
 
 package org.eclipse.tracecompass.tmf.analysis.xml.core.module;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import java.io.File;
 import java.util.Collections;
 import java.util.HashMap;
@@ -77,7 +75,7 @@ public class TmfAnalysisModuleHelperXml implements IAnalysisModuleHelper, ITmfPr
          * The attribute ID cannot be null because the XML has been validated
          * and it is mandatory
          */
-        return checkNotNull(fSourceElement.getAttribute(TmfXmlStrings.ID));
+        return fSourceElement.getAttribute(TmfXmlStrings.ID);
     }
 
     @Override
index b6db24e24bc903021d32a98ca301352cb7025490..d75767d82997bf8f3f5862739faf765bf53b48e7 100644 (file)
@@ -188,7 +188,7 @@ public class XmlXYViewer extends TmfCommonXLineChartViewer {
         public List<Integer> getQuarks() {
             /* Get the list of quarks to process with this path */
             String[] paths = fPath.split(SPLIT_STRING);
-            List<Integer> quarks = checkNotNull(Collections.singletonList(IXmlStateSystemContainer.ROOT_QUARK));
+            List<Integer> quarks = Collections.singletonList(IXmlStateSystemContainer.ROOT_QUARK);
 
             try {
                 for (String path : paths) {
@@ -341,7 +341,6 @@ public class XmlXYViewer extends TmfCommonXLineChartViewer {
             }
         } else {
             for (String moduleId : analysisIds) {
-                moduleId = checkNotNull(moduleId);
                 ITmfAnalysisModuleWithStateSystems module = TmfTraceUtils.getAnalysisModuleOfClass(trace, ITmfAnalysisModuleWithStateSystems.class, moduleId);
                 if (module != null) {
                     stateSystemModules.add(module);
index a466ef22323d8e92d5c5cc24dfc14ecdbac18579..31a2287598bf558a5a13d700fd1369622b9d329c 100644 (file)
@@ -13,8 +13,6 @@
 
 package org.eclipse.tracecompass.tmf.tests.stubs.analysis;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import java.util.Collections;
 
 import org.eclipse.core.runtime.Platform;
@@ -66,7 +64,7 @@ public class AnalysisModuleTestHelper implements IAnalysisModuleHelper {
 
     @Override
     public String getName() {
-        return checkNotNull(fModule.name());
+        return fModule.name();
     }
 
     @Override
index 967eab7ba524c36da554560d4e95f4d5f3365027..68547d4bb0c360e339fc6533fffa3b2f3da3f71b 100644 (file)
@@ -13,8 +13,6 @@
 
 package org.eclipse.tracecompass.tmf.tests.stubs.trace.text;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Calendar;
@@ -67,14 +65,14 @@ public class SyslogTrace extends TextTrace<SyslogEvent> {
 
     /** The event aspects */
     public static final @NonNull Collection<ITmfEventAspect> ASPECTS =
-            checkNotNull(ImmutableList.of(
+            ImmutableList.of(
                     ITmfEventAspect.BaseAspects.TIMESTAMP,
                     new TmfContentFieldAspect(Field.HOST, Field.HOST),
                     new TmfContentFieldAspect(Field.LOGGER, Field.LOGGER),
                     new TmfContentFieldAspect(Field.FILE, Field.FILE),
                     new TmfContentFieldAspect(Field.LINE, Field.LINE),
                     new TmfContentFieldAspect(Field.MESSAGE, Field.MESSAGE)
-                    ));
+                    );
 
     /**
      * Constructor
index 5bde392e8ccd25c3168c68bd49e1c21c5bc62f06..13145d8fa9edc7bd70f09df1132411ff61bcb8fa 100644 (file)
@@ -12,8 +12,6 @@
 
 package org.eclipse.tracecompass.internal.tmf.core.analysis;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import java.util.ArrayList;
 import java.util.LinkedList;
 import java.util.List;
@@ -92,7 +90,7 @@ public final class TmfAnalysisModuleSourceConfigElement implements IAnalysisModu
                 typeElements.add(element);
             }
         }
-        return checkNotNull(typeElements.toArray(new @NonNull IConfigurationElement[typeElements.size()]));
+        return typeElements.toArray(new @NonNull IConfigurationElement[typeElements.size()]);
     }
 
     /**
index 01fde9da632eff0eadee2890db5c7c0a99e6ee81..a0b97dffae23a5e09a8a2deb310aff5d621807f2 100644 (file)
@@ -13,8 +13,6 @@
 
 package org.eclipse.tracecompass.internal.tmf.core.parsers.custom;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import java.util.List;
 
 import org.eclipse.jdt.annotation.NonNull;
@@ -96,6 +94,6 @@ public class CustomEventAspects {
             String name = outputs.get(i).name;
             builder.add(new CustomEventFieldAspect(name, i));
         }
-        return checkNotNull(builder.build());
+        return builder.build();
     }
 }
index 9d25fbaeae8f78bd0ce1c3e955bfbbd69fa043d1..6d0cc8346d03b12e81511d97ac3bf03d9d28dff5 100644 (file)
@@ -100,7 +100,7 @@ public abstract class TmfAbstractAnalysisModule extends TmfComponent implements
                  * Some types, like anonymous classes, don't have a canonical
                  * name. Just use the default name instead.
                  */
-                id = checkNotNull(this.getClass().getName());
+                id = this.getClass().getName();
             }
             fId = id;
         }
@@ -374,7 +374,7 @@ public abstract class TmfAbstractAnalysisModule extends TmfComponent implements
             execute(trace);
         }
 
-        return checkNotNull(Status.OK_STATUS);
+        return Status.OK_STATUS;
     }
 
     @Override
@@ -500,7 +500,7 @@ public abstract class TmfAbstractAnalysisModule extends TmfComponent implements
                 }
             }
         }
-        return checkNotNull(builder.toString());
+        return builder.toString();
     }
 
     @Override
index 5fbd9fd0d7c74a93bd8ca77893887706a42c6eb6..6a8aa256db83693df001cfdd0b972a8ff3f97a3f 100644 (file)
@@ -149,7 +149,7 @@ public class TmfAnalysisManager {
                 map.put(module.getId(), module);
             }
         }
-        return checkNotNull(ImmutableMap.copyOf(map));
+        return ImmutableMap.copyOf(map);
     }
 
     /**
@@ -224,7 +224,7 @@ public class TmfAnalysisManager {
                 }
             }
         }
-        return NonNullUtils.checkNotNull(Collections.unmodifiableSet(providerSet));
+        return Collections.unmodifiableSet(providerSet);
     }
 
     /**
index 030cc9f832b46355ff2df51dd19bf364105264d7..1ad95b3a6bf40721c3735ec35c158fd5571d391c 100644 (file)
@@ -72,11 +72,11 @@ public class TmfEventField implements ITmfEventField {
         fValue = value;
 
         if (fields == null) {
-            fFields = checkNotNull(ImmutableMap.<String, ITmfEventField> of());
+            fFields = ImmutableMap.of();
         } else {
             ImmutableMap.Builder<String, ITmfEventField> mapBuilder = new ImmutableMap.Builder<>();
             Arrays.stream(fields).forEach(t -> mapBuilder.put(t.getName(), t));
-            fFields = checkNotNull(mapBuilder.build());
+            fFields = mapBuilder.build();
         }
     }
 
@@ -110,12 +110,12 @@ public class TmfEventField implements ITmfEventField {
 
     @Override
     public final Collection<String> getFieldNames() {
-        return checkNotNull(fFields.keySet());
+        return fFields.keySet();
     }
 
     @Override
     public final Collection<ITmfEventField> getFields() {
-        return checkNotNull(fFields.values());
+        return fFields.values();
     }
 
     @Override
index 3a4da293905e7ba3b70950e148da7d8c38ef5c2e..7fa0fe1942573d0b24ffa086c7b16cb385579a95 100644 (file)
@@ -13,8 +13,6 @@
 
 package org.eclipse.tracecompass.tmf.core.event.aspect;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import java.util.List;
 
 import org.eclipse.jdt.annotation.Nullable;
@@ -48,12 +46,12 @@ public interface ITmfEventAspect {
      * List of all common base aspects
      */
     public static final List<ITmfEventAspect> BASE_ASPECTS =
-            checkNotNull(ImmutableList.of(
+            ImmutableList.of(
                     BaseAspects.TIMESTAMP,
                     BaseAspects.EVENT_TYPE,
                     BaseAspects.CONTENTS,
                     BaseAspects.TRACE_NAME
-                    ));
+                    );
     /**
      * Some basic aspects that all trace types should be able to use, using
      * methods found in {@link ITmfEvent}.
index 13a159feb267307f3d11d2dfde714681c7b8b07a..087c5bd20c7f4b35273d75aa2d1ecfd90d505440 100644 (file)
@@ -811,7 +811,7 @@ public class CustomTxtTraceDefinition extends CustomTraceDefinition {
             } else if (nodeName.equals(OUTPUT_COLUMN_ELEMENT)) {
                 Element outputColumnElement = (Element) node;
                 OutputColumn outputColumn = new OutputColumn();
-                outputColumn.name = checkNotNull(outputColumnElement.getAttribute(NAME_ATTRIBUTE));
+                outputColumn.name = outputColumnElement.getAttribute(NAME_ATTRIBUTE);
                 def.outputs.add(outputColumn);
             }
         }
index 47cc6faa55c98876e851fba136140da00bd394c0..19263f4ffd2db30e80db0cca2db2eb0f2d60465e 100644 (file)
@@ -13,8 +13,6 @@
 
 package org.eclipse.tracecompass.tmf.core.parsers.custom;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import java.io.ByteArrayInputStream;
 import java.io.File;
 import java.io.FileInputStream;
@@ -522,7 +520,7 @@ public class CustomXmlTraceDefinition extends CustomTraceDefinition {
             } else if (nodeName.equals(OUTPUT_COLUMN_ELEMENT)) {
                 Element outputColumnElement = (Element) node;
                 OutputColumn outputColumn = new OutputColumn();
-                outputColumn.name = checkNotNull(outputColumnElement.getAttribute(NAME_ATTRIBUTE));
+                outputColumn.name = outputColumnElement.getAttribute(NAME_ATTRIBUTE);
                 def.outputs.add(outputColumn);
             }
         }
index 5e1ccb2f3a4787778efdb8149ea8286e6b05c014..6210db832882295016638cec4b1db9d0267d9d1a 100644 (file)
@@ -13,8 +13,6 @@
 
 package org.eclipse.tracecompass.tmf.core.signal;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import org.eclipse.jdt.annotation.NonNullByDefault;
 import org.eclipse.jdt.annotation.Nullable;
 import org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp;
@@ -93,7 +91,7 @@ public class TmfSelectionRangeUpdatedSignal extends TmfSignal {
             sb.append(fEndTime.toString());
         }
         sb.append("]"); //$NON-NLS-1$
-        return checkNotNull(sb.toString());
+        return sb.toString();
     }
 
 }
index 1a82184c619dd1e22f8afafa632ceab4ef052e07..46dd6ceff4cd0cfc87973945e06aae871d3bb30c 100644 (file)
@@ -12,8 +12,6 @@
 
 package org.eclipse.tracecompass.tmf.core.statesystem;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
 import org.eclipse.tracecompass.common.core.collect.BufferedBlockingQueue;
@@ -190,17 +188,17 @@ public abstract class AbstractTmfStateProvider implements ITmfStateProvider {
              * We never insert null in the queue. Cannot be checked at
              * compile-time until Java 8 annotations...
              */
-            @NonNull ITmfEvent event = checkNotNull(fEventsQueue.take());
+            @NonNull ITmfEvent event = fEventsQueue.take();
             /* This is a singleton, we want to do != instead of !x.equals */
             while (event != END_EVENT) {
                 if (event == EMPTY_QUEUE_EVENT) {
                     /* Synchronization event, should be ignored */
-                    event = checkNotNull(fEventsQueue.take());
+                    event = fEventsQueue.take();
                     continue;
                 }
                 currentEvent = event;
                 eventHandle(event);
-                event = checkNotNull(fEventsQueue.take());
+                event = fEventsQueue.take();
             }
             /* We've received the last event, clean up */
             closeStateSystem();
index fc7a41d540a255811378e819ff81c94d4e1f989d..94ebe765517e68ead773820243e2806e78d024c6 100644 (file)
@@ -13,8 +13,6 @@
 
 package org.eclipse.tracecompass.tmf.core.statesystem;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import java.io.File;
 import java.io.IOException;
 import java.util.Collections;
@@ -485,9 +483,7 @@ public abstract class TmfStateSystemAnalysisModule extends TmfAbstractAnalysisMo
                     ITmfEventRequest.ALL_DATA,
                     ITmfEventRequest.ExecutionType.BACKGROUND);
             this.sci = sp;
-
-            // sci.getTrace() will eventually return a @NonNull
-            trace = checkNotNull(sci.getTrace());
+            trace = sci.getTrace();
 
         }
 
@@ -610,7 +606,7 @@ public abstract class TmfStateSystemAnalysisModule extends TmfAbstractAnalysisMo
         Map<@NonNull String, @NonNull String> properties = new HashMap<>();
 
         StateSystemBackendType backend = getBackendType();
-        properties.put(NonNullUtils.checkNotNull(Messages.TmfStateSystemAnalysisModule_PropertiesBackend), NonNullUtils.checkNotNull(backend.name()));
+        properties.put(NonNullUtils.checkNotNull(Messages.TmfStateSystemAnalysisModule_PropertiesBackend), backend.name());
         switch (backend) {
         case FULL:
         case PARTIAL:
index e4440b9ac28fe7a11638ec2b12297901176488a4..e941c2a1563f913fe0e1590235e3bac5496fc3de 100644 (file)
@@ -16,8 +16,6 @@
 
 package org.eclipse.tracecompass.tmf.core.trace;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import java.io.File;
 import java.util.Collection;
 import java.util.Collections;
@@ -100,11 +98,11 @@ public abstract class TmfTrace extends TmfEventProvider implements ITmfTrace, IT
      * Basic aspects that should be valid for all trace types.
      */
     public static final @NonNull Collection<@NonNull ITmfEventAspect> BASE_ASPECTS =
-            checkNotNull(ImmutableList.of(
+            ImmutableList.of(
                     ITmfEventAspect.BaseAspects.TIMESTAMP,
                     ITmfEventAspect.BaseAspects.EVENT_TYPE,
                     ITmfEventAspect.BaseAspects.CONTENTS
-                    ));
+                    );
 
     // ------------------------------------------------------------------------
     // Instance attributes
index e82144403bb848ef68d7991658e59d854d7ee3e7..25eaffe28257dbcf4c42b9b6d46b895c9bec62bb 100644 (file)
@@ -34,7 +34,6 @@ import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.URIUtil;
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.tracecompass.common.core.NonNullUtils;
 import org.eclipse.tracecompass.internal.tmf.core.Activator;
 import org.eclipse.tracecompass.tmf.core.TmfCommonConstants;
 import org.eclipse.tracecompass.tmf.core.signal.TmfEventFilterAppliedSignal;
@@ -179,13 +178,13 @@ public final class TmfTraceManager {
      */
     public static @NonNull Collection<@NonNull ITmfTrace> getTraceSet(ITmfTrace trace) {
         if (trace == null) {
-            return NonNullUtils.checkNotNull(ImmutableSet.of());
+            return ImmutableSet.of();
         }
         List<@NonNull ITmfTrace> traces = trace.getChildren(ITmfTrace.class);
         if (traces.size() > 0) {
-            return NonNullUtils.checkNotNull(ImmutableSet.copyOf(traces));
+            return ImmutableSet.copyOf(traces);
         }
-        return NonNullUtils.checkNotNull(ImmutableSet.of(trace));
+        return ImmutableSet.of(trace);
     }
 
     /**
@@ -200,16 +199,16 @@ public final class TmfTraceManager {
      */
     public static @NonNull Collection<ITmfTrace> getTraceSetWithExperiment(ITmfTrace trace) {
         if (trace == null) {
-            return checkNotNull(ImmutableSet.<ITmfTrace> of());
+            return ImmutableSet.of();
         }
         if (trace instanceof TmfExperiment) {
             TmfExperiment exp = (TmfExperiment) trace;
             List<ITmfTrace> traces = exp.getTraces();
             Set<ITmfTrace> alltraces = new LinkedHashSet<>(traces);
             alltraces.add(exp);
-            return NonNullUtils.checkNotNull(ImmutableSet.copyOf(alltraces));
+            return ImmutableSet.copyOf(alltraces);
         }
-        return checkNotNull(Collections.singleton(trace));
+        return Collections.singleton(trace);
     }
 
     /**
index cbf2a81a3c4bfc259a7139bfb5c9e4d13a9e674c..74b8d0ee80b129352f24a10d71a7763c83a97246 100644 (file)
@@ -12,8 +12,6 @@
 
 package org.eclipse.tracecompass.tmf.core.trace.experiment;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import java.util.Collection;
 import java.util.HashSet;
 
@@ -89,7 +87,6 @@ public final class TmfExperimentUtils {
      */
     public static @Nullable <T extends IAnalysisModule> T getAnalysisModuleOfClassForHost(TmfExperiment experiment, String hostId, Class<T> moduleClass) {
         for (ITmfTrace trace : getTracesFromHost(experiment, hostId)) {
-            trace = checkNotNull(trace);
             for (T module : TmfTraceUtils.getAnalysisModulesOfClass(trace, moduleClass)) {
                 return module;
             }
index 03b2be25e8bec046d9b6f2193a641afd4499d159..d5e053cbeadb3b6cdcc78497f4b4988462baa25e 100644 (file)
@@ -58,7 +58,7 @@ public class CommandShellTest {
         ICommandShell shell = LOCAL_PROXY.createCommandShell();
 
         ICommandInput command = shell.createCommand();
-        command.addAll(checkNotNull(Arrays.asList(CMD_INPUT_UNIX)));
+        command.addAll(Arrays.asList(CMD_INPUT_UNIX));
         ICommandResult result = shell.executeCommand(command, new NullProgressMonitor());
         assertEquals(0, result.getResult());
     }
@@ -76,7 +76,7 @@ public class CommandShellTest {
         ICommandShell shell = LOCAL_PROXY.createCommandShell();
 
         ICommandInput command = shell.createCommand();
-        command.addAll(checkNotNull(Arrays.asList(CMD_ERROR_INPUT_UNIX)));
+        command.addAll(Arrays.asList(CMD_ERROR_INPUT_UNIX));
         ICommandResult result = shell.executeCommand(command, new NullProgressMonitor());
         assertTrue(result.getResult() > 0);
     }
@@ -95,7 +95,7 @@ public class CommandShellTest {
         ICommandShell shell = LOCAL_PROXY.createCommandShell();
 
         ICommandInput command = shell.createCommand();
-        command.addAll(checkNotNull(Arrays.asList(CMD_UNKNOWN_COMMAND_UNIX)));
+        command.addAll(Arrays.asList(CMD_UNKNOWN_COMMAND_UNIX));
         ICommandResult result = shell.executeCommand(command, new NullProgressMonitor());
         assertTrue(result.getResult() > 0);
     }
index 7902bb585bdf3931d6095cc698e29bc789638048..fbcbc6b89409fb3bd7b64e69a6795e6d51ee0ff4 100644 (file)
@@ -11,7 +11,6 @@
  **********************************************************************/
 package org.eclipse.tracecompass.internal.tmf.remote.core.shell;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
 import static org.eclipse.tracecompass.common.core.NonNullUtils.nullToEmptyString;
 
 import java.util.ArrayList;
@@ -43,7 +42,7 @@ public class CommandInput implements ICommandInput {
 
     @Override
     public List<String> getInput() {
-        return checkNotNull(ImmutableList.copyOf(fInput));
+        return ImmutableList.copyOf(fInput);
     }
 
     // ------------------------------------------------------------------------
index 61d9364b23da1f528bb4cd2e30e3852bd6f8f9c6..3b76a4821dcd2944f1d349a3c42292d0e4891152 100644 (file)
@@ -121,7 +121,7 @@ public class LostEventsMarkerEventSource implements IMarkerEventSource {
         if (module == null) {
             return null;
         }
-        return module.getStateSystem(checkNotNull(TmfStatisticsEventTypesModule.ID));
+        return module.getStateSystem(TmfStatisticsEventTypesModule.ID);
     }
 
     private static int getLostEventsQuark(ITmfStateSystem ss) {
index 530d8db345c0a492052ee187c88fbee035efabbe..94edbaf4f3318fba2600205b3d42df7f8173a0a6 100644 (file)
@@ -9,8 +9,6 @@
 
 package org.eclipse.tracecompass.internal.tmf.ui.project.operations;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import org.eclipse.core.resources.IFolder;
 import org.eclipse.core.resources.IWorkspaceRoot;
 import org.eclipse.core.runtime.CoreException;
@@ -41,7 +39,7 @@ public class NewExperimentOperation implements IRunnableWithProgress {
     private final @NonNull String fExperimentName;
     private final @NonNull TmfExperimentFolder fExperimentFolderRoot;
     private @Nullable IFolder fExperimentFolder = null;
-    private @NonNull IStatus fStatus = checkNotNull(Status.OK_STATUS);
+    private @NonNull IStatus fStatus = Status.OK_STATUS;
 
     /**
      * Constructor
@@ -73,9 +71,9 @@ public class NewExperimentOperation implements IRunnableWithProgress {
                 experimentFolder.setPersistentProperty(TmfCommonConstants.TRACETYPE, ce.getAttribute(TmfTraceType.ID_ATTR));
             }
             fExperimentFolder = experimentFolder;
-            setStatus(checkNotNull(Status.OK_STATUS));
+            setStatus(Status.OK_STATUS);
         } catch (InterruptedException e) {
-            setStatus(checkNotNull(Status.CANCEL_STATUS));
+            setStatus(Status.CANCEL_STATUS);
         } catch (InvalidRegistryObjectException | CoreException e) {
             String msg = NLS.bind(Messages.NewExperimentOperation_CreationError, fExperimentName);
             Activator.getDefault().logError(msg, e);
index c4c63ff0fabc157582ecfac451bb86e64753be60..8e8625e083aa7e08d037b634c9a19e7042a1fca8 100644 (file)
@@ -8,8 +8,6 @@
  *******************************************************************************/
 package org.eclipse.tracecompass.internal.tmf.ui.project.operations;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
@@ -47,7 +45,7 @@ public class SelectTracesOperation implements IRunnableWithProgress {
     private final @Nullable List<TmfTraceElement> fTraceElements;
     private final @Nullable List<IResource> fResources;
     private final @Nullable Map<String, TmfTraceElement> fPreviousTraces;
-    private @NonNull IStatus fStatus = checkNotNull(Status.OK_STATUS);
+    private @NonNull IStatus fStatus = Status.OK_STATUS;
 
     /**
      * Constructor
@@ -159,9 +157,9 @@ public class SelectTracesOperation implements IRunnableWithProgress {
                 });
                 experimentElement.deleteSupplementaryResources();
             }
-            setStatus(checkNotNull(Status.OK_STATUS));
+            setStatus(Status.OK_STATUS);
         } catch (InterruptedException e) {
-            setStatus(checkNotNull(Status.CANCEL_STATUS));
+            setStatus(Status.CANCEL_STATUS);
         } catch (Exception e) {
             Activator.getDefault().logError(Messages.SelectTracesWizardPage_SelectionError, e);
             setStatus(new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.SelectTracesWizardPage_SelectionError, e));
index 8e261bd9d59859599fd10a41c3c3987e40ea9ba2..cf09bea21f2be65a6d8f0a5e918463b322349463 100644 (file)
@@ -15,8 +15,6 @@
 
 package org.eclipse.tracecompass.internal.tmf.ui.viewers.statistics;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
@@ -689,7 +687,6 @@ public class TmfStatisticsViewer extends TmfViewer {
         }
 
         for (ITmfTrace aTrace : TmfTraceManager.getTraceSet(trace)) {
-            aTrace = checkNotNull(aTrace);
             if (!isListeningTo(aTrace)) {
                 continue;
             }
index 0a662bbd08395a0412665ad60ebd53bd6f0978b9..0ce8e12d15f425ae683f1e44b21603fa24071a7d 100644 (file)
@@ -13,8 +13,6 @@
 
 package org.eclipse.tracecompass.tmf.ui.editors;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
@@ -377,7 +375,7 @@ public class TmfEventsEditor extends TmfEditor implements ITmfTraceEditor, IReus
                 builder.addAll(traceAspects);
             }
         }
-        return checkNotNull(builder.build());
+        return builder.build();
     }
 
     /**
index 7970533c27b3accec5c91363a5bb6759a74bf817..0bd505608b40b732c93b97f3d2dd237153b065b0 100644 (file)
@@ -12,8 +12,6 @@
 
 package org.eclipse.tracecompass.tmf.ui.editors;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import java.util.Arrays;
 
 import org.eclipse.jface.dialogs.IDialogSettings;
@@ -27,7 +25,7 @@ import org.eclipse.tracecompass.internal.tmf.ui.Activator;
  */
 public class TmfTraceColumnManager {
 
-    private static final String ROOT_SECTION_NAME = checkNotNull(TmfTraceColumnManager.class.getSimpleName());
+    private static final String ROOT_SECTION_NAME = TmfTraceColumnManager.class.getSimpleName();
     private static final String COLUMN_ORDER_SECTION_NAME = "column.order"; //$NON-NLS-1$
 
     /**
index f393e04bd2b3b887a641543a8af82fb384482582..43f831eea4500fce8b5f8422ea2e670f57f56be4 100644 (file)
@@ -18,8 +18,6 @@
 
 package org.eclipse.tracecompass.tmf.ui.viewers.events;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.lang.reflect.InvocationTargetException;
@@ -767,7 +765,7 @@ public class TmfEventsTable extends TmfComponent implements IGotoMarker, IColorS
                 builder.add(new TmfContentFieldAspect(fieldName, fieldName));
             }
         }
-        return checkNotNull(builder.build());
+        return builder.build();
     }
 
     /**
index c290f1629a6e6715375fd44780beded2386914c0..6e7bba9616e60d2819b8d00154c338f0028998fe 100644 (file)
@@ -11,8 +11,6 @@
  **********************************************************************/
 package org.eclipse.tracecompass.tmf.ui.viewers.xycharts;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
 import org.eclipse.swt.SWT;
@@ -203,7 +201,7 @@ public class TmfClosestDataPointTooltipProvider extends TmfBaseProvider implemen
             double[] yS = serie.getYSeries();
             if ((xS != null) && (yS != null) && (dataIndex < xS.length) && (dataIndex < yS.length)) {
                 StringBuffer buffer = new StringBuffer();
-                buffer.append(checkNotNull("x=")); //$NON-NLS-1$
+                buffer.append("x="); //$NON-NLS-1$
                 buffer.append(new TmfTimestamp((long) xS[dataIndex] + getChartViewer().getTimeOffset(), ITmfTimestamp.NANOSECOND_SCALE).toString());
                 buffer.append('\n');
                 buffer.append("y="); //$NON-NLS-1$
index d185edb99a3a8e0111b57216db79ac19aa20579d..0f5aca1193b61288b69298bc791c5e592e86614e 100644 (file)
@@ -1633,7 +1633,7 @@ public abstract class AbstractTimeGraphView extends TmfView implements ITmfTimeA
                 if (monitor.isCanceled()) {
                     break;
                 }
-                markers.addAll(markerEventSource.getMarkerList(checkNotNull(category), startTime, endTime, resolution, monitor));
+                markers.addAll(markerEventSource.getMarkerList(category, startTime, endTime, resolution, monitor));
             }
         }
         return markers;
@@ -1664,7 +1664,7 @@ public abstract class AbstractTimeGraphView extends TmfView implements ITmfTimeA
     private @NonNull List<IMarkerEventSource> getMarkerEventSources(ITmfTrace trace) {
         List<IMarkerEventSource> markerEventSources = fMarkerEventSourcesMap.get(trace);
         if (markerEventSources == null) {
-            markerEventSources = checkNotNull(Collections.<IMarkerEventSource>emptyList());
+            markerEventSources = Collections.emptyList();
         }
         return markerEventSources;
     }
This page took 0.121062 seconds and 5 git commands to generate.