Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/adapters/StepContextAdapter.java56
1 files changed, 2 insertions, 54 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/adapters/StepContextAdapter.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/adapters/StepContextAdapter.java
index 3c613e9da..7e18fb467 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/adapters/StepContextAdapter.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/internal/adapters/StepContextAdapter.java
@@ -9,15 +9,12 @@
*******************************************************************************/
package org.eclipse.tcf.te.tcf.launch.core.internal.adapters;
-import java.util.concurrent.atomic.AtomicReference;
-
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.PlatformObject;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.tcf.protocol.Protocol;
import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
@@ -68,25 +65,7 @@ public class StepContextAdapter extends PlatformObject implements IStepContext {
*/
@Override
public String getName() {
- final AtomicReference<String> name = new AtomicReference<String>();
-
- if (launch != null) {
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- name.set(getId());
- }
- };
-
- if (Protocol.isDispatchThread()) {
- runnable.run();
- }
- else {
- Protocol.invokeAndWait(runnable);
- }
- }
-
- return name.get();
+ return getId();
}
/* (non-Javadoc)
@@ -115,37 +94,6 @@ public class StepContextAdapter extends PlatformObject implements IStepContext {
*/
@Override
public Object getAdapter(final Class adapter) {
- // NOTE: The getAdapter(...) method can be invoked from many place and
- // many threads where we cannot control the calls. Therefore, this
- // method is allowed be called from any thread.
- final AtomicReference<Object> object = new AtomicReference<Object>();
- Runnable runnable = new Runnable() {
- @Override
- public void run() {
- object.set(doGetAdapter(adapter));
- }
- };
-
- if (Protocol.isDispatchThread()) {
- runnable.run();
- }
- else {
- Protocol.invokeAndWait(runnable);
- }
-
- return object.get() != null ? object.get() : super.getAdapter(adapter);
- }
-
- /**
- * Returns an object which is an instance of the given class associated with this object.
- * Returns <code>null</code> if no such object can be found.
- * <p>
- * This method must be called within the TCF dispatch thread!
- *
- * @param adapter The adapter class to look up.
- * @return The adapter or <code>null</code>.
- */
- protected Object doGetAdapter(Class<?> adapter) {
if (ILaunch.class.equals(adapter)) {
return launch;
}
@@ -162,6 +110,6 @@ public class StepContextAdapter extends PlatformObject implements IStepContext {
}
}
- return null;
+ return super.getAdapter(adapter);
}
}

Back to the top