return (entries == null) ?
new ITimeGraphEntry[0] :
- NonNullUtils.checkNotNull(entries.toArray(new ITimeGraphEntry[entries.size()]));
+ entries.toArray(new @NonNull ITimeGraphEntry[entries.size()]);
}
private void buildEntryList(IGraphWorker worker) {
--- /dev/null
+class com/google/common/collect/Multimap
+get
+ (TK;)Ljava/util/Collection<TV;>;
+ (TK;)L1java/util/Collection<TV;>;
+keySet
+ ()Ljava/util/Set<TK;>;
+ ()L1java/util/Set<TK;>;
+values
+ ()Ljava/util/Collection<TV;>;
+ ()L1java/util/Collection<TV;>;
--- /dev/null
+class org/eclipse/core/resources/IMarkerDelta
+getMarker
+ ()Lorg/eclipse/core/resources/IMarker;
+ ()L1org/eclipse/core/resources/IMarker;
List<Definition> fieldValues = new ArrayList<>();
/* Add fields from the stream */
- List<String> fieldNames = fStreamContext.getFieldNames();
+ List<@NonNull String> fieldNames = fStreamContext.getFieldNames();
for (String fieldName : fieldNames) {
Definition definition = fStreamContext.getDefinition(fieldName);
mergedDeclaration.addField(fieldName, definition.getDeclaration());
import java.util.List;
+import org.eclipse.jdt.annotation.NonNull;
+
/**
* Interface for data definitions containing heterogenous definitions
* (subfields)
*
* @return the field names array
*/
- List<String> getFieldNames();
+ List<@NonNull String> getFieldNames();
}
// ------------------------------------------------------------------------
/** linked list of field names. So fieldName->fieldValue */
- private final @NonNull Map<String, IDeclaration> fFieldMap = new LinkedHashMap<>();
+ private final @NonNull Map<@NonNull String, IDeclaration> fFieldMap = new LinkedHashMap<>();
/** maximum bit alignment */
private long fMaxAlign;
*
* @return the field list.
*/
- public Iterable<String> getFieldsList() {
+ public @NonNull Iterable<@NonNull String> getFieldsList() {
return fFieldMap.keySet();
}
* @param declaration
* the declaration of the field
*/
- public void addField(String name, IDeclaration declaration) {
+ public void addField(@NonNull String name, IDeclaration declaration) {
fFieldMap.put(name, declaration);
fMaxAlign = Math.max(fMaxAlign, declaration.getAlignment());
}
// Attributes
// ------------------------------------------------------------------------
- private final @NonNull List<String> fFieldNames;
+ private final @NonNull List<@NonNull String> fFieldNames;
private final Definition[] fDefinitions;
private Map<String, Definition> fDefinitionsMap = null;
* @since 1.0
*/
public StructDefinition(@NonNull StructDeclaration declaration,
- IDefinitionScope definitionScope, @NonNull ILexicalScope scope,
- @NonNull String structFieldName, @NonNull Iterable<String> fieldNames, Definition[] definitions) {
+ IDefinitionScope definitionScope,
+ @NonNull ILexicalScope scope,
+ @NonNull String structFieldName,
+ @NonNull Iterable<@NonNull String> fieldNames,
+ Definition[] definitions) {
super(declaration, definitionScope, structFieldName, scope);
fFieldNames = ImmutableList.copyOf(fieldNames);
fDefinitions = definitions;
}
@Override
- public @NonNull List<String> getFieldNames() {
+ public @NonNull List<@NonNull String> getFieldNames() {
return fFieldNames;
}
return flatStruct;
}
- private static void depthFirstAdd(String path, StructDeclaration flatStruct, IDeclaration dec) {
+ private static void depthFirstAdd(@NonNull String path, StructDeclaration flatStruct, IDeclaration dec) {
if (dec instanceof ISimpleDatatypeDeclaration) {
flatStruct.addField(path, dec);
} else if (dec instanceof ArrayDeclaration) {
*/
public final class EventHeaderDefinition extends Definition implements ICompositeDefinition {
- private static final @NonNull List<String> FIELD_NAMES = ImmutableList.of(
+ private static final @NonNull List<@NonNull String> FIELD_NAMES = ImmutableList.of(
IEventHeaderDeclaration.ID,
IEventHeaderDeclaration.TIMESTAMP
);
}
@Override
- public @NonNull List<String> getFieldNames() {
+ public @NonNull List<@NonNull String> getFieldNames() {
return FIELD_NAMES;
}
-}
\ No newline at end of file
+}
public class CtfTmfEventFieldTest {
private static final @NonNull String ROOT = "root";
- private static final String SEQ = "seq";
+ private static final @NonNull String SEQ = "seq";
private static final @NonNull String ARRAY_STR = "array_str";
private static final @NonNull String ARRAY_FLOAT = "array_float";
private static final @NonNull String ARRAY_INT = "array_int";
private static final @NonNull String ARRAY_STRUCT = "array_struct";
private static final @NonNull String ARRAY_VARIANT = "array_variant";
private static final @NonNull String ARRAY_ENUM = "array_enum";
- private static final String STR = "str";
- private static final String FLOAT = "float";
- private static final String LEN = "len";
- private static final String INT = "int";
+ private static final @NonNull String STR = "str";
+ private static final @NonNull String FLOAT = "float";
+ private static final @NonNull String LEN = "len";
+ private static final @NonNull String INT = "int";
private static final @NonNull String NAME = "test";
- private static final String STRUCT = "struct";
- private static final String VARIANT = "variant";
- private static final String ENUM = "enum";
+ private static final @NonNull String STRUCT = "struct";
+ private static final @NonNull String VARIANT = "variant";
+ private static final @NonNull String ENUM = "enum";
private static final byte TEST_NUMBER = 2;
- private static final String TEST_STRING = "two";
+ private static final @NonNull String TEST_STRING = "two";
private static final int ARRAY_SIZE = 2;
import java.util.List;
import java.util.Set;
+import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.tracecompass.ctf.core.event.EventDefinition;
}
}
- return checkNotNull(fields.toArray(new CtfTmfEventField[fields.size()]));
+ return checkNotNull(fields.toArray(new @NonNull CtfTmfEventField[fields.size()]));
}
// ------------------------------------------------------------------------
@Override
public boolean isEnabled() {
@NonNull ArrayList<@NonNull BaseEventComponent> events = new ArrayList<>();
- TraceSessionComponent[] sessions = null;
+ @NonNull TraceSessionComponent[] sessions = null;
Boolean isKernel = null;
// Get workbench page for the Control View
/**
* The list of available sessions.
*/
- private final TraceSessionComponent[] fSessions;
+ private final @NonNull TraceSessionComponent[] fSessions;
/**
* Flag for indicating Kernel or UST.
* @param events - a lists of events to enable
* @param isKernel - domain (true for kernel or UST)
*/
- public Parameter(TraceSessionComponent[] sessions, List<BaseEventComponent> events, boolean isKernel) {
+ public Parameter(@NonNull TraceSessionComponent[] sessions, List<BaseEventComponent> events, boolean isKernel) {
fSessions = NonNullUtils.checkNotNull(Arrays.copyOf(sessions, sessions.length));
fEvents = new ArrayList<>();
fEvents.addAll(events);
/**
* @return all available sessions.
*/
- public TraceSessionComponent[] getSessions() {
+ public @NonNull TraceSessionComponent[] getSessions() {
List<ITraceControlComponent> compenents = getChildren(TraceSessionGroup.class);
if (compenents.size() > 0) {
TraceSessionGroup group = (TraceSessionGroup)compenents.get(0);
List<ITraceControlComponent> sessions = group.getChildren(TraceSessionComponent.class);
- return sessions.toArray(new TraceSessionComponent[sessions.size()]);
+ return sessions.toArray(new @NonNull TraceSessionComponent[sessions.size()]);
}
return new TraceSessionComponent[0];
}
import java.io.File;
import java.io.IOException;
+import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.tracecompass.internal.statesystem.core.backend.historytree.HTConfig;
import org.eclipse.tracecompass.internal.statesystem.core.backend.historytree.HTInterval;
import org.eclipse.tracecompass.internal.statesystem.core.backend.historytree.HTNode;
/* String with 23 characters, interval in file will be 25 bytes long */
private static final String TEST_STRING = "abcdefghifklmnopqrstuvw";
- private static final TmfStateValue STRING_VALUE = TmfStateValue.newValueString(TEST_STRING);
- private static final TmfStateValue LONG_VALUE = TmfStateValue.newValueLong(10L);
- private static final TmfStateValue INT_VALUE = TmfStateValue.newValueInt(1);
+ private static final @NonNull TmfStateValue STRING_VALUE = TmfStateValue.newValueString(TEST_STRING);
+ private static final @NonNull TmfStateValue LONG_VALUE = TmfStateValue.newValueLong(10L);
+ private static final @NonNull TmfStateValue INT_VALUE = TmfStateValue.newValueInt(1);
private File fTempFile;
return ht;
}
- private static long fillValues(HistoryTree ht, TmfStateValue value, int nbValues, long start) {
+ private static long fillValues(HistoryTree ht, @NonNull TmfStateValue value, int nbValues, long start) {
for (int i = 0; i < nbValues; i++) {
ht.insertInterval(new HTInterval(start + i, start + i + 1, 1, value));
}
curNode = curNode.parent;
}
- return checkNotNull(list.toArray(new String[0]));
+ return list.toArray(new String[0]);
}
/**
private int fNodeCount;
/** "Cache" to keep the active nodes in memory */
- private final List<@NonNull HTNode> fLatestBranch;
+ private final @NonNull List<@NonNull HTNode> fLatestBranch;
// ------------------------------------------------------------------------
// Constructors/"Destructors"
* start
* @throws ClosedChannelException
*/
- private List<@NonNull HTNode> buildLatestBranch(int rootNodeSeqNb) throws ClosedChannelException {
+ private @NonNull List<@NonNull HTNode> buildLatestBranch(int rootNodeSeqNb) throws ClosedChannelException {
List<@NonNull HTNode> list = new ArrayList<>();
HTNode nextChildNode = fTreeIO.readNode(rootNodeSeqNb);
public void testListForTraces() {
/* Generic TmfTrace */
ITmfTrace trace = TmfTestTrace.A_TEST_10K.getTrace();
- Class<? extends ITmfTrace> traceClass = trace.getClass();
+ Class<@NonNull ? extends ITmfTrace> traceClass = trace.getClass();
assertNotNull(traceClass);
Map<String, IAnalysisModuleHelper> map = TmfAnalysisManager.getAnalysisModules(traceClass);
/* Make sure that modules in the new source are not in the list already */
/* Generic TmfTrace */
ITmfTrace trace = TmfTestTrace.A_TEST_10K.getTrace();
- Class<? extends ITmfTrace> traceClass = trace.getClass();
+ Class<@NonNull ? extends ITmfTrace> traceClass = trace.getClass();
assertNotNull(traceClass);
Map<String, IAnalysisModuleHelper> map = TmfAnalysisManager.getAnalysisModules(traceClass);
assertFalse(map.containsKey(AnalysisModuleTestHelper.moduleStubEnum.TEST.name()));
/* TmfTraceStub2 class */
- Class<? extends ITmfTrace> ftraceClass = fTrace.getClass();
+ Class<@NonNull ? extends ITmfTrace> ftraceClass = fTrace.getClass();
assertNotNull(ftraceClass);
map = TmfAnalysisManager.getAnalysisModules(ftraceClass);
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
+import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule;
import org.eclipse.tracecompass.tmf.core.signal.TmfSignalManager;
import org.eclipse.tracecompass.tmf.core.signal.TmfTraceOpenedSignal;
*/
@Test
public void testGetModuleByClass() {
- Class<TestAnalysis> commonClass = TestAnalysis.class;
- Class<TestAnalysis2> notCommonClass = TestAnalysis2.class;
+ Class<@NonNull TestAnalysis> commonClass = TestAnalysis.class;
+ Class<@NonNull TestAnalysis2> notCommonClass = TestAnalysis2.class;
String host1 = TmfTestTrace.A_TEST_10K.getPath();
String host2 = TmfTestTrace.A_TEST_10K2.getPath();
TmfExperiment experiment = fExperiment;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModuleHelper;
import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModuleSource;
import org.eclipse.tracecompass.tmf.core.analysis.TmfAnalysisModuleHelperConfigElement;
typeElements.add(element);
}
}
- return checkNotNull(typeElements.toArray(new IConfigurationElement[typeElements.size()]));
+ return checkNotNull(typeElements.toArray(new @NonNull IConfigurationElement[typeElements.size()]));
}
/**
import java.util.Arrays;
+import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
import org.eclipse.tracecompass.tmf.core.event.ITmfEventField;
* The field name or absolute field path array to look for in the
* event content. Should *not* be localized!
*/
- public TmfContentFieldAspect(String aspectName, String... fieldPath) {
+ public TmfContentFieldAspect(String aspectName, @NonNull String... fieldPath) {
this(aspectName, EMPTY_STRING, fieldPath);
}
- private TmfContentFieldAspect(String aspectName, String helpText, String... fieldPath) {
+ private TmfContentFieldAspect(String aspectName, String helpText, @NonNull String... fieldPath) {
fAspectName = aspectName;
fFieldPath = checkNotNull(Arrays.copyOf(fieldPath, fieldPath.length));
fHelpText = helpText;
* @return the new aspect
* @since 1.0
*/
- public static TmfContentFieldAspect create(String aspectName, String helpText, String... fieldPath) {
+ public static TmfContentFieldAspect create(String aspectName, String helpText, @NonNull String... fieldPath) {
return new TmfContentFieldAspect(aspectName, helpText, fieldPath);
}
*
* @return The trace class
*/
- public Class<? extends ITmfTrace> getTraceClass() {
+ public Class<@NonNull ? extends ITmfTrace> getTraceClass() {
return fTrace.getClass();
}
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.tracecompass.tmf.remote.core.shell.ICommandInput;
// ------------------------------------------------------------------------
// Attributes
// ------------------------------------------------------------------------
+
/** The input as list of Strings. */
- private final List<String> fInput = new ArrayList<>();
+ private final @NonNull List<@NonNull String> fInput = new ArrayList<>();
// ------------------------------------------------------------------------
// Accessors
// ------------------------------------------------------------------------
// Operations
// ------------------------------------------------------------------------
+
@Override
public void add(@Nullable String segment) {
if (segment != null) {
@Override
public void resourceChanged(final IResourceChangeEvent event) {
- final Set<IMarker> added = new HashSet<>();
- final Set<IMarker> removed = new HashSet<>();
+ final Set<@NonNull IMarker> added = new HashSet<>();
+ final Set<@NonNull IMarker> removed = new HashSet<>();
boolean deltaFound = false;
for (final IMarkerDelta delta : event.findMarkerDeltas(IMarker.BOOKMARK, false)) {
if (delta.getResource().equals(fFile)) {
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.osgi.util.NLS;
import org.eclipse.tracecompass.internal.tmf.ui.Activator;
import org.eclipse.tracecompass.internal.tmf.ui.editors.ITmfEventsEditorConstants;
TraceTypeHelper helper = TmfTraceType.getTraceType(getTraceType());
- Class<? extends ITmfTrace> traceClass = null;
+ Class<@NonNull ? extends ITmfTrace> traceClass = null;
if (helper != null) {
traceClass = helper.getTraceClass();
private final Map<ITmfTrace, List<TimeGraphEntry>> fEntryListMap = new HashMap<>();
/** The trace to filters hash map */
- private final Map<ITmfTrace, ViewerFilter[]> fFiltersMap = new HashMap<>();
+ private final Map<ITmfTrace, @NonNull ViewerFilter[]> fFiltersMap = new HashMap<>();
/** The trace to marker event sources hash map */
private final Map<ITmfTrace, List<IMarkerEventSource>> fMarkerEventSourcesMap = new HashMap<>();
Object getInput();
- void setFilters(ViewerFilter[] filters);
+ void setFilters(@NonNull ViewerFilter[] filters);
- ViewerFilter[] getFilters();
+ @NonNull ViewerFilter[] getFilters();
void redraw();
}
@Override
- public void setFilters(ViewerFilter[] filters) {
+ public void setFilters(@NonNull ViewerFilter[] filters) {
viewer.setFilters(filters);
}
@Override
- public ViewerFilter[] getFilters() {
+ public @NonNull ViewerFilter[] getFilters() {
return viewer.getFilters();
}
}
@Override
- public void setFilters(ViewerFilter[] filters) {
+ public void setFilters(@NonNull ViewerFilter[] filters) {
combo.setFilters(filters);
}
@Override
- public ViewerFilter[] getFilters() {
+ public @NonNull ViewerFilter[] getFilters() {
return combo.getFilters();
}
private final Map<ITimeGraphSelectionListener, SelectionListenerWrapper> fSelectionListenerMap = new HashMap<>();
/** The map of viewer filters to viewer filter wrappers */
- private final Map<ViewerFilter, ViewerFilter> fViewerFilterMap = new HashMap<>();
+ private final Map<@NonNull ViewerFilter, @NonNull ViewerFilter> fViewerFilterMap = new HashMap<>();
/**
* Flag to block the tree selection changed listener when triggered by the
/**
* @param filter The filter object to be attached to the view
*/
- public void addFilter(ViewerFilter filter) {
+ public void addFilter(@NonNull ViewerFilter filter) {
fInhibitTreeSelection = true;
ViewerFilter wrapper = new ViewerFilterWrapper(filter);
fTreeViewer.addFilter(wrapper);
/**
* @param filter The filter object to be removed from the view
*/
- public void removeFilter(ViewerFilter filter) {
+ public void removeFilter(@NonNull ViewerFilter filter) {
fInhibitTreeSelection = true;
ViewerFilter wrapper = fViewerFilterMap.get(filter);
fTreeViewer.removeFilter(wrapper);
* @return an array of viewer filters
* @since 2.0
*/
- public ViewerFilter[] getFilters() {
+ public @NonNull ViewerFilter[] getFilters() {
return fTimeGraphViewer.getFilters();
}
* an array of viewer filters, or null
* @since 2.0
*/
- public void setFilters(ViewerFilter[] filters) {
+ public void setFilters(@NonNull ViewerFilter[] filters) {
fInhibitTreeSelection = true;
fViewerFilterMap.clear();
if (filters == null) {
import java.util.List;
import java.util.Set;
+import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IAction;
* @param filter
* The filter object to be attached to the view
*/
- public void addFilter(ViewerFilter filter) {
+ public void addFilter(@NonNull ViewerFilter filter) {
fTimeGraphCtrl.addFilter(filter);
refresh();
}
* @param filter
* The filter object to be attached to the view
*/
- public void removeFilter(ViewerFilter filter) {
+ public void removeFilter(@NonNull ViewerFilter filter) {
fTimeGraphCtrl.removeFilter(filter);
refresh();
}
* @return an array of viewer filters
* @since 2.0
*/
- public ViewerFilter[] getFilters() {
+ public @NonNull ViewerFilter[] getFilters() {
return fTimeGraphCtrl.getFilters();
}
* an array of viewer filters, or null
* @since 2.0
*/
- public void setFilters(ViewerFilter[] filters) {
+ public void setFilters(@NonNull ViewerFilter[] filters) {
fTimeGraphCtrl.setFilters(filters);
refresh();
}
import java.util.Arrays;
import java.util.List;
+import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
* @param filter
* The filter object to be added to the viewer
*/
- protected void addFilter(ViewerFilter filter) {
+ protected void addFilter(@NonNull ViewerFilter filter) {
fTimeGraphViewer.addFilter(filter);
}
* @param filter
* The filter object to be removed from the viewer
*/
- protected void removeFilter(ViewerFilter filter) {
+ protected void removeFilter(@NonNull ViewerFilter filter) {
fTimeGraphViewer.removeFilter(filter);
}
import java.util.List;
import java.util.Map;
+import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jface.action.IStatusLineManager;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.resource.LocalResourceManager;
private final Cursor fResizeCursor = Display.getDefault().getSystemCursor(SWT.CURSOR_IBEAM);
private final Cursor fWaitCursor = Display.getDefault().getSystemCursor(SWT.CURSOR_WAIT);
private final Cursor fZoomCursor = Display.getDefault().getSystemCursor(SWT.CURSOR_SIZEWE);
- private final List<ViewerFilter> fFilters = new ArrayList<>();
+ private final List<@NonNull ViewerFilter> fFilters = new ArrayList<>();
private MenuDetectEvent fPendingMenuDetectEvent = null;
private boolean fGridLinesVisible = true;
private Color fGridLineColor = Display.getDefault().getSystemColor(SWT.COLOR_GRAY);
/**
* @param filter The filter object to be attached to the view
*/
- public void addFilter(ViewerFilter filter) {
+ public void addFilter(@NonNull ViewerFilter filter) {
if (!fFilters.contains(filter)) {
fFilters.add(filter);
}
/**
* @param filter The filter object to be attached to the view
*/
- public void removeFilter(ViewerFilter filter) {
+ public void removeFilter(@NonNull ViewerFilter filter) {
fFilters.remove(filter);
}
* @return an array of viewer filters
* @since 2.0
*/
- public ViewerFilter[] getFilters() {
+ public @NonNull ViewerFilter[] getFilters() {
return Iterables.toArray(fFilters, ViewerFilter.class);
}
* an array of viewer filters, or null
* @since 2.0
*/
- public void setFilters(ViewerFilter[] filters) {
+ public void setFilters(@NonNull ViewerFilter[] filters) {
fFilters.clear();
if (filters != null) {
fFilters.addAll(Arrays.asList(filters));