* @return The list of vertices for the object
*/
public List<TmfVertex> getNodesOf(IGraphWorker obj) {
- return NonNullUtils.checkNotNull(fNodeMap.get(obj));
+ return fNodeMap.get(obj);
}
/**
* @return The vertex map
*/
public Set<IGraphWorker> getWorkers() {
- return NonNullUtils.checkNotNull(ImmutableSet.copyOf(fNodeMap.keySet()));
+ return ImmutableSet.copyOf(fNodeMap.keySet());
}
/**
HashSet<TmfVertex> visited = new HashSet<>();
stack.add(start);
while (!stack.isEmpty()) {
- TmfVertex curr = NonNullUtils.checkNotNull(stack.pop());
+ TmfVertex curr = stack.pop();
if (visited.contains(curr)) {
continue;
}
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
@Override
public String getID() {
- return NonNullUtils.checkNotNull(getClass().getName());
+ return getClass().getName();
}
@Override
public String getDisplayName() {
- return NonNullUtils.checkNotNull(getClass().getSimpleName());
+ return getClass().getSimpleName();
}
}
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);
}
for (TimeGraphEntry entry : list) {
- buildStatusEvents(trace, (CriticalPathEntry) NonNullUtils.checkNotNull(entry));
+ buildStatusEvents(trace, (CriticalPathEntry) entry);
}
workerEntries.put(worker, list);
}
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);
}
}
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;
execNameValue = interval.getStateValue();
switch (execNameValue.getType()) {
case STRING:
- execName = NonNullUtils.checkNotNull(execNameValue.unboxStr());
+ execName = execNameValue.unboxStr();
break;
case DOUBLE:
case LONG:
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;
Map<String, String> arguments) {
fStartTime = startTime;
fName = name;
- fArgs = NonNullUtils.checkNotNull(ImmutableMap.copyOf(arguments));
+ fArgs = ImmutableMap.copyOf(arguments);
}
}
private static final String DATA_FILENAME = "latency-analysis.dat"; //$NON-NLS-1$
private static final Collection<ISegmentAspect> BASE_ASPECTS =
- checkNotNull(ImmutableList.of(SyscallNameAspect.INSTANCE));
+ ImmutableList.of(SyscallNameAspect.INSTANCE);
@Override
public String getId() {
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;
}
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;
private static final String SCHED_WAKEUP = "sched_wakeup"; //$NON-NLS-1$
private static final String SCHED_WAKEUP_NEW = "sched_wakeup_new"; //$NON-NLS-1$
private static final Collection<String> SCHED_WAKEUP_EVENTS =
- checkNotNull(ImmutableList.of(SCHED_WAKEUP, SCHED_WAKEUP_NEW));
+ ImmutableList.of(SCHED_WAKEUP, SCHED_WAKEUP_NEW);
private static final String SCHED_PROCESS_FORK = "sched_process_fork"; //$NON-NLS-1$
private static final String SCHED_PROCESS_EXIT = "sched_process_exit"; //$NON-NLS-1$
builder.put(eventSchedWakeup, new SchedWakeupHandler(layout));
}
- return NonNullUtils.checkNotNull(builder.build());
+ return builder.build();
}
// ------------------------------------------------------------------------
*******************************************************************************/
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;
protected Iterable<IAnalysisModule> getDependentAnalyses() {
ITmfTrace trace = getTrace();
if (trace != null) {
- SystemCallLatencyAnalysis module = TmfTraceUtils.getAnalysisModuleOfClass(trace, SystemCallLatencyAnalysis.class, checkNotNull(SystemCallLatencyAnalysis.ID));
+ SystemCallLatencyAnalysis module = TmfTraceUtils.getAnalysisModuleOfClass(trace, SystemCallLatencyAnalysis.class, SystemCallLatencyAnalysis.ID);
if (module != null) {
fLatencyModule = module;
- return checkNotNull(ImmutableList.of((IAnalysisModule) module));
+ return ImmutableList.of((IAnalysisModule) module);
}
}
return super.getDependentAnalyses();
return false;
}
ISegment segment = iter.next();
- total.update(checkNotNull(segment));
+ total.update(segment);
}
fTotalStats = total;
return true;
for (ITmfTreeViewerEntry entry : rootEntry.getChildren()) {
if (entry instanceof CpuUsageEntry) {
if (selectedThread.equals(((CpuUsageEntry) entry).getTid())) {
- List<ITmfTreeViewerEntry> list = checkNotNull(Collections.singletonList(entry));
+ List<ITmfTreeViewerEntry> list = Collections.singletonList(entry);
super.setSelection(list);
return;
}
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
@Override
protected AbstractSegmentStoreDensityViewer createSegmentStoreDensityViewer(Composite parent) {
- return new SystemCallDensityViewer(NonNullUtils.checkNotNull(parent));
+ return new SystemCallDensityViewer(parent);
}
}
*******************************************************************************/
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;
@Override
protected AbstractSegmentStoreStatisticsViewer createSegmentStoreStatisticsViewer(Composite parent) {
- return checkNotNull((AbstractSegmentStoreStatisticsViewer) new SystemCallLatencyStatisticsViewer(checkNotNull(parent)));
+ return new SystemCallLatencyStatisticsViewer(parent);
}
}
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;
}
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;
} 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) {
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;
}
* @return statistics object
*/
public SegmentStoreStatistics getEntry() {
- return checkNotNull(fEntry);
+ return fEntry;
}
}
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;
private BtfEventAspects() {}
private static final Iterable<ITmfEventAspect> BTF_ASPECTS =
- NonNullUtils.checkNotNull(ImmutableList.of(
+ ImmutableList.of(
ITmfEventAspect.BaseAspects.TIMESTAMP,
new BtfSourceAspect(),
new TmfContentFieldAspect(BtfColumnNames.SOURCE_INSTANCE.toString(), BtfColumnNames.SOURCE_INSTANCE.toString()),
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()}
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;
* 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);
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;
/** Map of all the registered activators, indexed by plugin ID */
private static final Map<String, TraceCompassActivator> ACTIVATORS =
- checkNotNull(Collections.synchronizedMap(new HashMap<String, TraceCompassActivator>()));
+ Collections.synchronizedMap(new HashMap<String, TraceCompassActivator>());
/** This instance's plug-in ID */
private final String fPluginId;
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;
sb.append(c);
c = (char) input.get(BITS_PER_BYTE, false);
}
- return NonNullUtils.checkNotNull(sb.toString());
+ return sb.toString();
}
@Override
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;
}
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);
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;
}
definitions.add(fElemType.createDefinition(definitionScope, name, input));
}
- return checkNotNull(definitions.build());
+ return definitions.build();
}
@Override
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;
String fieldName,
List<Definition> definitions) {
super(declaration, definitionScope, fieldName);
- fDefinitions = checkNotNull(ImmutableList.copyOf(definitions));
+ fDefinitions = ImmutableList.copyOf(definitions);
}
// ------------------------------------------------------------------------
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
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;
byte fieldValue = fContent[i];
builder.add(new IntegerDefinition(charDecl, getDefinitionScope(), fieldName, fieldValue));
}
- fDefs = NonNullUtils.checkNotNull(builder.build());
+ fDefs = builder.build();
return fDefs;
}
b.append('[');
Joiner.on(", ").appendTo(b, Arrays.asList(fContent)); //$NON-NLS-1$
b.append(']');
- return checkNotNull(b.toString());
+ return b.toString();
}
/**
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);
}
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;
*/
@Override
public List<@Nullable IEventDeclaration> getEventDeclarations() {
- return NonNullUtils.checkNotNull(Collections.unmodifiableList(fEvents));
+ return Collections.unmodifiableList(fEvents);
}
@Override
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));
}
}
}
}
- return checkNotNull(fields.toArray(new @NonNull CtfTmfEventField[fields.size()]));
+ return fields.toArray(new @NonNull CtfTmfEventField[fields.size()]);
}
// ------------------------------------------------------------------------
List<ITmfEventField> list = new ArrayList<>();
/* Recursively parse the fields */
- for (String curFieldName : strDef.getFieldNames()) {
- String fn = checkNotNull(curFieldName);
+ for (String fn : strDef.getFieldNames()) {
list.add(CtfTmfEventField.parseField((IDefinition) strDef.getDefinition(fn), fn));
}
field = new CTFStructField(fieldName, list.toArray(new CtfTmfEventField[list.size()]));
* @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
*******************************************************************************/
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;
/* 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);
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;
private GdbEventAspects() {}
private static final @NonNull Iterable<ITmfEventAspect> GDB_ASPECTS =
- checkNotNull(ImmutableList.of(
+ ImmutableList.of(
new TmfContentFieldAspect(GdbTraceEventContent.TRACE_FRAME, GdbTraceEventContent.TRACE_FRAME),
new TmfContentFieldAspect(GdbTraceEventContent.TRACEPOINT, GdbTraceEventContent.TRACEPOINT),
new GdbFileAspect(),
ITmfEventAspect.BaseAspects.CONTENTS
- ));
+ );
private static class GdbFileAspect implements ITmfEventAspect {
// 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)) {
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;
traces.add(tmfTrace);
}
}
- String expName = checkNotNull(this.name());
+ String expName = name();
VirtualMachineExperiment experiment = new VirtualMachineExperiment(expName, traces);
if (deleteSuppFiles) {
/*
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;
* 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();
* @return the graph provider
*/
public LttngKernelExecGraphProvider getProvider() {
- return NonNullUtils.checkNotNull(fProvider);
+ return fProvider;
}
/**
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;
* @return The list of workers on the system
*/
public Collection<LttngWorker> getWorkers() {
- return NonNullUtils.checkNotNull(fWorkerMap.values());
+ return fWorkerMap.values();
}
/**
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;
private final TmfExperiment fExperiment;
- static final ImmutableSet<String> REQUIRED_EVENTS = NonNullUtils.checkNotNull(ImmutableSet.of(
+ static final ImmutableSet<String> REQUIRED_EVENTS = ImmutableSet.of(
QemuKvmStrings.KVM_ENTRY,
QemuKvmStrings.KVM_EXIT,
QemuKvmStrings.VMSYNC_GH_GUEST,
QemuKvmStrings.VMSYNC_GH_HOST,
QemuKvmStrings.VMSYNC_HG_GUEST,
QemuKvmStrings.VMSYNC_HG_HOST
- ));
+ );
/**
* Constructor
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;
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;
public static final String ID = "org.eclipse.tracecompass.lttng2.analysis.vm.core.VirtualMachineAnalysisModule"; //$NON-NLS-1$
// TODO: Update with event layout when requirements are back */
- static final Set<String> REQUIRED_EVENTS = NonNullUtils.checkNotNull(ImmutableSet.of(
+ static final Set<String> REQUIRED_EVENTS = ImmutableSet.of(
// LttngStrings.SCHED_SWITCH
- ));
+ );
/* State value for a preempted virtual CPU */
private static final ITmfStateValue VCPU_PREEMPT_VALUE = TmfStateValue.newValueInt(VcpuStateValues.VCPU_PREEMPT);
Set<IAnalysisModule> modules = new HashSet<>();
/* Depends on the LTTng Kernel analysis modules */
for (ITmfTrace trace : TmfTraceManager.getTraceSet(getTrace())) {
- trace = checkNotNull(trace);
for (KernelAnalysisModule module : TmfTraceUtils.getAnalysisModulesOfClass(trace, KernelAnalysisModule.class)) {
modules.add(module);
}
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;
}
} catch (AttributeNotFoundException | StateSystemDisposedException e) {
}
- return NonNullUtils.checkNotNull(map);
+ return map;
}
}
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;
private static final String SCHED_WAKEUP = "sched_wakeup";
private static final String SCHED_WAKEUP_NEW = "sched_wakeup_new";
private static final Collection<String> SCHED_WAKEUP_EVENTS =
- checkNotNull(ImmutableList.of(SCHED_WAKEUP, SCHED_WAKEUP_NEW));
+ ImmutableList.of(SCHED_WAKEUP, SCHED_WAKEUP_NEW);
private static final String SCHED_PROCESS_FORK = "sched_process_fork";
private static final String SCHED_PROCESS_EXIT = "sched_process_exit";
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;
}
private static final Collection<String> WAKEUP_EVENTS =
- checkNotNull(ImmutableList.of("sched:sched_wakeup", "sched:sched_wakeup_new")); //$NON-NLS-1$ //$NON-NLS-2$
+ ImmutableList.of("sched:sched_wakeup", "sched:sched_wakeup_new"); //$NON-NLS-1$ //$NON-NLS-2$
@Override
public Collection<String> eventsSchedWakeup() {
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;
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();
}
/**
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;
/* 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;
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) {
* 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();
@Override
protected Iterable<ITmfTrace> getTracesToBuild(@Nullable ITmfTrace trace) {
if (trace == null) {
- return NonNullUtils.checkNotNull(Collections.EMPTY_SET);
+ return Collections.EMPTY_SET;
}
- return NonNullUtils.checkNotNull(Collections.singleton(trace));
+ return Collections.singleton(trace);
}
}
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;
List<TmfCallsite> callsites = new LinkedList<>();
// FIXME Could eventually use CDT's Addr2line class once it imlements --inlines
- List<String> output = getOutputFromCommand(checkNotNull(Arrays.asList(
- ADDR2LINE_EXECUTABLE, "-i", "-e", file.toString(), "0x" + Long.toHexString(offset)))); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
+ List<String> output = getOutputFromCommand(Arrays.asList(
+ ADDR2LINE_EXECUTABLE, "-i", "-e", file.toString(), "0x" + Long.toHexString(offset))); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
if (output == null) {
/* Command returned an error */
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
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
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;
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());
}
// ------------------------------------------------------------------------
/* Get the most probable base address from all the known ones */
NavigableSet<Long> possibleBaddrs = possibleBaddrQuarks.stream()
.map(quark -> {
- String baddrStr = ss.getAttributeName(checkNotNull(quark).intValue());
+ String baddrStr = ss.getAttributeName(quark.intValue());
return checkNotNull(Long.valueOf(baddrStr));
})
.collect(Collectors.toCollection(TreeSet::new));
List<Integer> buildIds = ss.getSubAttributes(baddrQuark, false);
Optional<Integer> potentialBuildIdQuark = buildIds.stream()
.filter(id -> {
- int quark = checkNotNull(id).intValue();
+ int quark = id.intValue();
ITmfStateValue value = fullState.get(quark).getStateValue();
return (!value.isNull());
})
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
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;
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;
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;
builder.put("Options", ConversionHelper.bytesToHex(options, true)); //$NON-NLS-1$
}
- fFields = checkNotNull(builder.build());
+ fFields = builder.build();
return fFields;
}
return map;
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;
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;
public String toString() {
ProtocolEndpoint endpoint = getParentEndpoint();
if (endpoint == null) {
- return checkNotNull(String.valueOf(fPort));
+ return String.valueOf(fPort);
}
return endpoint.toString() + '/' + fPort;
}
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;
builder.put("Options", ConversionHelper.bytesToHex(options, true)); //$NON-NLS-1$
}
- fFields = checkNotNull(builder.build());
+ fFields = builder.build();
return fFields;
}
return map;
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;
public String toString() {
ProtocolEndpoint endpoint = getParentEndpoint();
if (endpoint == null) {
- return checkNotNull(String.valueOf(fPort));
+ return String.valueOf(fPort);
}
return endpoint.toString() + '/' + fPort;
}
.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;
} 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;
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;
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();
}
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:
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;
}
}
- fProtocols = checkNotNull(builder.build());
+ fProtocols = builder.build();
return fProtocols;
}
public static final String TRACE_TYPE_ID = "org.eclipse.linuxtools.tmf.pcap.core.pcaptrace"; //$NON-NLS-1$
private static final Collection<ITmfEventAspect> PCAP_ASPECTS =
- checkNotNull(ImmutableList.of(
+ ImmutableList.of(
ITmfEventAspect.BaseAspects.TIMESTAMP,
PcapSourceAspect.INSTANCE,
PcapDestinationAspect.INSTANCE,
PcapReferenceAspect.INSTANCE,
PcapProtocolAspect.INSTANCE,
ITmfEventAspect.BaseAspects.CONTENTS
- ));
+ );
private static final String EMPTY_STRING = ""; //$NON-NLS-1$
private static final int CONFIDENCE = 50;
while (localPacket != null) {
subfieldList.clear();
for (Map.Entry<String, String> entry : localPacket.getFields().entrySet()) {
- String key = checkNotNull(entry.getKey());
+ String key = entry.getKey();
String value = entry.getValue();
subfieldList.add(new TmfEventField(key, value, null));
}
try {
Iterable<E> lastSnapshot = fLastSnapshot;
if (lastSnapshot == null) {
- lastSnapshot = checkNotNull(ImmutableList.copyOf(fStartTimesIndex.values()));
+ lastSnapshot = ImmutableList.copyOf(fStartTimesIndex.values());
fLastSnapshot = lastSnapshot;
}
return checkNotNull(lastSnapshot.iterator());
*/
public HTNode getLatestLeaf() {
List<HTNode> latest = getLatestBranch();
- return checkNotNull(Iterables.getLast(latest));
+ return Iterables.getLast(latest);
}
/**
*/
public HTNode getNodeAt(int pos) {
List<HTNode> latest = getLatestBranch();
- return checkNotNull(latest.get(pos));
+ return latest.get(pos);
}
/**
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;
/*
* 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);
}
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;
* 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
public List<Integer> getQuarks() {
/* Get the list of quarks to process with this path */
String[] paths = fPath.split(SPLIT_STRING);
- List<Integer> quarks = checkNotNull(Collections.singletonList(IXmlStateSystemContainer.ROOT_QUARK));
+ List<Integer> quarks = Collections.singletonList(IXmlStateSystemContainer.ROOT_QUARK);
try {
for (String path : paths) {
}
} else {
for (String moduleId : analysisIds) {
- moduleId = checkNotNull(moduleId);
ITmfAnalysisModuleWithStateSystems module = TmfTraceUtils.getAnalysisModuleOfClass(trace, ITmfAnalysisModuleWithStateSystems.class, moduleId);
if (module != null) {
stateSystemModules.add(module);
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;
@Override
public String getName() {
- return checkNotNull(fModule.name());
+ return fModule.name();
}
@Override
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;
/** The event aspects */
public static final @NonNull Collection<ITmfEventAspect> ASPECTS =
- checkNotNull(ImmutableList.of(
+ ImmutableList.of(
ITmfEventAspect.BaseAspects.TIMESTAMP,
new TmfContentFieldAspect(Field.HOST, Field.HOST),
new TmfContentFieldAspect(Field.LOGGER, Field.LOGGER),
new TmfContentFieldAspect(Field.FILE, Field.FILE),
new TmfContentFieldAspect(Field.LINE, Field.LINE),
new TmfContentFieldAspect(Field.MESSAGE, Field.MESSAGE)
- ));
+ );
/**
* Constructor
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;
typeElements.add(element);
}
}
- return checkNotNull(typeElements.toArray(new @NonNull IConfigurationElement[typeElements.size()]));
+ return typeElements.toArray(new @NonNull IConfigurationElement[typeElements.size()]);
}
/**
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;
String name = outputs.get(i).name;
builder.add(new CustomEventFieldAspect(name, i));
}
- return checkNotNull(builder.build());
+ return builder.build();
}
}
* 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;
}
execute(trace);
}
- return checkNotNull(Status.OK_STATUS);
+ return Status.OK_STATUS;
}
@Override
}
}
}
- return checkNotNull(builder.toString());
+ return builder.toString();
}
@Override
map.put(module.getId(), module);
}
}
- return checkNotNull(ImmutableMap.copyOf(map));
+ return ImmutableMap.copyOf(map);
}
/**
}
}
}
- return NonNullUtils.checkNotNull(Collections.unmodifiableSet(providerSet));
+ return Collections.unmodifiableSet(providerSet);
}
/**
fValue = value;
if (fields == null) {
- fFields = checkNotNull(ImmutableMap.<String, ITmfEventField> of());
+ fFields = ImmutableMap.of();
} else {
ImmutableMap.Builder<String, ITmfEventField> mapBuilder = new ImmutableMap.Builder<>();
Arrays.stream(fields).forEach(t -> mapBuilder.put(t.getName(), t));
- fFields = checkNotNull(mapBuilder.build());
+ fFields = mapBuilder.build();
}
}
@Override
public final Collection<String> getFieldNames() {
- return checkNotNull(fFields.keySet());
+ return fFields.keySet();
}
@Override
public final Collection<ITmfEventField> getFields() {
- return checkNotNull(fFields.values());
+ return fFields.values();
}
@Override
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;
* List of all common base aspects
*/
public static final List<ITmfEventAspect> BASE_ASPECTS =
- checkNotNull(ImmutableList.of(
+ ImmutableList.of(
BaseAspects.TIMESTAMP,
BaseAspects.EVENT_TYPE,
BaseAspects.CONTENTS,
BaseAspects.TRACE_NAME
- ));
+ );
/**
* Some basic aspects that all trace types should be able to use, using
* methods found in {@link ITmfEvent}.
} 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);
}
}
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;
} 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);
}
}
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;
sb.append(fEndTime.toString());
}
sb.append("]"); //$NON-NLS-1$
- return checkNotNull(sb.toString());
+ return sb.toString();
}
}
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;
* 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();
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;
ITmfEventRequest.ALL_DATA,
ITmfEventRequest.ExecutionType.BACKGROUND);
this.sci = sp;
-
- // sci.getTrace() will eventually return a @NonNull
- trace = checkNotNull(sci.getTrace());
+ trace = sci.getTrace();
}
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:
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;
* 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
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;
*/
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);
}
/**
*/
public static @NonNull Collection<ITmfTrace> getTraceSetWithExperiment(ITmfTrace trace) {
if (trace == null) {
- return checkNotNull(ImmutableSet.<ITmfTrace> of());
+ return ImmutableSet.of();
}
if (trace instanceof TmfExperiment) {
TmfExperiment exp = (TmfExperiment) trace;
List<ITmfTrace> traces = exp.getTraces();
Set<ITmfTrace> alltraces = new LinkedHashSet<>(traces);
alltraces.add(exp);
- return NonNullUtils.checkNotNull(ImmutableSet.copyOf(alltraces));
+ return ImmutableSet.copyOf(alltraces);
}
- return checkNotNull(Collections.singleton(trace));
+ return Collections.singleton(trace);
}
/**
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;
*/
public static @Nullable <T extends IAnalysisModule> T getAnalysisModuleOfClassForHost(TmfExperiment experiment, String hostId, Class<T> moduleClass) {
for (ITmfTrace trace : getTracesFromHost(experiment, hostId)) {
- trace = checkNotNull(trace);
for (T module : TmfTraceUtils.getAnalysisModulesOfClass(trace, moduleClass)) {
return module;
}
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());
}
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);
}
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);
}
**********************************************************************/
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;
@Override
public List<String> getInput() {
- return checkNotNull(ImmutableList.copyOf(fInput));
+ return ImmutableList.copyOf(fInput);
}
// ------------------------------------------------------------------------
if (module == null) {
return null;
}
- return module.getStateSystem(checkNotNull(TmfStatisticsEventTypesModule.ID));
+ return module.getStateSystem(TmfStatisticsEventTypesModule.ID);
}
private static int getLostEventsQuark(ITmfStateSystem ss) {
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;
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
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);
*******************************************************************************/
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;
private final @Nullable List<TmfTraceElement> fTraceElements;
private final @Nullable List<IResource> fResources;
private final @Nullable Map<String, TmfTraceElement> fPreviousTraces;
- private @NonNull IStatus fStatus = checkNotNull(Status.OK_STATUS);
+ private @NonNull IStatus fStatus = Status.OK_STATUS;
/**
* Constructor
});
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));
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;
}
for (ITmfTrace aTrace : TmfTraceManager.getTraceSet(trace)) {
- aTrace = checkNotNull(aTrace);
if (!isListeningTo(aTrace)) {
continue;
}
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;
builder.addAll(traceAspects);
}
}
- return checkNotNull(builder.build());
+ return builder.build();
}
/**
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;
*/
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$
/**
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;
builder.add(new TmfContentFieldAspect(fieldName, fieldName));
}
}
- return checkNotNull(builder.build());
+ return builder.build();
}
/**
**********************************************************************/
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;
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$
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;
private @NonNull List<IMarkerEventSource> getMarkerEventSources(ITmfTrace trace) {
List<IMarkerEventSource> markerEventSources = fMarkerEventSourcesMap.get(trace);
if (markerEventSources == null) {
- markerEventSources = checkNotNull(Collections.<IMarkerEventSource>emptyList());
+ markerEventSources = Collections.emptyList();
}
return markerEventSources;
}