From f62d14b16ba022583f1e15a6a44debfd28d6423b Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Fri, 20 Jun 2008 16:37:07 +0000 Subject: [PATCH] Bug 237800 More cleanup --- .../org/eclipse/dd/mi/service/MIRunControl.java | 2 +- .../src/org/eclipse/dd/mi/service/MIStack.java | 15 +++++++++++---- .../dd/mi/service/command/events/IMIDMEvent.java | 4 ++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIRunControl.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIRunControl.java index f66e51e4fb8..bb068e4aa91 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIRunControl.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIRunControl.java @@ -138,7 +138,7 @@ public class MIRunControl extends AbstractDsfService implements IRunControl */ @Immutable protected static class RunControlEvent> extends AbstractDMEvent - implements IDMEvent, IMIDMEvent + implements IDMEvent, IMIDMEvent { final private T fMIInfo; public RunControlEvent(V dmc, T miInfo) { diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIStack.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIStack.java index e48c0ce8ebe..6639c4e7095 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIStack.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/MIStack.java @@ -37,12 +37,13 @@ import org.eclipse.dd.dsf.service.AbstractDsfService; import org.eclipse.dd.dsf.service.DsfServiceEventHandler; import org.eclipse.dd.dsf.service.DsfSession; import org.eclipse.dd.mi.internal.MIPlugin; -import org.eclipse.dd.mi.service.MIRunControl.SuspendedEvent; import org.eclipse.dd.mi.service.command.AbstractMIControl; import org.eclipse.dd.mi.service.command.commands.MIStackInfoDepth; import org.eclipse.dd.mi.service.command.commands.MIStackListArguments; import org.eclipse.dd.mi.service.command.commands.MIStackListFrames; import org.eclipse.dd.mi.service.command.commands.MIStackListLocals; +import org.eclipse.dd.mi.service.command.events.IMIDMEvent; +import org.eclipse.dd.mi.service.command.events.MIEvent; import org.eclipse.dd.mi.service.command.events.MIStoppedEvent; import org.eclipse.dd.mi.service.command.output.MIArg; import org.eclipse.dd.mi.service.command.output.MIFrame; @@ -592,8 +593,14 @@ public class MIStack extends AbstractDsfService public void eventDispatched(ISuspendedDMEvent e) { fMICommandCache.setContextAvailable(e.getDMContext(), true); fMICommandCache.reset(); - if (e instanceof SuspendedEvent) { - fCachedStoppedEvent = ((SuspendedEvent)e).getMIEvent(); - } } + + @DsfServiceEventHandler + public void eventDispatched(IMIDMEvent e) { + MIEvent miEvent = e.getMIEvent(); + if (miEvent instanceof MIStoppedEvent) { + fCachedStoppedEvent = (MIStoppedEvent)miEvent; + } + } + } diff --git a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/IMIDMEvent.java b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/IMIDMEvent.java index 8457a6266d3..e08bbdc5bca 100644 --- a/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/IMIDMEvent.java +++ b/plugins/org.eclipse.dd.mi/src/org/eclipse/dd/mi/service/command/events/IMIDMEvent.java @@ -15,6 +15,6 @@ import org.eclipse.dd.dsf.datamodel.IDMContext; /** * Common interface for events that are directly caused by some MI event. */ -public interface IMIDMEvent> { - public V getMIEvent(); +public interface IMIDMEvent { + public MIEvent getMIEvent(); }