From fea4f11ef7d51cf08122f16f45c973c97f210fae Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Wed, 23 Mar 2016 13:36:28 +0100 Subject: [PATCH] IDEA-CR-8978 deprecate old methods --- .../debugger/engine/JavaDebugProcess.java | 13 ++-- .../debugger-ui/src/LineBreakpointManager.kt | 4 +- .../com/intellij/xdebugger/XDebugProcess.java | 76 +++++++++++++------ .../xsltDebugger/impl/XsltDebugProcess.java | 10 +-- .../python/debugger/PyDebugProcess.java | 2 +- 5 files changed, 69 insertions(+), 36 deletions(-) diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/JavaDebugProcess.java b/java/debugger/impl/src/com/intellij/debugger/engine/JavaDebugProcess.java index 76ee7cc71130..5c66fd6f2e1e 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/JavaDebugProcess.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/JavaDebugProcess.java @@ -55,6 +55,7 @@ import com.intellij.xdebugger.breakpoints.XBreakpoint; import com.intellij.xdebugger.breakpoints.XBreakpointHandler; import com.intellij.xdebugger.evaluation.XDebuggerEditorsProvider; import com.intellij.xdebugger.frame.XStackFrame; +import com.intellij.xdebugger.frame.XSuspendContext; import com.intellij.xdebugger.frame.XValueMarkerProvider; import com.intellij.xdebugger.impl.XDebugSessionImpl; import com.intellij.xdebugger.impl.XDebuggerUtilImpl; @@ -240,22 +241,22 @@ public class JavaDebugProcess extends XDebugProcess { } @Override - public void startStepOver() { + public void startStepOver(@Nullable XSuspendContext context) { myJavaSession.stepOver(false); } @Override - public void startStepInto() { + public void startStepInto(@Nullable XSuspendContext context) { myJavaSession.stepInto(false, null); } @Override - public void startForceStepInto() { + public void startForceStepInto(@Nullable XSuspendContext context) { myJavaSession.stepInto(true, null); } @Override - public void startStepOut() { + public void startStepOut(@Nullable XSuspendContext context) { myJavaSession.stepOut(); } @@ -271,12 +272,12 @@ public class JavaDebugProcess extends XDebugProcess { } @Override - public void resume() { + public void resume(@Nullable XSuspendContext context) { myJavaSession.resume(); } @Override - public void runToPosition(@NotNull XSourcePosition position) { + public void runToPosition(@NotNull XSourcePosition position, @Nullable XSuspendContext context) { myJavaSession.runToCursor(position, false); } diff --git a/platform/script-debugger/debugger-ui/src/LineBreakpointManager.kt b/platform/script-debugger/debugger-ui/src/LineBreakpointManager.kt index 2e6466e7788e..2227e5f91384 100644 --- a/platform/script-debugger/debugger-ui/src/LineBreakpointManager.kt +++ b/platform/script-debugger/debugger-ui/src/LineBreakpointManager.kt @@ -197,7 +197,7 @@ abstract class LineBreakpointManager(internal val debugProcess: DebugProcessImpl protected open fun checkDuplicates(newTarget: BreakpointTarget, location: Location, breakpointManager: BreakpointManager): Breakpoint? = null - fun runToLocation(position: XSourcePosition) { + fun runToLocation(position: XSourcePosition, vm: Vm) { val addedBreakpoints = doRunToLocation(position) if (addedBreakpoints.isEmpty()) { return @@ -206,7 +206,7 @@ abstract class LineBreakpointManager(internal val debugProcess: DebugProcessImpl synchronized (lock) { runToLocationBreakpoints.addAll(addedBreakpoints) } - debugProcess.resume(debugProcess.activeOrMainVm!!) + debugProcess.resume(vm) } protected abstract fun doRunToLocation(position: XSourcePosition): List diff --git a/platform/xdebugger-api/src/com/intellij/xdebugger/XDebugProcess.java b/platform/xdebugger-api/src/com/intellij/xdebugger/XDebugProcess.java index 0bd309f8b87c..1336186e3672 100644 --- a/platform/xdebugger-api/src/com/intellij/xdebugger/XDebugProcess.java +++ b/platform/xdebugger-api/src/com/intellij/xdebugger/XDebugProcess.java @@ -88,32 +88,51 @@ public abstract class XDebugProcess { public void startPausing() { } + @Deprecated /** - * Resume execution and call {@link XDebugSession#positionReached} - * when next line in current method/function is reached. - * Do not call this method directly. Use {@link XDebugSession#stepOver} instead + * @deprecated Use {@link #startStepOver(XSuspendContext)} instead */ public void startStepOver() { throw new AbstractMethodError(); } + /** + * Resume execution and call {@link XDebugSession#positionReached} + * when next line in current method/function is reached. + * Do not call this method directly. Use {@link XDebugSession#stepOver} instead + */ public void startStepOver(@Nullable XSuspendContext context) { + //noinspection deprecation startStepOver(); } + @Deprecated + /** + * @deprecated Use {@link #startForceStepInto(XSuspendContext)} instead + */ + public void startForceStepInto(){ + //noinspection deprecation + startStepInto(); + } + /** * Steps into suppressed call - * + *

* Resume execution and call {@link XDebugSession#positionReached} * when next line is reached. * Do not call this method directly. Use {@link XDebugSession#forceStepInto} instead */ - public void startForceStepInto(){ - startStepInto(); + public void startForceStepInto(@Nullable XSuspendContext context) { + //noinspection deprecation + startForceStepInto(); } - public void startForceStepInto(@Nullable XSuspendContext context) { - startForceStepInto(); + @Deprecated + /** + * @deprecated Use {@link #startStepInto(XSuspendContext)} instead + */ + public void startStepInto() { + throw new AbstractMethodError(); } /** @@ -121,12 +140,17 @@ public abstract class XDebugProcess { * when next line is reached. * Do not call this method directly. Use {@link XDebugSession#stepInto} instead */ - public void startStepInto() { - throw new AbstractMethodError(); + public void startStepInto(@Nullable XSuspendContext context) { + //noinspection deprecation + startStepInto(); } - public void startStepInto(@Nullable XSuspendContext context) { - startStepInto(); + @Deprecated + /** + * @deprecated Use {@link #startStepOut(XSuspendContext)} instead + */ + public void startStepOut() { + throw new AbstractMethodError(); } /** @@ -134,11 +158,8 @@ public abstract class XDebugProcess { * after returning from current method/function. * Do not call this method directly. Use {@link XDebugSession#stepOut} instead */ - public void startStepOut() { - throw new AbstractMethodError(); - } - public void startStepOut(@Nullable XSuspendContext context) { + //noinspection deprecation startStepOut(); } @@ -165,29 +186,40 @@ public abstract class XDebugProcess { return Promise.DONE; } + @Deprecated /** - * Resume execution. - * Do not call this method directly. Use {@link XDebugSession#resume} instead + * @deprecated Use {@link #resume(XSuspendContext)} instead */ public void resume() { throw new AbstractMethodError(); } + /** + * Resume execution. + * Do not call this method directly. Use {@link XDebugSession#resume} instead + */ public void resume(@Nullable XSuspendContext context) { + //noinspection deprecation resume(); } + @Deprecated + /** + * @deprecated Use {@link #runToPosition(XSuspendContext)} instead + */ + public void runToPosition(@NotNull XSourcePosition position) { + throw new AbstractMethodError(); + } + /** * Resume execution and call {@link XDebugSession#positionReached(com.intellij.xdebugger.frame.XSuspendContext)} * when position is reached. * Do not call this method directly. Use {@link XDebugSession#runToPosition} instead + * * @param position position in source code */ - public void runToPosition(@NotNull XSourcePosition position) { - throw new AbstractMethodError(); - } - public void runToPosition(@NotNull XSourcePosition position, @Nullable XSuspendContext context) { + //noinspection deprecation runToPosition(position); } diff --git a/plugins/xslt-debugger/src/org/intellij/plugins/xsltDebugger/impl/XsltDebugProcess.java b/plugins/xslt-debugger/src/org/intellij/plugins/xsltDebugger/impl/XsltDebugProcess.java index d601c9b28e4c..71719a75a61f 100644 --- a/plugins/xslt-debugger/src/org/intellij/plugins/xsltDebugger/impl/XsltDebugProcess.java +++ b/plugins/xslt-debugger/src/org/intellij/plugins/xsltDebugger/impl/XsltDebugProcess.java @@ -121,17 +121,17 @@ public class XsltDebugProcess extends XDebugProcess implements Disposable { } @Override - public void startStepOver() { + public void startStepOver(@Nullable XSuspendContext context) { myDebuggerSession.stepOver(); } @Override - public void startStepInto() { + public void startStepInto(@Nullable XSuspendContext context) { myDebuggerSession.stepInto(); } @Override - public void startStepOut() { + public void startStepOut(@Nullable XSuspendContext context) { myDebuggerSession.stepOver(); } @@ -155,7 +155,7 @@ public class XsltDebugProcess extends XDebugProcess implements Disposable { } @Override - public void resume() { + public void resume(@Nullable XSuspendContext context) { myDebuggerSession.resume(); } @@ -164,7 +164,7 @@ public class XsltDebugProcess extends XDebugProcess implements Disposable { } @Override - public void runToPosition(@NotNull XSourcePosition position) { + public void runToPosition(@NotNull XSourcePosition position, @Nullable XSuspendContext context) { final PsiFile psiFile = PsiManager.getInstance(getSession().getProject()).findFile(position.getFile()); assert psiFile != null; if (myDebuggerSession.canRunTo(position)) { diff --git a/python/src/com/jetbrains/python/debugger/PyDebugProcess.java b/python/src/com/jetbrains/python/debugger/PyDebugProcess.java index c91c0194096e..98cc6d73f087 100644 --- a/python/src/com/jetbrains/python/debugger/PyDebugProcess.java +++ b/python/src/com/jetbrains/python/debugger/PyDebugProcess.java @@ -407,7 +407,7 @@ public class PyDebugProcess extends XDebugProcess implements IPyDebugProcess, Pr } @Override - public void resume() { + public void resume(@Nullable XSuspendContext context) { passToAllThreads(ResumeOrStepCommand.Mode.RESUME); }