diff options
author | Geneviève Bastien | 2014-12-15 20:24:30 +0000 |
---|---|---|
committer | Genevieve Bastien | 2015-01-09 19:12:48 +0000 |
commit | 2a28075c586eef318107110de1279f999cb1ebe0 (patch) | |
tree | 16bf73695a0c0f7fedeecba0fdedf01dd9db456e /org.eclipse.tracecompass.tmf.ui | |
parent | 3caabe33af680d147ea1ccfdc43147fc11319bb8 (diff) | |
download | org.eclipse.tracecompass-2a28075c586eef318107110de1279f999cb1ebe0.tar.gz org.eclipse.tracecompass-2a28075c586eef318107110de1279f999cb1ebe0.tar.xz org.eclipse.tracecompass-2a28075c586eef318107110de1279f999cb1ebe0.zip |
TMF: Make the ITmfEventAspect#resolve nullable
A null value has the advantage to really show an aspect is not available for
a given event instead of having to find of dummy empty objects that we need to
compare with in most cases.
With the new common NonNullUtils class, it is now easy to convert a null value
to something useful, like a nonNull String, so it does not add useless null
checks to the code.
Change-Id: I9f41ec6522b5132244c630ce9a6b174599802954
Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net>
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Reviewed-on: https://git.eclipse.org/r/38297
Reviewed-by: Hudson CI
Diffstat (limited to 'org.eclipse.tracecompass.tmf.ui')
-rw-r--r-- | org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/columns/TmfEventTableColumn.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/columns/TmfEventTableColumn.java b/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/columns/TmfEventTableColumn.java index cc7d5e3650..1aaa6126cf 100644 --- a/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/columns/TmfEventTableColumn.java +++ b/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/viewers/events/columns/TmfEventTableColumn.java @@ -12,10 +12,9 @@ package org.eclipse.tracecompass.tmf.ui.viewers.events.columns; -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.common.core.NonNullUtils; import org.eclipse.tracecompass.tmf.core.event.ITmfEvent; import org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect; @@ -89,7 +88,7 @@ public class TmfEventTableColumn { * @return The string to display in the column for this event */ public String getItemString(ITmfEvent event) { - return checkNotNull(fAspect.resolve(event).toString()); + return NonNullUtils.nullToEmptyString(fAspect.resolve(event)); } /** |