Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2013-09-26 05:03:42 -0400
committerTobias Schwarz2013-09-26 05:03:42 -0400
commit0e17f9a9141f6c85e1c6e80e51576ec9bb27e552 (patch)
tree3ce33807467a4d336ebc941035461125406de84a /target_explorer
parentd8db012b427cd582cd926eab251038411f34a6b1 (diff)
downloadorg.eclipse.tcf-0e17f9a9141f6c85e1c6e80e51576ec9bb27e552.tar.gz
org.eclipse.tcf-0e17f9a9141f6c85e1c6e80e51576ec9bb27e552.tar.xz
org.eclipse.tcf-0e17f9a9141f6c85e1c6e80e51576ec9bb27e552.zip
Target Explorer: fix model update and exist event handling
Diffstat (limited to 'target_explorer')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/listener/RuntimeModelProcessServiceListener.java21
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelUpdateService.java3
2 files changed, 13 insertions, 11 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/listener/RuntimeModelProcessServiceListener.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/listener/RuntimeModelProcessServiceListener.java
index 89656baab..848bb95c2 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/listener/RuntimeModelProcessServiceListener.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/listener/RuntimeModelProcessServiceListener.java
@@ -49,16 +49,17 @@ public class RuntimeModelProcessServiceListener implements IProcesses.ProcessesL
@Override
public void exited(String id, int exit_code) {
if (CoreBundleActivator.getTraceHandler().isSlotEnabled(0, ITraceIds.TRACE_SERVICE_LISTENER)) {
- CoreBundleActivator.getTraceHandler().trace("OCDDevicesServiceListener#contextChanged: id = \"" + id + "\"", //$NON-NLS-1$ //$NON-NLS-2$
- 0, ITraceIds.TRACE_SERVICE_LISTENER,
- IStatus.INFO, this);
-
- // Find the terminated process
- IModelNode[] nodes = model.getService(IModelLookupService.class).lkupModelNodesById(id);
- for (IModelNode node : nodes) {
- // Remove the terminated nodes from the model
- model.getService(IModelUpdateService.class).remove(node);
- }
+ CoreBundleActivator.getTraceHandler().trace("RuntimeModelProcessServiceListener#exited: id = \"" + id + //$NON-NLS-1$
+ "\" exitCode=\"" + exit_code + "\"", //$NON-NLS-1$ //$NON-NLS-2$
+ 0, ITraceIds.TRACE_SERVICE_LISTENER,
+ IStatus.INFO, this);
}
+
+ // Find the terminated process
+ IModelNode[] nodes = model.getService(IModelLookupService.class).lkupModelNodesById(id);
+ for (IModelNode node : nodes) {
+ // Remove the terminated nodes from the model
+ model.getService(IModelUpdateService.class).remove(node);
+ }
}
} \ No newline at end of file
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelUpdateService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelUpdateService.java
index 87a97d7c0..45dad363f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelUpdateService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelUpdateService.java
@@ -48,7 +48,8 @@ public class RuntimeModelUpdateService extends AbstractModelService<IRuntimeMode
@Override
public void remove(IModelNode node) {
Assert.isNotNull(node);
- getModel().remove(node, false);
+ Assert.isNotNull(node.getParent());
+ node.getParent().remove(node, false);
}
/* (non-Javadoc)

Back to the top