Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Khouzam2018-03-21 20:23:49 -0400
committerMatthew Khouzam2018-03-22 11:46:59 -0400
commitf47b970a5c3e440df541d696b1c6b18d004b6e28 (patch)
treea9ccf626254d5fc1394911b9dbfe4a18ebb8872c
parenta0ec10cde58d3485e02e2b59524bd6b7bdd641df (diff)
downloadorg.eclipse.tracecompass.incubator-f47b970a5c3e440df541d696b1c6b18d004b6e28.tar.gz
org.eclipse.tracecompass.incubator-f47b970a5c3e440df541d696b1c6b18d004b6e28.tar.xz
org.eclipse.tracecompass.incubator-f47b970a5c3e440df541d696b1c6b18d004b6e28.zip
traceevent: clean up the ObjectLifeDataProvider
Change-Id: I4f5466c3c27622925e083eed3e4d5adb74cef63c Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com> Reviewed-on: https://git.eclipse.org/r/119928 Tested-by: CI Bot Reviewed-by: Loic Prieur-Drevon <loic.prieurdrevon@gmail.com>
-rw-r--r--tracetypes/org.eclipse.tracecompass.incubator.traceevent.core/src/org/eclipse/tracecompass/incubator/internal/traceevent/core/analysis/objectlife/ObjectLifeDataProvider.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/tracetypes/org.eclipse.tracecompass.incubator.traceevent.core/src/org/eclipse/tracecompass/incubator/internal/traceevent/core/analysis/objectlife/ObjectLifeDataProvider.java b/tracetypes/org.eclipse.tracecompass.incubator.traceevent.core/src/org/eclipse/tracecompass/incubator/internal/traceevent/core/analysis/objectlife/ObjectLifeDataProvider.java
index cca98261..1460f4c8 100644
--- a/tracetypes/org.eclipse.tracecompass.incubator.traceevent.core/src/org/eclipse/tracecompass/incubator/internal/traceevent/core/analysis/objectlife/ObjectLifeDataProvider.java
+++ b/tracetypes/org.eclipse.tracecompass.incubator.traceevent.core/src/org/eclipse/tracecompass/incubator/internal/traceevent/core/analysis/objectlife/ObjectLifeDataProvider.java
@@ -11,8 +11,8 @@ package org.eclipse.tracecompass.incubator.internal.traceevent.core.analysis.obj
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.Comparator;
-import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -85,18 +85,18 @@ public class ObjectLifeDataProvider extends AbstractTimeGraphDataProvider<@NonNu
int quark = quarks.iterator().next();
try {
- Map<String, String> retMap = new LinkedHashMap<>(1);
- List<ITmfStateInterval> full = ss.queryFullState(start);
- Object object = full.get(quark).getValue();
+ Map<String, String> retMap = null;
+ ITmfStateInterval state = ss.querySingleState(start, quark);
+ Object object = state.getValue();
if (object instanceof String) {
- retMap.put("value", object.toString()); //$NON-NLS-1$
+ retMap = Collections.singletonMap("value", object.toString()); //$NON-NLS-1$
+ } else {
+ retMap = Collections.emptyMap();
}
return new TmfModelResponse<>(retMap, ITmfResponse.Status.COMPLETED, CommonStatusMessage.COMPLETED);
} catch (StateSystemDisposedException e) {
- // do nothing
+ return new TmfModelResponse<>(null, ITmfResponse.Status.CANCELLED, CommonStatusMessage.TASK_CANCELLED);
}
-
- return new TmfModelResponse<>(null, ITmfResponse.Status.COMPLETED, CommonStatusMessage.COMPLETED);
}
@Override

Back to the top