common: Annotate HashBasedTable.create()
authorAlexandre Montplaisir <alexmonthy@efficios.com>
Wed, 9 Mar 2016 23:02:28 +0000 (18:02 -0500)
committerAlexandre Montplaisir <alexmonthy@efficios.com>
Fri, 11 Mar 2016 17:32:13 +0000 (12:32 -0500)
All variants of this method return a new table, so it can be
annotated @NonNull.

Remove now-unnecessary checkNotNull() checks where this was called.

Change-Id: I6aca62e89b0fba51fd2b0ad047ae4582b7807ecb
Signed-off-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Reviewed-on: https://git.eclipse.org/r/68105
Reviewed-by: Hudson CI
analysis/org.eclipse.tracecompass.analysis.graph.ui/src/org/eclipse/tracecompass/internal/analysis/graph/ui/criticalpath/view/CriticalPathView.java
common/org.eclipse.tracecompass.common.core/annotations/com/google/common/collect/HashBasedTable.eea [new file with mode: 0644]
lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/analysis/graph/handlers/TraceEventHandlerExecutionGraph.java
lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/analysis/graph/model/LttngSystemModel.java
lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/analysis/vm/model/VirtualCPU.java
lttng/org.eclipse.tracecompass.lttng2.kernel.core/src/org/eclipse/tracecompass/internal/lttng2/kernel/core/analysis/vm/module/VirtualMachineStateProvider.java

index 8af721017e92798df8b7f13c4f325b3bdf02e5e4..2ceed26e2adc2429e4dd5e5ee5ca83d20e2669bd 100644 (file)
@@ -82,9 +82,9 @@ public class CriticalPathView extends AbstractTimeGraphView {
             COLUMN_PROCESS
     };
 
-    private final Table<ITmfTrace, Object, List<ILinkEvent>> fLinks = NonNullUtils.checkNotNull(HashBasedTable.create());
+    private final Table<ITmfTrace, Object, List<ILinkEvent>> fLinks = HashBasedTable.create();
     /** The trace to entry list hash map */
-    private final Table<ITmfTrace, Object, TmfGraphStatistics> fObjectStatistics = NonNullUtils.checkNotNull(HashBasedTable.create());
+    private final Table<ITmfTrace, Object, TmfGraphStatistics> fObjectStatistics = HashBasedTable.create();
 
     private final CriticalPathContentProvider fContentProvider = new CriticalPathContentProvider();
 
