Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeneviève Bastien2014-12-15 20:24:30 +0000
committerGenevieve Bastien2015-01-09 19:12:48 +0000
commit2a28075c586eef318107110de1279f999cb1ebe0 (patch)
tree16bf73695a0c0f7fedeecba0fdedf01dd9db456e /org.eclipse.tracecompass.tmf.ui
parent3caabe33af680d147ea1ccfdc43147fc11319bb8 (diff)
downloadorg.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.java5
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));
}
/**

Back to the top