From 0e4f957eff33d35923105497af515178953cacbc Mon Sep 17 00:00:00 2001 From: Alexandre Montplaisir Date: Wed, 9 Mar 2016 17:49:15 -0500 Subject: [PATCH] Remove unneeded checkNotNull() calls 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 Reviewed-on: https://git.eclipse.org/r/68101 Reviewed-by: Hudson CI --- .../analysis/graph/core/base/TmfGraph.java | 6 +++--- .../criticalpath/AbstractCriticalPathAlgorithm.java | 5 ++--- .../ui/criticalpath/view/CriticalPathView.java | 6 +++--- .../linux/core/cpuusage/KernelCpuUsageAnalysis.java | 4 ++-- .../KernelThreadInformationProvider.java | 2 +- .../analysis/os/linux/core/latency/SystemCall.java | 3 +-- .../core/latency/SystemCallLatencyAnalysis.java | 4 ++-- .../os/linux/core/trace/DefaultEventLayout.java | 4 +--- .../os/linux/core/kernel/KernelStateProvider.java | 2 +- .../SystemCallLatencyStatisticsAnalysisModule.java | 8 +++----- .../linux/ui/views/cpuusage/CpuUsageComposite.java | 2 +- .../views/latency/SystemCallLatencyDensityView.java | 3 +-- .../statistics/SystemCallLatencyStatisticsView.java | 4 +--- .../AbstractSegmentStoreScatterGraphViewer.java | 4 ++-- .../SegmentStoreScatterGraphTooltipProvider.java | 1 - .../AbstractSegmentStoreStatisticsViewer.java | 6 +++--- .../btf/core/trace/BtfEventAspects.java | 5 ++--- .../tests/collect/BufferedBlockingQueueTest.java | 9 ++++----- .../common/core/TraceCompassActivator.java | 3 +-- .../ctf/core/event/types/StringDeclaration.java | 3 +-- .../ctf/core/event/types/StructDeclaration.java | 4 ++-- .../ctf/core/event/types/ArrayDeclaration.java | 4 +--- .../ctf/core/event/types/ArrayDefinition.java | 6 ++---- .../ctf/core/event/types/ByteArrayDefinition.java | 7 ++----- .../ctf/core/event/types/SequenceDeclaration.java | 2 +- .../internal/ctf/core/trace/CTFStream.java | 3 +-- .../tmf/ctf/core/event/CtfTmfEvent.java | 5 ++--- .../tmf/ctf/core/event/CtfTmfEventField.java | 3 +-- .../tmf/ctf/core/trace/CtfTmfTrace.java | 4 ++-- .../ui/viewers/histogram/NewHistogramViewer.java | 3 --- .../gdbtrace/core/trace/GdbEventAspects.java | 6 ++---- .../control/stubs/shells/LTTngToolsFileShell.java | 4 ++-- .../core/tests/shared/vm/VmTestExperiment.java | 4 +--- .../analysis/vm/VirtualMachineAnalysisTest.java | 2 -- .../core/analysis/graph/handlers/BaseHandler.java | 2 +- .../core/analysis/graph/model/LttngSystemModel.java | 3 +-- .../analysis/vm/model/qemukvm/QemuKvmVmModel.java | 5 ++--- .../vm/module/VirtualMachineCpuAnalysis.java | 12 ++++-------- .../kernel/core/trace/layout/LttngEventLayout.java | 4 +--- .../kernel/core/trace/layout/PerfEventLayout.java | 4 +--- .../lttng2/kernel/core/trace/LttngKernelTrace.java | 3 +-- .../criticalpath/CriticalPathParameterProvider.java | 3 +-- .../ui/views/vm/vcpuview/VirtualMachineView.java | 8 ++++---- .../core/analysis/debuginfo/FileOffsetMapper.java | 6 ++---- .../debuginfo/UstDebugInfoStateProvider.java | 2 +- .../analysis/memory/UstMemoryStateProvider.java | 2 +- .../core/callstack/LttngUstCallStackProvider.java | 10 ++++------ .../debuginfo/UstDebugInfoAnalysisModule.java | 4 ++-- .../analysis/memory/UstMemoryAnalysisModule.java | 2 +- .../lttng2/ust/core/trace/LttngUstTrace.java | 3 +-- .../core/protocol/ethernet2/EthernetIIPacket.java | 2 +- .../pcap/core/protocol/ipv4/IPv4Packet.java | 2 +- .../pcap/core/protocol/pcap/PcapPacket.java | 2 +- .../pcap/core/protocol/tcp/TCPEndpoint.java | 4 +--- .../internal/pcap/core/protocol/tcp/TCPPacket.java | 4 +--- .../pcap/core/protocol/udp/UDPEndpoint.java | 4 +--- .../internal/pcap/core/protocol/udp/UDPPacket.java | 2 +- .../pcap/core/protocol/unknown/UnknownPacket.java | 2 +- .../internal/pcap/core/stream/PacketStream.java | 4 +--- .../internal/pcap/core/trace/PcapFile.java | 8 ++++---- .../internal/tmf/pcap/core/event/PcapEvent.java | 4 +--- .../internal/tmf/pcap/core/trace/PcapTrace.java | 4 ++-- .../tmf/pcap/core/util/PcapEventFactory.java | 2 +- .../segmentstore/core/treemap/TreeMapStore.java | 2 +- .../core/tests/stubs/backend/HistoryTreeStub.java | 4 ++-- .../analysis/xml/core/model/TmfXmlStateValue.java | 4 +--- .../xml/core/module/TmfAnalysisModuleHelperXml.java | 4 +--- .../analysis/xml/ui/views/xychart/XmlXYViewer.java | 3 +-- .../stubs/analysis/AnalysisModuleTestHelper.java | 4 +--- .../tmf/tests/stubs/trace/text/SyslogTrace.java | 6 ++---- .../TmfAnalysisModuleSourceConfigElement.java | 4 +--- .../tmf/core/parsers/custom/CustomEventAspects.java | 4 +--- .../core/analysis/TmfAbstractAnalysisModule.java | 6 +++--- .../tmf/core/analysis/TmfAnalysisManager.java | 4 ++-- .../tracecompass/tmf/core/event/TmfEventField.java | 8 ++++---- .../tmf/core/event/aspect/ITmfEventAspect.java | 6 ++---- .../parsers/custom/CustomTxtTraceDefinition.java | 2 +- .../parsers/custom/CustomXmlTraceDefinition.java | 4 +--- .../core/signal/TmfSelectionRangeUpdatedSignal.java | 4 +--- .../core/statesystem/AbstractTmfStateProvider.java | 8 +++----- .../statesystem/TmfStateSystemAnalysisModule.java | 8 ++------ .../tracecompass/tmf/core/trace/TmfTrace.java | 6 ++---- .../tmf/core/trace/TmfTraceManager.java | 13 ++++++------- .../core/trace/experiment/TmfExperimentUtils.java | 3 --- .../remote/core/tests/shell/CommandShellTest.java | 6 +++--- .../tmf/remote/core/shell/CommandInput.java | 3 +-- .../tmf/ui/markers/LostEventsMarkerEventSource.java | 2 +- .../project/operations/NewExperimentOperation.java | 8 +++----- .../project/operations/SelectTracesOperation.java | 8 +++----- .../ui/viewers/statistics/TmfStatisticsViewer.java | 3 --- .../tmf/ui/editors/TmfEventsEditor.java | 4 +--- .../tmf/ui/editors/TmfTraceColumnManager.java | 4 +--- .../tmf/ui/viewers/events/TmfEventsTable.java | 4 +--- .../TmfClosestDataPointTooltipProvider.java | 4 +--- .../ui/views/timegraph/AbstractTimeGraphView.java | 4 ++-- 95 files changed, 154 insertions(+), 261 deletions(-) diff --git a/analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/analysis/graph/core/base/TmfGraph.java b/analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/analysis/graph/core/base/TmfGraph.java index 1e0ec7cd88..d59a8bc606 100644 --- a/analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/analysis/graph/core/base/TmfGraph.java +++ b/analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/analysis/graph/core/base/TmfGraph.java @@ -265,7 +265,7 @@ public class TmfGraph { * @return The list of vertices for the object */ public List 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 getWorkers() { - return NonNullUtils.checkNotNull(ImmutableSet.copyOf(fNodeMap.keySet())); + return ImmutableSet.copyOf(fNodeMap.keySet()); } /** @@ -345,7 +345,7 @@ public class TmfGraph { HashSet visited = new HashSet<>(); stack.add(start); while (!stack.isEmpty()) { - TmfVertex curr = NonNullUtils.checkNotNull(stack.pop()); + TmfVertex curr = stack.pop(); if (visited.contains(curr)) { continue; } diff --git a/analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/internal/analysis/graph/core/criticalpath/AbstractCriticalPathAlgorithm.java b/analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/internal/analysis/graph/core/criticalpath/AbstractCriticalPathAlgorithm.java index ce9051f866..38e75d4973 100644 --- a/analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/internal/analysis/graph/core/criticalpath/AbstractCriticalPathAlgorithm.java +++ b/analysis/org.eclipse.tracecompass.analysis.graph.core/src/org/eclipse/tracecompass/internal/analysis/graph/core/criticalpath/AbstractCriticalPathAlgorithm.java @@ -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(); } } diff --git a/analysis/org.eclipse.tracecompass.analysis.graph.ui/src/org/eclipse/tracecompass/internal/analysis/graph/ui/criticalpath/view/CriticalPathView.java b/analysis/org.eclipse.tracecompass.analysis.graph.ui/src/org/eclipse/tracecompass/internal/analysis/graph/ui/criticalpath/view/CriticalPathView.java index 2ceed26e2a..1ec8e4278f 100644 --- a/analysis/org.eclipse.tracecompass.analysis.graph.ui/src/org/eclipse/tracecompass/internal/analysis/graph/ui/criticalpath/view/CriticalPathView.java +++ b/analysis/org.eclipse.tracecompass.analysis.graph.ui/src/org/eclipse/tracecompass/internal/analysis/graph/ui/criticalpath/view/CriticalPathView.java @@ -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); } } diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/cpuusage/KernelCpuUsageAnalysis.java b/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/cpuusage/KernelCpuUsageAnalysis.java index 24e496d3a1..045d634a88 100644 --- a/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/cpuusage/KernelCpuUsageAnalysis.java +++ b/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/cpuusage/KernelCpuUsageAnalysis.java @@ -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; diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/kernelanalysis/KernelThreadInformationProvider.java b/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/kernelanalysis/KernelThreadInformationProvider.java index 874020e14c..88d13b5113 100644 --- a/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/kernelanalysis/KernelThreadInformationProvider.java +++ b/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/kernelanalysis/KernelThreadInformationProvider.java @@ -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: diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/latency/SystemCall.java b/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/latency/SystemCall.java index d89ff4e46d..0ccaadc8d0 100644 --- a/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/latency/SystemCall.java +++ b/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/latency/SystemCall.java @@ -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 arguments) { fStartTime = startTime; fName = name; - fArgs = NonNullUtils.checkNotNull(ImmutableMap.copyOf(arguments)); + fArgs = ImmutableMap.copyOf(arguments); } } diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/latency/SystemCallLatencyAnalysis.java b/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/latency/SystemCallLatencyAnalysis.java index 1f12df8f83..9db321fa6a 100644 --- a/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/latency/SystemCallLatencyAnalysis.java +++ b/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/latency/SystemCallLatencyAnalysis.java @@ -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 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; } diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/trace/DefaultEventLayout.java b/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/trace/DefaultEventLayout.java index b593e94995..149600c72d 100644 --- a/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/trace/DefaultEventLayout.java +++ b/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/analysis/os/linux/core/trace/DefaultEventLayout.java @@ -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 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$ diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/internal/analysis/os/linux/core/kernel/KernelStateProvider.java b/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/internal/analysis/os/linux/core/kernel/KernelStateProvider.java index 808784877c..a250921b99 100644 --- a/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/internal/analysis/os/linux/core/kernel/KernelStateProvider.java +++ b/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/internal/analysis/os/linux/core/kernel/KernelStateProvider.java @@ -120,7 +120,7 @@ public class KernelStateProvider extends AbstractTmfStateProvider { builder.put(eventSchedWakeup, new SchedWakeupHandler(layout)); } - return NonNullUtils.checkNotNull(builder.build()); + return builder.build(); } // ------------------------------------------------------------------------ diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/internal/analysis/os/linux/core/latency/statistics/SystemCallLatencyStatisticsAnalysisModule.java b/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/internal/analysis/os/linux/core/latency/statistics/SystemCallLatencyStatisticsAnalysisModule.java index 3dbc8f352f..f7e97cb5ee 100644 --- a/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/internal/analysis/os/linux/core/latency/statistics/SystemCallLatencyStatisticsAnalysisModule.java +++ b/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/internal/analysis/os/linux/core/latency/statistics/SystemCallLatencyStatisticsAnalysisModule.java @@ -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 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; diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/analysis/os/linux/ui/views/cpuusage/CpuUsageComposite.java b/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/analysis/os/linux/ui/views/cpuusage/CpuUsageComposite.java index f1b7e03655..162096356d 100644 --- a/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/analysis/os/linux/ui/views/cpuusage/CpuUsageComposite.java +++ b/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/analysis/os/linux/ui/views/cpuusage/CpuUsageComposite.java @@ -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 list = checkNotNull(Collections.singletonList(entry)); + List list = Collections.singletonList(entry); super.setSelection(list); return; } diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/latency/SystemCallLatencyDensityView.java b/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/latency/SystemCallLatencyDensityView.java index 304d55c9f9..1f4617f4a4 100644 --- a/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/latency/SystemCallLatencyDensityView.java +++ b/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/latency/SystemCallLatencyDensityView.java @@ -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); } } diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/latency/statistics/SystemCallLatencyStatisticsView.java b/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/latency/statistics/SystemCallLatencyStatisticsView.java index 9aca6e8a62..daf9f9e3d0 100644 --- a/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/latency/statistics/SystemCallLatencyStatisticsView.java +++ b/analysis/org.eclipse.tracecompass.analysis.os.linux.ui/src/org/eclipse/tracecompass/internal/analysis/os/linux/ui/views/latency/statistics/SystemCallLatencyStatisticsView.java @@ -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); } } diff --git a/analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/analysis/timing/ui/views/segmentstore/scatter/AbstractSegmentStoreScatterGraphViewer.java b/analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/analysis/timing/ui/views/segmentstore/scatter/AbstractSegmentStoreScatterGraphViewer.java index 015140f0b0..1017c9f581 100644 --- a/analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/analysis/timing/ui/views/segmentstore/scatter/AbstractSegmentStoreScatterGraphViewer.java +++ b/analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/analysis/timing/ui/views/segmentstore/scatter/AbstractSegmentStoreScatterGraphViewer.java @@ -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; } diff --git a/analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/internal/analysis/timing/ui/views/segmentstore/scatter/SegmentStoreScatterGraphTooltipProvider.java b/analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/internal/analysis/timing/ui/views/segmentstore/scatter/SegmentStoreScatterGraphTooltipProvider.java index 7225d92c4b..50d22ce38c 100644 --- a/analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/internal/analysis/timing/ui/views/segmentstore/scatter/SegmentStoreScatterGraphTooltipProvider.java +++ b/analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/internal/analysis/timing/ui/views/segmentstore/scatter/SegmentStoreScatterGraphTooltipProvider.java @@ -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; diff --git a/analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/internal/analysis/timing/ui/views/segmentstore/statistics/AbstractSegmentStoreStatisticsViewer.java b/analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/internal/analysis/timing/ui/views/segmentstore/statistics/AbstractSegmentStoreStatisticsViewer.java index 7a76933128..347aeb6643 100644 --- a/analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/internal/analysis/timing/ui/views/segmentstore/statistics/AbstractSegmentStoreStatisticsViewer.java +++ b/analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/internal/analysis/timing/ui/views/segmentstore/statistics/AbstractSegmentStoreStatisticsViewer.java @@ -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; } } diff --git a/btf/org.eclipse.tracecompass.btf.core/src/org/eclipse/tracecompass/btf/core/trace/BtfEventAspects.java b/btf/org.eclipse.tracecompass.btf.core/src/org/eclipse/tracecompass/btf/core/trace/BtfEventAspects.java index d09819841e..e14a70305b 100644 --- a/btf/org.eclipse.tracecompass.btf.core/src/org/eclipse/tracecompass/btf/core/trace/BtfEventAspects.java +++ b/btf/org.eclipse.tracecompass.btf.core/src/org/eclipse/tracecompass/btf/core/trace/BtfEventAspects.java @@ -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 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()} diff --git a/common/org.eclipse.tracecompass.common.core.tests/src/org/eclipse/tracecompass/common/core/tests/collect/BufferedBlockingQueueTest.java b/common/org.eclipse.tracecompass.common.core.tests/src/org/eclipse/tracecompass/common/core/tests/collect/BufferedBlockingQueueTest.java index f027fa7e1a..d0b3095d51 100644 --- a/common/org.eclipse.tracecompass.common.core.tests/src/org/eclipse/tracecompass/common/core/tests/collect/BufferedBlockingQueueTest.java +++ b/common/org.eclipse.tracecompass.common.core.tests/src/org/eclipse/tracecompass/common/core/tests/collect/BufferedBlockingQueueTest.java @@ -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); diff --git a/common/org.eclipse.tracecompass.common.core/src/org/eclipse/tracecompass/common/core/TraceCompassActivator.java b/common/org.eclipse.tracecompass.common.core/src/org/eclipse/tracecompass/common/core/TraceCompassActivator.java index 5e2cc18fea..39266d6f0c 100644 --- a/common/org.eclipse.tracecompass.common.core/src/org/eclipse/tracecompass/common/core/TraceCompassActivator.java +++ b/common/org.eclipse.tracecompass.common.core/src/org/eclipse/tracecompass/common/core/TraceCompassActivator.java @@ -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 ACTIVATORS = - checkNotNull(Collections.synchronizedMap(new HashMap())); + Collections.synchronizedMap(new HashMap()); /** This instance's plug-in ID */ private final String fPluginId; diff --git a/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/types/StringDeclaration.java b/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/types/StringDeclaration.java index 045e12d3e5..4e6afd0bba 100644 --- a/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/types/StringDeclaration.java +++ b/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/types/StringDeclaration.java @@ -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 diff --git a/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/types/StructDeclaration.java b/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/types/StructDeclaration.java index be18d3837c..ff4482f5d1 100644 --- a/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/types/StructDeclaration.java +++ b/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/ctf/core/event/types/StructDeclaration.java @@ -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); diff --git a/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/types/ArrayDeclaration.java b/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/types/ArrayDeclaration.java index 410012c408..4a4572c4d3 100644 --- a/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/types/ArrayDeclaration.java +++ b/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/types/ArrayDeclaration.java @@ -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 diff --git a/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/types/ArrayDefinition.java b/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/types/ArrayDefinition.java index 5a70f024a5..77dbe482cb 100644 --- a/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/types/ArrayDefinition.java +++ b/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/types/ArrayDefinition.java @@ -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 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 diff --git a/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/types/ByteArrayDefinition.java b/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/types/ByteArrayDefinition.java index 4964bfed45..cde364096d 100644 --- a/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/types/ByteArrayDefinition.java +++ b/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/types/ByteArrayDefinition.java @@ -12,14 +12,11 @@ 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(); } /** diff --git a/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/types/SequenceDeclaration.java b/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/types/SequenceDeclaration.java index 1a871ddbb1..76a5dc608a 100644 --- a/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/types/SequenceDeclaration.java +++ b/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/event/types/SequenceDeclaration.java @@ -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); } diff --git a/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/trace/CTFStream.java b/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/trace/CTFStream.java index 663dae05e8..e4988c22fd 100644 --- a/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/trace/CTFStream.java +++ b/ctf/org.eclipse.tracecompass.ctf.core/src/org/eclipse/tracecompass/internal/ctf/core/trace/CTFStream.java @@ -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 diff --git a/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/tmf/ctf/core/event/CtfTmfEvent.java b/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/tmf/ctf/core/event/CtfTmfEvent.java index d76e26da97..32e7d8ed1a 100644 --- a/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/tmf/ctf/core/event/CtfTmfEvent.java +++ b/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/tmf/ctf/core/event/CtfTmfEvent.java @@ -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()]); } // ------------------------------------------------------------------------ diff --git a/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/tmf/ctf/core/event/CtfTmfEventField.java b/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/tmf/ctf/core/event/CtfTmfEventField.java index d6a0bdd2d0..c64c28de1b 100644 --- a/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/tmf/ctf/core/event/CtfTmfEventField.java +++ b/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/tmf/ctf/core/event/CtfTmfEventField.java @@ -189,8 +189,7 @@ public abstract class CtfTmfEventField extends TmfEventField { List 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()])); diff --git a/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/tmf/ctf/core/trace/CtfTmfTrace.java b/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/tmf/ctf/core/trace/CtfTmfTrace.java index 6ad176f06b..76591c6989 100644 --- a/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/tmf/ctf/core/trace/CtfTmfTrace.java +++ b/ctf/org.eclipse.tracecompass.tmf.ctf.core/src/org/eclipse/tracecompass/tmf/ctf/core/trace/CtfTmfTrace.java @@ -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 diff --git a/doc/org.eclipse.tracecompass.examples/src/org/eclipse/tracecompass/examples/ui/viewers/histogram/NewHistogramViewer.java b/doc/org.eclipse.tracecompass.examples/src/org/eclipse/tracecompass/examples/ui/viewers/histogram/NewHistogramViewer.java index 413d33b881..61d0ba3e29 100644 --- a/doc/org.eclipse.tracecompass.examples/src/org/eclipse/tracecompass/examples/ui/viewers/histogram/NewHistogramViewer.java +++ b/doc/org.eclipse.tracecompass.examples/src/org/eclipse/tracecompass/examples/ui/viewers/histogram/NewHistogramViewer.java @@ -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); diff --git a/gdbtrace/org.eclipse.tracecompass.gdbtrace.core/src/org/eclipse/tracecompass/internal/gdbtrace/core/trace/GdbEventAspects.java b/gdbtrace/org.eclipse.tracecompass.gdbtrace.core/src/org/eclipse/tracecompass/internal/gdbtrace/core/trace/GdbEventAspects.java index 9c1b7719b6..188c14bd48 100644 --- a/gdbtrace/org.eclipse.tracecompass.gdbtrace.core/src/org/eclipse/tracecompass/internal/gdbtrace/core/trace/GdbEventAspects.java +++ b/gdbtrace/org.eclipse.tracecompass.gdbtrace.core/src/org/eclipse/tracecompass/internal/gdbtrace/core/trace/GdbEventAspects.java @@ -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 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 { diff --git a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/tracecompass/internal/lttng2/control/stubs/shells/LTTngToolsFileShell.java b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/tracecompass/internal/lttng2/control/stubs/shells/LTTngToolsFileShell.java index 676675923e..ebcd00e29d 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/tracecompass/internal/lttng2/control/stubs/shells/LTTngToolsFileShell.java +++ b/lttng/org.eclipse.tracecompass.lttng2.control.ui.tests/stubs/org/eclipse/tracecompass/internal/lttng2/control/stubs/shells/LTTngToolsFileShell.java @@ -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)) { diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/shared/org/eclipse/tracecompass/lttng2/lttng/kernel/core/tests/shared/vm/VmTestExperiment.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/shared/org/eclipse/tracecompass/lttng2/lttng/kernel/core/tests/shared/vm/VmTestExperiment.java index e9ffc3357b..ba963ec0a8 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/shared/org/eclipse/tracecompass/lttng2/lttng/kernel/core/tests/shared/vm/VmTestExperiment.java +++ b/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/shared/org/eclipse/tracecompass/lttng2/lttng/kernel/core/tests/shared/vm/VmTestExperiment.java @@ -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) { /* diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/tracecompass/lttng2/kernel/core/tests/analysis/vm/VirtualMachineAnalysisTest.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/tracecompass/lttng2/kernel/core/tests/analysis/vm/VirtualMachineAnalysisTest.java index e5cd79b542..4b28bea720 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/tracecompass/lttng2/kernel/core/tests/analysis/vm/VirtualMachineAnalysisTest.java +++ b/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/tracecompass/lttng2/kernel/core/tests/analysis/vm/VirtualMachineAnalysisTest.java @@ -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(); diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/analysis/graph/handlers/BaseHandler.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/analysis/graph/handlers/BaseHandler.java index f0d6ef964d..6f61018725 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/analysis/graph/handlers/BaseHandler.java +++ b/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/analysis/graph/handlers/BaseHandler.java @@ -104,7 +104,7 @@ public class BaseHandler extends AbstractTraceEventHandler { * @return the graph provider */ public LttngKernelExecGraphProvider getProvider() { - return NonNullUtils.checkNotNull(fProvider); + return fProvider; } /** diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/analysis/graph/model/LttngSystemModel.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/analysis/graph/model/LttngSystemModel.java index 6d553fa934..45fcf2b924 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/analysis/graph/model/LttngSystemModel.java +++ b/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/analysis/graph/model/LttngSystemModel.java @@ -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 getWorkers() { - return NonNullUtils.checkNotNull(fWorkerMap.values()); + return fWorkerMap.values(); } /** diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/analysis/vm/model/qemukvm/QemuKvmVmModel.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/analysis/vm/model/qemukvm/QemuKvmVmModel.java index 525631b7c6..dad3991fc1 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/analysis/vm/model/qemukvm/QemuKvmVmModel.java +++ b/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/analysis/vm/model/qemukvm/QemuKvmVmModel.java @@ -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 REQUIRED_EVENTS = NonNullUtils.checkNotNull(ImmutableSet.of( + static final ImmutableSet 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 diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/analysis/vm/module/VirtualMachineCpuAnalysis.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/analysis/vm/module/VirtualMachineCpuAnalysis.java index fa41caba37..93e31a8b50 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/analysis/vm/module/VirtualMachineCpuAnalysis.java +++ b/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/analysis/vm/module/VirtualMachineCpuAnalysis.java @@ -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 REQUIRED_EVENTS = NonNullUtils.checkNotNull(ImmutableSet.of( + static final Set 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 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; } } diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/LttngEventLayout.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/LttngEventLayout.java index 80dcf265e9..72c26b0611 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/LttngEventLayout.java +++ b/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/LttngEventLayout.java @@ -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 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"; diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/PerfEventLayout.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/PerfEventLayout.java index 1b927c4c82..4fa93c93e0 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/PerfEventLayout.java +++ b/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/trace/layout/PerfEventLayout.java @@ -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 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 eventsSchedWakeup() { diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/lttng2/kernel/core/trace/LttngKernelTrace.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/lttng2/kernel/core/trace/LttngKernelTrace.java index 00e813be8c..f415947023 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/lttng2/kernel/core/trace/LttngKernelTrace.java +++ b/lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/lttng2/kernel/core/trace/LttngKernelTrace.java @@ -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(); } /** diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/tracecompass/internal/lttng2/kernel/ui/criticalpath/CriticalPathParameterProvider.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/tracecompass/internal/lttng2/kernel/ui/criticalpath/CriticalPathParameterProvider.java index 102b76f3ee..c09da07ec5 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/tracecompass/internal/lttng2/kernel/ui/criticalpath/CriticalPathParameterProvider.java +++ b/lttng/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/tracecompass/internal/lttng2/kernel/ui/criticalpath/CriticalPathParameterProvider.java @@ -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; diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/tracecompass/internal/lttng2/kernel/ui/views/vm/vcpuview/VirtualMachineView.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/tracecompass/internal/lttng2/kernel/ui/views/vm/vcpuview/VirtualMachineView.java index abc44a3479..1bb049c4e3 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/tracecompass/internal/lttng2/kernel/ui/views/vm/vcpuview/VirtualMachineView.java +++ b/lttng/org.eclipse.tracecompass.lttng2.kernel.ui/src/org/eclipse/tracecompass/internal/lttng2/kernel/ui/views/vm/vcpuview/VirtualMachineView.java @@ -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 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); } } diff --git a/lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/internal/lttng2/ust/core/analysis/debuginfo/FileOffsetMapper.java b/lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/internal/lttng2/ust/core/analysis/debuginfo/FileOffsetMapper.java index 5acb66c8a9..838fa72738 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/internal/lttng2/ust/core/analysis/debuginfo/FileOffsetMapper.java +++ b/lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/internal/lttng2/ust/core/analysis/debuginfo/FileOffsetMapper.java @@ -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 callsites = new LinkedList<>(); // FIXME Could eventually use CDT's Addr2line class once it imlements --inlines - List 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 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 */ diff --git a/lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/internal/lttng2/ust/core/analysis/debuginfo/UstDebugInfoStateProvider.java b/lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/internal/lttng2/ust/core/analysis/debuginfo/UstDebugInfoStateProvider.java index 9ef8441220..3d1b831faa 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/internal/lttng2/ust/core/analysis/debuginfo/UstDebugInfoStateProvider.java +++ b/lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/internal/lttng2/ust/core/analysis/debuginfo/UstDebugInfoStateProvider.java @@ -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 diff --git a/lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/internal/lttng2/ust/core/analysis/memory/UstMemoryStateProvider.java b/lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/internal/lttng2/ust/core/analysis/memory/UstMemoryStateProvider.java index 4834f9c078..68d5426e24 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/internal/lttng2/ust/core/analysis/memory/UstMemoryStateProvider.java +++ b/lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/internal/lttng2/ust/core/analysis/memory/UstMemoryStateProvider.java @@ -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 diff --git a/lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/internal/lttng2/ust/core/callstack/LttngUstCallStackProvider.java b/lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/internal/lttng2/ust/core/callstack/LttngUstCallStackProvider.java index 6f7bfb41c8..cd89b40114 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/internal/lttng2/ust/core/callstack/LttngUstCallStackProvider.java +++ b/lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/internal/lttng2/ust/core/callstack/LttngUstCallStackProvider.java @@ -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()); } // ------------------------------------------------------------------------ diff --git a/lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/lttng2/ust/core/analysis/debuginfo/UstDebugInfoAnalysisModule.java b/lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/lttng2/ust/core/analysis/debuginfo/UstDebugInfoAnalysisModule.java index c6308d13d1..7108e1de4e 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/lttng2/ust/core/analysis/debuginfo/UstDebugInfoAnalysisModule.java +++ b/lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/lttng2/ust/core/analysis/debuginfo/UstDebugInfoAnalysisModule.java @@ -184,7 +184,7 @@ public class UstDebugInfoAnalysisModule extends TmfStateSystemAnalysisModule { /* Get the most probable base address from all the known ones */ NavigableSet 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 buildIds = ss.getSubAttributes(baddrQuark, false); Optional potentialBuildIdQuark = buildIds.stream() .filter(id -> { - int quark = checkNotNull(id).intValue(); + int quark = id.intValue(); ITmfStateValue value = fullState.get(quark).getStateValue(); return (!value.isNull()); }) diff --git a/lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/lttng2/ust/core/analysis/memory/UstMemoryAnalysisModule.java b/lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/lttng2/ust/core/analysis/memory/UstMemoryAnalysisModule.java index 82f87e56b5..c5df05d2ff 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/lttng2/ust/core/analysis/memory/UstMemoryAnalysisModule.java +++ b/lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/lttng2/ust/core/analysis/memory/UstMemoryAnalysisModule.java @@ -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 diff --git a/lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/lttng2/ust/core/trace/LttngUstTrace.java b/lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/lttng2/ust/core/trace/LttngUstTrace.java index 8f159f498f..6e9345cd4c 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/lttng2/ust/core/trace/LttngUstTrace.java +++ b/lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/lttng2/ust/core/trace/LttngUstTrace.java @@ -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; diff --git a/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/ethernet2/EthernetIIPacket.java b/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/ethernet2/EthernetIIPacket.java index 2f64df9fc5..1a11da071a 100644 --- a/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/ethernet2/EthernetIIPacket.java +++ b/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/ethernet2/EthernetIIPacket.java @@ -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; diff --git a/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/ipv4/IPv4Packet.java b/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/ipv4/IPv4Packet.java index 5574fddab3..e83d34049d 100644 --- a/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/ipv4/IPv4Packet.java +++ b/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/ipv4/IPv4Packet.java @@ -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; diff --git a/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/pcap/PcapPacket.java b/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/pcap/PcapPacket.java index cd0ad45cfe..56d5ee3361 100644 --- a/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/pcap/PcapPacket.java +++ b/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/pcap/PcapPacket.java @@ -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; diff --git a/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/tcp/TCPEndpoint.java b/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/tcp/TCPEndpoint.java index a5d400413a..78d861b055 100644 --- a/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/tcp/TCPEndpoint.java +++ b/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/tcp/TCPEndpoint.java @@ -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; } diff --git a/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/tcp/TCPPacket.java b/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/tcp/TCPPacket.java index 574b011279..5259ec13f1 100644 --- a/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/tcp/TCPPacket.java +++ b/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/tcp/TCPPacket.java @@ -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; diff --git a/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/udp/UDPEndpoint.java b/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/udp/UDPEndpoint.java index 7367e8a128..d13174c459 100644 --- a/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/udp/UDPEndpoint.java +++ b/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/udp/UDPEndpoint.java @@ -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; } diff --git a/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/udp/UDPPacket.java b/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/udp/UDPPacket.java index 169c2f51d3..8503ba2ee2 100644 --- a/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/udp/UDPPacket.java +++ b/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/udp/UDPPacket.java @@ -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; diff --git a/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/unknown/UnknownPacket.java b/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/unknown/UnknownPacket.java index c214995b41..ac181a95b4 100644 --- a/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/unknown/UnknownPacket.java +++ b/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/protocol/unknown/UnknownPacket.java @@ -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; diff --git a/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/stream/PacketStream.java b/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/stream/PacketStream.java index ddb835a319..aa738bd58e 100644 --- a/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/stream/PacketStream.java +++ b/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/stream/PacketStream.java @@ -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(); } diff --git a/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/trace/PcapFile.java b/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/trace/PcapFile.java index 08bc61fcc0..e2932fa89e 100644 --- a/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/trace/PcapFile.java +++ b/pcap/org.eclipse.tracecompass.pcap.core/src/org/eclipse/tracecompass/internal/pcap/core/trace/PcapFile.java @@ -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: diff --git a/pcap/org.eclipse.tracecompass.tmf.pcap.core/src/org/eclipse/tracecompass/internal/tmf/pcap/core/event/PcapEvent.java b/pcap/org.eclipse.tracecompass.tmf.pcap.core/src/org/eclipse/tracecompass/internal/tmf/pcap/core/event/PcapEvent.java index 33d84f43ba..6ec95cde79 100644 --- a/pcap/org.eclipse.tracecompass.tmf.pcap.core/src/org/eclipse/tracecompass/internal/tmf/pcap/core/event/PcapEvent.java +++ b/pcap/org.eclipse.tracecompass.tmf.pcap.core/src/org/eclipse/tracecompass/internal/tmf/pcap/core/event/PcapEvent.java @@ -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; } diff --git a/pcap/org.eclipse.tracecompass.tmf.pcap.core/src/org/eclipse/tracecompass/internal/tmf/pcap/core/trace/PcapTrace.java b/pcap/org.eclipse.tracecompass.tmf.pcap.core/src/org/eclipse/tracecompass/internal/tmf/pcap/core/trace/PcapTrace.java index c3ffe5d954..624334cf82 100644 --- a/pcap/org.eclipse.tracecompass.tmf.pcap.core/src/org/eclipse/tracecompass/internal/tmf/pcap/core/trace/PcapTrace.java +++ b/pcap/org.eclipse.tracecompass.tmf.pcap.core/src/org/eclipse/tracecompass/internal/tmf/pcap/core/trace/PcapTrace.java @@ -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 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; diff --git a/pcap/org.eclipse.tracecompass.tmf.pcap.core/src/org/eclipse/tracecompass/internal/tmf/pcap/core/util/PcapEventFactory.java b/pcap/org.eclipse.tracecompass.tmf.pcap.core/src/org/eclipse/tracecompass/internal/tmf/pcap/core/util/PcapEventFactory.java index 91f47dd6e4..5bbac26769 100644 --- a/pcap/org.eclipse.tracecompass.tmf.pcap.core/src/org/eclipse/tracecompass/internal/tmf/pcap/core/util/PcapEventFactory.java +++ b/pcap/org.eclipse.tracecompass.tmf.pcap.core/src/org/eclipse/tracecompass/internal/tmf/pcap/core/util/PcapEventFactory.java @@ -111,7 +111,7 @@ public class PcapEventFactory { while (localPacket != null) { subfieldList.clear(); for (Map.Entry entry : localPacket.getFields().entrySet()) { - String key = checkNotNull(entry.getKey()); + String key = entry.getKey(); String value = entry.getValue(); subfieldList.add(new TmfEventField(key, value, null)); } diff --git a/statesystem/org.eclipse.tracecompass.segmentstore.core/src/org/eclipse/tracecompass/segmentstore/core/treemap/TreeMapStore.java b/statesystem/org.eclipse.tracecompass.segmentstore.core/src/org/eclipse/tracecompass/segmentstore/core/treemap/TreeMapStore.java index c32c8e9dcf..452862ff8b 100644 --- a/statesystem/org.eclipse.tracecompass.segmentstore.core/src/org/eclipse/tracecompass/segmentstore/core/treemap/TreeMapStore.java +++ b/statesystem/org.eclipse.tracecompass.segmentstore.core/src/org/eclipse/tracecompass/segmentstore/core/treemap/TreeMapStore.java @@ -101,7 +101,7 @@ public class TreeMapStore<@NonNull E extends ISegment> implements ISegmentStore< try { Iterable lastSnapshot = fLastSnapshot; if (lastSnapshot == null) { - lastSnapshot = checkNotNull(ImmutableList.copyOf(fStartTimesIndex.values())); + lastSnapshot = ImmutableList.copyOf(fStartTimesIndex.values()); fLastSnapshot = lastSnapshot; } return checkNotNull(lastSnapshot.iterator()); diff --git a/statesystem/org.eclipse.tracecompass.statesystem.core.tests/stubs/org/eclipse/tracecompass/statesystem/core/tests/stubs/backend/HistoryTreeStub.java b/statesystem/org.eclipse.tracecompass.statesystem.core.tests/stubs/org/eclipse/tracecompass/statesystem/core/tests/stubs/backend/HistoryTreeStub.java index d83fceb714..63ba47c545 100644 --- a/statesystem/org.eclipse.tracecompass.statesystem.core.tests/stubs/org/eclipse/tracecompass/statesystem/core/tests/stubs/backend/HistoryTreeStub.java +++ b/statesystem/org.eclipse.tracecompass.statesystem.core.tests/stubs/org/eclipse/tracecompass/statesystem/core/tests/stubs/backend/HistoryTreeStub.java @@ -56,7 +56,7 @@ public class HistoryTreeStub extends HistoryTree { */ public HTNode getLatestLeaf() { List 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 latest = getLatestBranch(); - return checkNotNull(latest.get(pos)); + return latest.get(pos); } /** diff --git a/tmf/org.eclipse.tracecompass.tmf.analysis.xml.core/src/org/eclipse/tracecompass/tmf/analysis/xml/core/model/TmfXmlStateValue.java b/tmf/org.eclipse.tracecompass.tmf.analysis.xml.core/src/org/eclipse/tracecompass/tmf/analysis/xml/core/model/TmfXmlStateValue.java index 4c20d8cd87..e2e793981d 100644 --- a/tmf/org.eclipse.tracecompass.tmf.analysis.xml.core/src/org/eclipse/tracecompass/tmf/analysis/xml/core/model/TmfXmlStateValue.java +++ b/tmf/org.eclipse.tracecompass.tmf.analysis.xml.core/src/org/eclipse/tracecompass/tmf/analysis/xml/core/model/TmfXmlStateValue.java @@ -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); } diff --git a/tmf/org.eclipse.tracecompass.tmf.analysis.xml.core/src/org/eclipse/tracecompass/tmf/analysis/xml/core/module/TmfAnalysisModuleHelperXml.java b/tmf/org.eclipse.tracecompass.tmf.analysis.xml.core/src/org/eclipse/tracecompass/tmf/analysis/xml/core/module/TmfAnalysisModuleHelperXml.java index 79d42453ca..8f88f33837 100644 --- a/tmf/org.eclipse.tracecompass.tmf.analysis.xml.core/src/org/eclipse/tracecompass/tmf/analysis/xml/core/module/TmfAnalysisModuleHelperXml.java +++ b/tmf/org.eclipse.tracecompass.tmf.analysis.xml.core/src/org/eclipse/tracecompass/tmf/analysis/xml/core/module/TmfAnalysisModuleHelperXml.java @@ -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 diff --git a/tmf/org.eclipse.tracecompass.tmf.analysis.xml.ui/src/org/eclipse/tracecompass/internal/tmf/analysis/xml/ui/views/xychart/XmlXYViewer.java b/tmf/org.eclipse.tracecompass.tmf.analysis.xml.ui/src/org/eclipse/tracecompass/internal/tmf/analysis/xml/ui/views/xychart/XmlXYViewer.java index b6db24e24b..d75767d829 100644 --- a/tmf/org.eclipse.tracecompass.tmf.analysis.xml.ui/src/org/eclipse/tracecompass/internal/tmf/analysis/xml/ui/views/xychart/XmlXYViewer.java +++ b/tmf/org.eclipse.tracecompass.tmf.analysis.xml.ui/src/org/eclipse/tracecompass/internal/tmf/analysis/xml/ui/views/xychart/XmlXYViewer.java @@ -188,7 +188,7 @@ public class XmlXYViewer extends TmfCommonXLineChartViewer { public List getQuarks() { /* Get the list of quarks to process with this path */ String[] paths = fPath.split(SPLIT_STRING); - List quarks = checkNotNull(Collections.singletonList(IXmlStateSystemContainer.ROOT_QUARK)); + List 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); diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/stubs/org/eclipse/tracecompass/tmf/tests/stubs/analysis/AnalysisModuleTestHelper.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/stubs/org/eclipse/tracecompass/tmf/tests/stubs/analysis/AnalysisModuleTestHelper.java index a466ef2232..31a2287598 100644 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/stubs/org/eclipse/tracecompass/tmf/tests/stubs/analysis/AnalysisModuleTestHelper.java +++ b/tmf/org.eclipse.tracecompass.tmf.core.tests/stubs/org/eclipse/tracecompass/tmf/tests/stubs/analysis/AnalysisModuleTestHelper.java @@ -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 diff --git a/tmf/org.eclipse.tracecompass.tmf.core.tests/stubs/org/eclipse/tracecompass/tmf/tests/stubs/trace/text/SyslogTrace.java b/tmf/org.eclipse.tracecompass.tmf.core.tests/stubs/org/eclipse/tracecompass/tmf/tests/stubs/trace/text/SyslogTrace.java index 967eab7ba5..68547d4bb0 100644 --- a/tmf/org.eclipse.tracecompass.tmf.core.tests/stubs/org/eclipse/tracecompass/tmf/tests/stubs/trace/text/SyslogTrace.java +++ b/tmf/org.eclipse.tracecompass.tmf.core.tests/stubs/org/eclipse/tracecompass/tmf/tests/stubs/trace/text/SyslogTrace.java @@ -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 { /** The event aspects */ public static final @NonNull Collection 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 diff --git a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/internal/tmf/core/analysis/TmfAnalysisModuleSourceConfigElement.java b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/internal/tmf/core/analysis/TmfAnalysisModuleSourceConfigElement.java index 5bde392e8c..13145d8fa9 100644 --- a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/internal/tmf/core/analysis/TmfAnalysisModuleSourceConfigElement.java +++ b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/internal/tmf/core/analysis/TmfAnalysisModuleSourceConfigElement.java @@ -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()]); } /** diff --git a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/internal/tmf/core/parsers/custom/CustomEventAspects.java b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/internal/tmf/core/parsers/custom/CustomEventAspects.java index 01fde9da63..a0b97dffae 100644 --- a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/internal/tmf/core/parsers/custom/CustomEventAspects.java +++ b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/internal/tmf/core/parsers/custom/CustomEventAspects.java @@ -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(); } } diff --git a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/analysis/TmfAbstractAnalysisModule.java b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/analysis/TmfAbstractAnalysisModule.java index 9d25fbaeae..6d0cc8346d 100644 --- a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/analysis/TmfAbstractAnalysisModule.java +++ b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/analysis/TmfAbstractAnalysisModule.java @@ -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 diff --git a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/analysis/TmfAnalysisManager.java b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/analysis/TmfAnalysisManager.java index 5fbd9fd0d7..6a8aa256db 100644 --- a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/analysis/TmfAnalysisManager.java +++ b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/analysis/TmfAnalysisManager.java @@ -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); } /** diff --git a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/event/TmfEventField.java b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/event/TmfEventField.java index 030cc9f832..1ad95b3a6b 100644 --- a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/event/TmfEventField.java +++ b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/event/TmfEventField.java @@ -72,11 +72,11 @@ public class TmfEventField implements ITmfEventField { fValue = value; if (fields == null) { - fFields = checkNotNull(ImmutableMap. of()); + fFields = ImmutableMap.of(); } else { ImmutableMap.Builder 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 getFieldNames() { - return checkNotNull(fFields.keySet()); + return fFields.keySet(); } @Override public final Collection getFields() { - return checkNotNull(fFields.values()); + return fFields.values(); } @Override diff --git a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/event/aspect/ITmfEventAspect.java b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/event/aspect/ITmfEventAspect.java index 3a4da29390..7fa0fe1942 100644 --- a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/event/aspect/ITmfEventAspect.java +++ b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/event/aspect/ITmfEventAspect.java @@ -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 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}. diff --git a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/parsers/custom/CustomTxtTraceDefinition.java b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/parsers/custom/CustomTxtTraceDefinition.java index 13a159feb2..087c5bd20c 100644 --- a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/parsers/custom/CustomTxtTraceDefinition.java +++ b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/parsers/custom/CustomTxtTraceDefinition.java @@ -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); } } diff --git a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/parsers/custom/CustomXmlTraceDefinition.java b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/parsers/custom/CustomXmlTraceDefinition.java index 47cc6faa55..19263f4ffd 100644 --- a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/parsers/custom/CustomXmlTraceDefinition.java +++ b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/parsers/custom/CustomXmlTraceDefinition.java @@ -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); } } diff --git a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/signal/TmfSelectionRangeUpdatedSignal.java b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/signal/TmfSelectionRangeUpdatedSignal.java index 5e1ccb2f3a..6210db8328 100644 --- a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/signal/TmfSelectionRangeUpdatedSignal.java +++ b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/signal/TmfSelectionRangeUpdatedSignal.java @@ -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(); } } diff --git a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/statesystem/AbstractTmfStateProvider.java b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/statesystem/AbstractTmfStateProvider.java index 1a82184c61..46dd6ceff4 100644 --- a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/statesystem/AbstractTmfStateProvider.java +++ b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/statesystem/AbstractTmfStateProvider.java @@ -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(); diff --git a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/statesystem/TmfStateSystemAnalysisModule.java b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/statesystem/TmfStateSystemAnalysisModule.java index fc7a41d540..94ebe76551 100644 --- a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/statesystem/TmfStateSystemAnalysisModule.java +++ b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/statesystem/TmfStateSystemAnalysisModule.java @@ -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: diff --git a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/TmfTrace.java b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/TmfTrace.java index e4440b9ac2..e941c2a156 100644 --- a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/TmfTrace.java +++ b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/TmfTrace.java @@ -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 diff --git a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/TmfTraceManager.java b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/TmfTraceManager.java index e82144403b..25eaffe282 100644 --- a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/TmfTraceManager.java +++ b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/TmfTraceManager.java @@ -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 getTraceSetWithExperiment(ITmfTrace trace) { if (trace == null) { - return checkNotNull(ImmutableSet. of()); + return ImmutableSet.of(); } if (trace instanceof TmfExperiment) { TmfExperiment exp = (TmfExperiment) trace; List traces = exp.getTraces(); Set 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); } /** diff --git a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/experiment/TmfExperimentUtils.java b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/experiment/TmfExperimentUtils.java index cbf2a81a3c..74b8d0ee80 100644 --- a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/experiment/TmfExperimentUtils.java +++ b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/trace/experiment/TmfExperimentUtils.java @@ -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 getAnalysisModuleOfClassForHost(TmfExperiment experiment, String hostId, Class moduleClass) { for (ITmfTrace trace : getTracesFromHost(experiment, hostId)) { - trace = checkNotNull(trace); for (T module : TmfTraceUtils.getAnalysisModulesOfClass(trace, moduleClass)) { return module; } diff --git a/tmf/org.eclipse.tracecompass.tmf.remote.core.tests/src/org/eclipse/tracecompass/tmf/remote/core/tests/shell/CommandShellTest.java b/tmf/org.eclipse.tracecompass.tmf.remote.core.tests/src/org/eclipse/tracecompass/tmf/remote/core/tests/shell/CommandShellTest.java index 03b2be25e8..d5e053cbea 100644 --- a/tmf/org.eclipse.tracecompass.tmf.remote.core.tests/src/org/eclipse/tracecompass/tmf/remote/core/tests/shell/CommandShellTest.java +++ b/tmf/org.eclipse.tracecompass.tmf.remote.core.tests/src/org/eclipse/tracecompass/tmf/remote/core/tests/shell/CommandShellTest.java @@ -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); } diff --git a/tmf/org.eclipse.tracecompass.tmf.remote.core/src/org/eclipse/tracecompass/internal/tmf/remote/core/shell/CommandInput.java b/tmf/org.eclipse.tracecompass.tmf.remote.core/src/org/eclipse/tracecompass/internal/tmf/remote/core/shell/CommandInput.java index 7902bb585b..fbcbc6b894 100644 --- a/tmf/org.eclipse.tracecompass.tmf.remote.core/src/org/eclipse/tracecompass/internal/tmf/remote/core/shell/CommandInput.java +++ b/tmf/org.eclipse.tracecompass.tmf.remote.core/src/org/eclipse/tracecompass/internal/tmf/remote/core/shell/CommandInput.java @@ -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 getInput() { - return checkNotNull(ImmutableList.copyOf(fInput)); + return ImmutableList.copyOf(fInput); } // ------------------------------------------------------------------------ diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/markers/LostEventsMarkerEventSource.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/markers/LostEventsMarkerEventSource.java index 61d9364b23..3b76a4821d 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/markers/LostEventsMarkerEventSource.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/markers/LostEventsMarkerEventSource.java @@ -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) { diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/project/operations/NewExperimentOperation.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/project/operations/NewExperimentOperation.java index 530d8db345..94edbaf4f3 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/project/operations/NewExperimentOperation.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/project/operations/NewExperimentOperation.java @@ -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); diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/project/operations/SelectTracesOperation.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/project/operations/SelectTracesOperation.java index c4c63ff0fa..8e8625e083 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/project/operations/SelectTracesOperation.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/project/operations/SelectTracesOperation.java @@ -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 fTraceElements; private final @Nullable List fResources; private final @Nullable Map 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)); diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/viewers/statistics/TmfStatisticsViewer.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/viewers/statistics/TmfStatisticsViewer.java index 8e261bd9d5..cf09bea21f 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/viewers/statistics/TmfStatisticsViewer.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/viewers/statistics/TmfStatisticsViewer.java @@ -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; } diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/editors/TmfEventsEditor.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/editors/TmfEventsEditor.java index 0a662bbd08..0ce8e12d15 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/editors/TmfEventsEditor.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/editors/TmfEventsEditor.java @@ -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(); } /** diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/editors/TmfTraceColumnManager.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/editors/TmfTraceColumnManager.java index 7970533c27..0bd505608b 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/editors/TmfTraceColumnManager.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/editors/TmfTraceColumnManager.java @@ -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$ /** diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/TmfEventsTable.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/TmfEventsTable.java index f393e04bd2..43f831eea4 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/TmfEventsTable.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/TmfEventsTable.java @@ -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(); } /** diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/xycharts/TmfClosestDataPointTooltipProvider.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/xycharts/TmfClosestDataPointTooltipProvider.java index c290f1629a..6e7bba9616 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/xycharts/TmfClosestDataPointTooltipProvider.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/xycharts/TmfClosestDataPointTooltipProvider.java @@ -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$ diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/timegraph/AbstractTimeGraphView.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/timegraph/AbstractTimeGraphView.java index d185edb99a..0f5aca1193 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/timegraph/AbstractTimeGraphView.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/timegraph/AbstractTimeGraphView.java @@ -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 getMarkerEventSources(ITmfTrace trace) { List markerEventSources = fMarkerEventSourcesMap.get(trace); if (markerEventSources == null) { - markerEventSources = checkNotNull(Collections.emptyList()); + markerEventSources = Collections.emptyList(); } return markerEventSources; } -- 2.34.1