diff --git a/common/org.eclipse.tracecompass.common.core/annotations/com/google/common/collect/HashBasedTable.eea b/common/org.eclipse.tracecompass.common.core/annotations/com/google/common/collect/HashBasedTable.eea
new file mode 100644 (file)
index 0000000..60ed4ac
--- /dev/null
@@ -0,0 +1,10 @@
+class com/google/common/collect/HashBasedTable
+create
+ <R:Ljava/lang/Object;C:Ljava/lang/Object;V:Ljava/lang/Object;>()Lcom/google/common/collect/HashBasedTable<TR;TC;TV;>;
+ <R:Ljava/lang/Object;C:Ljava/lang/Object;V:Ljava/lang/Object;>()L1com/google/common/collect/HashBasedTable<TR;TC;TV;>;
+create
+ <R:Ljava/lang/Object;C:Ljava/lang/Object;V:Ljava/lang/Object;>(II)Lcom/google/common/collect/HashBasedTable<TR;TC;TV;>;
+ <R:Ljava/lang/Object;C:Ljava/lang/Object;V:Ljava/lang/Object;>(II)L1com/google/common/collect/HashBasedTable<TR;TC;TV;>;
+create
+ <R:Ljava/lang/Object;C:Ljava/lang/Object;V:Ljava/lang/Object;>(Lcom/google/common/collect/Table<+TR;+TC;+TV;>;)Lcom/google/common/collect/HashBasedTable<TR;TC;TV;>;
+ <R:Ljava/lang/Object;C:Ljava/lang/Object;V:Ljava/lang/Object;>(Lcom/google/common/collect/Table<+TR;+TC;+TV;>;)L1com/google/common/collect/HashBasedTable<TR;TC;TV;>;
index d72c238ff81e2cfce3b77ded4327c7d0bffbe36d..bdf8b8d802c20c334579b6d36452a98dc6eb08e6 100644 (file)
@@ -74,7 +74,7 @@ public class TraceEventHandlerExecutionGraph extends BaseHandler {
      */
     public TraceEventHandlerExecutionGraph(LttngKernelExecGraphProvider provider) {
         super(provider);
-        fKernel = NonNullUtils.checkNotNull(HashBasedTable.create());
+        fKernel = HashBasedTable.create();
 
         fTcpNodes = new HashMap<>();
         fMatchProcessing = new IMatchProcessingUnit() {
index 5bb46fe9d6cde3b3c55a24dc846d9fd572608c5b..6d553fa934dea016fb684a4a2a5862a4ec997f35 100644 (file)
@@ -34,8 +34,8 @@ import com.google.common.collect.Table;
  */
 public class LttngSystemModel {
 
-    private final Table<String, Integer, HostThread> fCurrentTids = NonNullUtils.checkNotNull(HashBasedTable.create());
-    private final Table<String, Integer, Stack<LttngInterruptContext>> fIntCtxStacks = NonNullUtils.checkNotNull(HashBasedTable.create());
+    private final Table<String, Integer, HostThread> fCurrentTids = HashBasedTable.create();
+    private final Table<String, Integer, Stack<LttngInterruptContext>> fIntCtxStacks = HashBasedTable.create();
     private final Map<HostThread, LttngWorker> fWorkerMap = new HashMap<>();
 
     /**
index 2e2a3be3a6daa644037e67b2c4bf6c069f6513c5..7f7922c601cdf29bd5a046d00b64f0b9590a2ca0 100644 (file)
@@ -13,7 +13,6 @@
 package org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.model;
 
 import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.tracecompass.common.core.NonNullUtils;
 
 import com.google.common.collect.HashBasedTable;
 import com.google.common.collect.Table;
@@ -26,7 +25,7 @@ import com.google.common.collect.Table;
  */
 public class VirtualCPU {
 
-    private static final Table<VirtualMachine, Long, @Nullable VirtualCPU> VIRTUAL_CPU_TABLE = NonNullUtils.checkNotNull(HashBasedTable.create());
+    private static final Table<VirtualMachine, Long, @Nullable VirtualCPU> VIRTUAL_CPU_TABLE = HashBasedTable.create();
 
     private final VirtualMachine fVm;
     private final Long fCpuId;
index 5652bca0c6a44dd83e1580ca59f50233fab43b56..b398f8b588ecdfc51e022b6d3db7d1c35ebc6010 100644 (file)
@@ -22,7 +22,6 @@ import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelAnal
 import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.KernelThreadInformationProvider;
 import org.eclipse.tracecompass.analysis.os.linux.core.model.HostThread;
 import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelAnalysisEventLayout;
-import org.eclipse.tracecompass.common.core.NonNullUtils;
 import org.eclipse.tracecompass.internal.lttng2.kernel.core.Activator;
 import org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.VcpuStateValues;
 import org.eclipse.tracecompass.internal.lttng2.kernel.core.analysis.vm.VmAttributes;
@@ -100,7 +99,7 @@ public class VirtualMachineStateProvider extends AbstractTmfStateProvider {
         super(experiment, "Virtual Machine State Provider"); //$NON-NLS-1$
 
         fModel = new QemuKvmVmModel(experiment);
-        Table<ITmfTrace, String, @Nullable Integer> table = NonNullUtils.checkNotNull(HashBasedTable.create());
+        Table<ITmfTrace, String, @Nullable Integer> table = HashBasedTable.create();
         fEventNames = table;
         fLayouts = new HashMap<>();
     }
This page took 0.028777 seconds and 5 git commands to generate.