diff options
author | Geneviève Bastien | 2019-05-27 16:43:47 +0000 |
---|---|---|
committer | Genevieve Bastien | 2019-05-28 13:55:43 +0000 |
commit | 5e60d0fb376514ba9d285d183f6ebe7d46c449a0 (patch) | |
tree | 7a55e6dfccdd960773b178900504f15784a5b011 | |
parent | e7e66ba02e901dddc5c2f94f8116b555ff1b4743 (diff) | |
download | org.eclipse.tracecompass-5e60d0fb376514ba9d285d183f6ebe7d46c449a0.tar.gz org.eclipse.tracecompass-5e60d0fb376514ba9d285d183f6ebe7d46c449a0.tar.xz org.eclipse.tracecompass-5e60d0fb376514ba9d285d183f6ebe7d46c449a0.zip |
xml: bug 547701 Compare TimeGraphEntryModel in time graph view
The comparator does not require the specific DataDrivenOutputEntryModel
class, just TimeGraphEntryModel is enough, and safer.
Change-Id: I49cf7c6c80b8ea81970d8dc4433c995688dcd2f1
Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net>
Reviewed-on: https://git.eclipse.org/r/142874
Tested-by: CI Bot
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
-rw-r--r-- | tmf/org.eclipse.tracecompass.tmf.analysis.xml.ui/src/org/eclipse/tracecompass/internal/tmf/analysis/xml/ui/views/timegraph/XmlTimeGraphView.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tmf/org.eclipse.tracecompass.tmf.analysis.xml.ui/src/org/eclipse/tracecompass/internal/tmf/analysis/xml/ui/views/timegraph/XmlTimeGraphView.java b/tmf/org.eclipse.tracecompass.tmf.analysis.xml.ui/src/org/eclipse/tracecompass/internal/tmf/analysis/xml/ui/views/timegraph/XmlTimeGraphView.java index 37798db481..3dcb557f34 100644 --- a/tmf/org.eclipse.tracecompass.tmf.analysis.xml.ui/src/org/eclipse/tracecompass/internal/tmf/analysis/xml/ui/views/timegraph/XmlTimeGraphView.java +++ b/tmf/org.eclipse.tracecompass.tmf.analysis.xml.ui/src/org/eclipse/tracecompass/internal/tmf/analysis/xml/ui/views/timegraph/XmlTimeGraphView.java @@ -81,20 +81,20 @@ public class XmlTimeGraphView extends BaseDataProviderTimeGraphView { private static final String EMPTY_STRING = ""; //$NON-NLS-1$ - private static final Comparator<DataDrivenOutputEntryModel> XML_ENTRY_COMPARATOR = ((DataDrivenOutputEntryModel obj1, DataDrivenOutputEntryModel obj2) -> { + private static final Comparator<TimeGraphEntryModel> XML_ENTRY_COMPARATOR = ((TimeGraphEntryModel obj1, TimeGraphEntryModel obj2) -> { try { return Comparator - .comparing((DataDrivenOutputEntryModel obj) -> Long.decode(obj.getName())) - .thenComparingLong(DataDrivenOutputEntryModel::getStartTime) + .comparing((TimeGraphEntryModel obj) -> Long.decode(obj.getName())) + .thenComparingLong(TimeGraphEntryModel::getStartTime) .compare(obj1, obj2); } catch (NumberFormatException nfe) { return Comparator - .comparing(DataDrivenOutputEntryModel::getName) - .thenComparingLong(DataDrivenOutputEntryModel::getStartTime) + .comparing(TimeGraphEntryModel::getName) + .thenComparingLong(TimeGraphEntryModel::getStartTime) .compare(obj1, obj2); } }); - private static final Comparator<ITimeGraphEntry> ENTRY_COMPARATOR = Comparator.comparing(x -> (DataDrivenOutputEntryModel) ((TimeGraphEntry) x).getModel(), XML_ENTRY_COMPARATOR); + private static final Comparator<ITimeGraphEntry> ENTRY_COMPARATOR = Comparator.comparing(x -> (TimeGraphEntryModel) ((TimeGraphEntry) x).getModel(), XML_ENTRY_COMPARATOR); private final @NonNull XmlViewInfo fViewInfo = new XmlViewInfo(ID); private final Map<String, Integer> fStringValueMap = new HashMap<>(); |