Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2012-02-19 17:23:27 +0000
committerUwe Stieber2012-02-20 08:38:54 +0000
commit5e7e69a25a56b5a37634056d65c32e13c93ea3ad (patch)
tree627f5f38214bffeb6510b48ec43103c2b3084e12 /target_explorer/plugins/org.eclipse.tcf.te.launch.core
parenta6543eb48761a3496c8be1694999d7b6d9a1bfdc (diff)
downloadorg.eclipse.tcf-5e7e69a25a56b5a37634056d65c32e13c93ea3ad.tar.gz
org.eclipse.tcf-5e7e69a25a56b5a37634056d65c32e13c93ea3ad.tar.xz
org.eclipse.tcf-5e7e69a25a56b5a37634056d65c32e13c93ea3ad.zip
Target Explorer: Fix encoded launch context class type detection
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.launch.core')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/persistence/ContextSelectorPersistenceDelegate.java18
1 files changed, 13 insertions, 5 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/persistence/ContextSelectorPersistenceDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/persistence/ContextSelectorPersistenceDelegate.java
index c26a521d9..ac1f84bd0 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/persistence/ContextSelectorPersistenceDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/persistence/ContextSelectorPersistenceDelegate.java
@@ -33,6 +33,7 @@ import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.tcf.te.launch.core.activator.CoreBundleActivator;
import org.eclipse.tcf.te.launch.core.lm.interfaces.IContextSelectorLaunchAttributes;
import org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchSpecification;
+import org.eclipse.tcf.te.runtime.model.factory.Factory;
import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode;
import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
import org.osgi.framework.Bundle;
@@ -229,7 +230,7 @@ public class ContextSelectorPersistenceDelegate {
Assert.isNotNull(indentation);
Assert.isNotNull(context);
- writer.write(indentation + "<context type=\"" + context.getModelNode().getClass().getName() + "\">\n"); //$NON-NLS-1$ //$NON-NLS-2$
+ writer.write(indentation + "<context type=\"" + context.getEncodedClassName() + "\">\n"); //$NON-NLS-1$ //$NON-NLS-2$
writer.write(indentation + "\t" + context.encode() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
writer.write(indentation + "</context>\n"); //$NON-NLS-1$
}
@@ -437,10 +438,17 @@ public class ContextSelectorPersistenceDelegate {
}
if (clazz != null) {
- // Try to load the step context
- IStepContext context = (IStepContext)Platform.getAdapterManager().loadAdapter(clazz, IStepContext.class.getName());
- if (context != null && !contexts.contains(context)) {
- contexts.add(context);
+ // Create an instance of this class and try to load the step context
+ Object object = Factory.getInstance().newInstance(clazz);
+ if (object != null) {
+ IStepContext context = (IStepContext)Platform.getAdapterManager().loadAdapter(object, IStepContext.class.getName());
+ if (context != null) {
+ // Decodes the context object
+ context.decode(lastData);
+ if (!contexts.contains(context)) {
+ contexts.add(context);
+ }
+ }
}
}
}

Back to the top