From 6e65b8a3fd55df74deb42c7a7389d6a89bdf4086 Mon Sep 17 00:00:00 2001 From: Patrick Tasse Date: Tue, 17 May 2016 09:10:23 -0400 Subject: [PATCH] tmf: Bug 494197: Empty event list for CallStackEntry when no process The three-level deep loop to populate the event list from the build thread did not reach the third level if a trace did not have processes or threads. The loops are replaced with a recursive consumer. Change-Id: Ie7eebb57f562bad0c6620ae08fcde8b585c52ca9 Signed-off-by: Patrick Tasse Reviewed-on: https://git.eclipse.org/r/72916 Reviewed-by: Hudson CI Reviewed-by: Bernd Hufmann Tested-by: Bernd Hufmann --- .../tmf/ui/views/callstack/CallStackView.java | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/callstack/CallStackView.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/callstack/CallStackView.java index 43286766e5..8e915d84a8 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/callstack/CallStackView.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/callstack/CallStackView.java @@ -693,16 +693,21 @@ public class CallStackView extends AbstractTimeGraphView { refresh(); } - for (ITimeGraphEntry processEntry : traceEntry.getChildren()) { - for (ITimeGraphEntry threadEntry : processEntry.getChildren()) { - for (ITimeGraphEntry callStackEntry : threadEntry.getChildren()) { - if (monitor.isCanceled()) { - return; - } - buildStatusEvents(parentTrace, (CallStackEntry) callStackEntry, monitor, ss.getStartTime(), end); + Consumer consumer = new Consumer() { + @Override + public void accept(TimeGraphEntry entry) { + if (monitor.isCanceled()) { + return; } + if (entry instanceof CallStackEntry) { + buildStatusEvents(parentTrace, (CallStackEntry) entry, monitor, ss.getStartTime(), end); + return; + } + entry.getChildren().forEach(this); } - } + }; + traceEntry.getChildren().forEach(consumer); + start = end; } } -- 2.34.1