Skip to content

Commit

Permalink
analysis,tmf: Fix some redundant null annotations
Browse files Browse the repository at this point in the history
Fix the Eclipse warnings [1] below by removing these few (redundant)
nullness annotations. Do so namely in SystemCall,
AbstractSegmentStoreTableViewer and (tmf) AbstractTimeGraphView.

[1] "The nullness annotation is redundant with a default that applies to
this location".

Change-Id: I257b9f4d988f91b2d37c2f4ddcfbcad6911e0a55
Signed-off-by: Marco Miller <marco.miller@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/c/tracecompass/org.eclipse.tracecompass/+/201537
Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Tested-by: Trace Compass Bot <tracecompass-bot@eclipse.org>
Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
  • Loading branch information
marco-miller committed Apr 27, 2023
1 parent 97378ba commit 5526b93
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

package org.eclipse.tracecompass.internal.analysis.os.linux.core.latency;

import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.tracecompass.analysis.os.linux.core.model.OsStrings;
import org.eclipse.tracecompass.datastore.core.interval.IHTIntervalReader;
Expand Down Expand Up @@ -144,7 +143,7 @@ public int getSizeOnDisk() {
}

@Override
public void writeSegment(@NonNull ISafeByteBufferWriter buffer) {
public void writeSegment(ISafeByteBufferWriter buffer) {
buffer.putLong(fStartTime);
buffer.putLong(fEndTime);
buffer.putString(fName);
Expand All @@ -153,7 +152,7 @@ public void writeSegment(@NonNull ISafeByteBufferWriter buffer) {
}

@Override
public int compareTo(@NonNull ISegment o) {
public int compareTo(ISegment o) {
int ret = INamedSegment.super.compareTo(o);
if (ret != 0) {
return ret;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
Expand Down Expand Up @@ -155,7 +154,7 @@ public void widgetSelected(@Nullable SelectionEvent e) {
ITmfTimestamp end = TmfTimestamp.fromNanos(selectedSegment.getEnd());
TmfSignalManager.dispatchSignal(new TmfSelectionRangeUpdatedSignal(AbstractSegmentStoreTableViewer.this, start, end, fTrace));
if (selectedSegment instanceof IElementResolver) {
Multimap<@NonNull String, @NonNull Object> metadata = ((IElementResolver) selectedSegment).getMetadata();
Multimap<String, Object> metadata = ((IElementResolver) selectedSegment).getMetadata();
if (!metadata.isEmpty()) {
TmfSignalManager.dispatchSignal(new TmfDataModelSelectedSignal(AbstractSegmentStoreTableViewer.this, metadata));
}
Expand Down Expand Up @@ -404,11 +403,11 @@ public synchronized void setData(@Nullable ISegmentStoreProvider provider) {
// and model can be updated

// FIXME Filtering should be done at the data provider level
Map<@NonNull Integer, @NonNull Predicate<@NonNull Multimap<@NonNull String, @NonNull Object>>> predicates = generateRegexPredicate();
Map<Integer, Predicate<Multimap<String, Object>>> predicates = generateRegexPredicate();
Predicate<ISegment> predicate = segment -> {

// Get the filter external input data
Multimap<@NonNull String, @NonNull Object> input = ISegmentStoreProvider.getFilterInput(provider, segment);
Multimap<String, Object> input = ISegmentStoreProvider.getFilterInput(provider, segment);

/*
* Test each predicates and set the status of the property
Expand Down Expand Up @@ -483,11 +482,11 @@ protected IStatus run(@Nullable IProgressMonitor monitor) {
*/
protected Map<Integer, Predicate<Multimap<String, Object>>> generateRegexPredicate() {
Multimap<Integer, String> regexes = getRegexes();
Map<@NonNull Integer, @NonNull Predicate<@NonNull Multimap<@NonNull String, @NonNull Object>>> predicates = new HashMap<>();
Map<Integer, Predicate<Multimap<String, Object>>> predicates = new HashMap<>();
for (Entry<Integer, Collection<String>> entry : regexes.asMap().entrySet()) {
String regex = IFilterStrings.mergeFilters(entry.getValue());
FilterCu cu = FilterCu.compile(regex);
Predicate<@NonNull Multimap<@NonNull String, @NonNull Object>> predicate = cu != null ? cu.generate() : null;
Predicate<Multimap<String, Object>> predicate = cu != null ? cu.generate() : null;
if (predicate != null) {
predicates.put(entry.getKey(), predicate);
}
Expand Down Expand Up @@ -663,8 +662,8 @@ public void regexFilterApplied(TmfFilterAppliedSignal signal) {
* @return The multimap of regexes by property
* @since 3.1
*/
protected Multimap<@NonNull Integer, @NonNull String> getRegexes() {
Multimap<@NonNull Integer, @NonNull String> regexes = HashMultimap.create();
protected Multimap<Integer, String> getRegexes() {
Multimap<Integer, String> regexes = HashMultimap.create();

ITmfTrace trace = fTrace;
if (trace == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -943,11 +943,11 @@ private void fillWithNullEvents(TimeGraphEntry entry, List<ITimeEvent> eventList
@NonNullByDefault
protected Map<Integer, Predicate<Multimap<String, Object>>> generateRegexPredicate() {
Multimap<Integer, String> regexes = getRegexes();
Map<@NonNull Integer, @NonNull Predicate<@NonNull Multimap<@NonNull String, @NonNull Object>>> predicates = new HashMap<>();
Map<Integer, Predicate<Multimap<String, Object>>> predicates = new HashMap<>();
for (Entry<Integer, Collection<String>> entry : regexes.asMap().entrySet()) {
String regex = IFilterStrings.mergeFilters(entry.getValue());
FilterCu cu = FilterCu.compile(regex);
Predicate<@NonNull Multimap<@NonNull String, @NonNull Object>> predicate = cu != null ? cu.generate() : null;
Predicate<Multimap<String, Object>> predicate = cu != null ? cu.generate() : null;
if (predicate != null) {
predicates.put(entry.getKey(), predicate);
}
Expand Down

0 comments on commit 5526b93

Please sign in to comment.