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 <patrick.tasse@gmail.com>
Reviewed-on: https://git.eclipse.org/r/72916
Reviewed-by: Hudson CI
Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
- 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<TimeGraphEntry> consumer = new Consumer<TimeGraphEntry>() {
+ @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);
+