Refactoring: make createCommand non-nullable

(cherry picked from commit 67cc9b5)
This commit is contained in:
Nikolay Krasko
2016-10-10 20:23:38 +03:00
committed by Nikolay Krasko
parent f7813263ee
commit 78525ed7c6
2 changed files with 14 additions and 19 deletions
@@ -65,15 +65,13 @@ public class DebuggerSteppingHelper {
SuspendContextCommandImpl command = action.createCommand(debugProcess, suspendContext, ignoreBreakpoints); SuspendContextCommandImpl command = action.createCommand(debugProcess, suspendContext, ignoreBreakpoints);
if (command != null) { createStepRequest(
createStepRequest( suspendContext, getContextThread(),
suspendContext, getContextThread(), debugProcess.getVirtualMachineProxy().eventRequestManager(),
debugProcess.getVirtualMachineProxy().eventRequestManager(), StepRequest.STEP_LINE, StepRequest.STEP_OUT);
StepRequest.STEP_LINE, StepRequest.STEP_OUT);
command.contextAction(); command.contextAction();
return; return;
}
} }
debugProcess.createStepOutCommand(suspendContext).contextAction(); debugProcess.createStepOutCommand(suspendContext).contextAction();
@@ -108,16 +106,13 @@ public class DebuggerSteppingHelper {
); );
SuspendContextCommandImpl command = action.createCommand(debugProcess, suspendContext, ignoreBreakpoints); SuspendContextCommandImpl command = action.createCommand(debugProcess, suspendContext, ignoreBreakpoints);
createStepRequest(
suspendContext, getContextThread(),
debugProcess.getVirtualMachineProxy().eventRequestManager(),
StepRequest.STEP_LINE, StepRequest.STEP_OUT);
if (command != null) { command.contextAction();
createStepRequest( return;
suspendContext, getContextThread(),
debugProcess.getVirtualMachineProxy().eventRequestManager(),
StepRequest.STEP_LINE, StepRequest.STEP_OUT);
command.contextAction();
return;
}
} }
debugProcess.createStepOverCommand(suspendContext, ignoreBreakpoints).contextAction(); debugProcess.createStepOverCommand(suspendContext, ignoreBreakpoints).contextAction();
@@ -48,7 +48,7 @@ import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall
import org.jetbrains.kotlin.resolve.inline.InlineUtil import org.jetbrains.kotlin.resolve.inline.InlineUtil
import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode
class KotlinSteppingCommandProvider: JvmSteppingCommandProvider() { class KotlinSteppingCommandProvider : JvmSteppingCommandProvider() {
override fun getStepOverCommand( override fun getStepOverCommand(
suspendContext: SuspendContextImpl?, suspendContext: SuspendContextImpl?,
ignoreBreakpoints: Boolean, ignoreBreakpoints: Boolean,
@@ -332,7 +332,7 @@ sealed class Action(val position: XSourcePositionImpl?) {
debugProcess: DebugProcessImpl, debugProcess: DebugProcessImpl,
suspendContext: SuspendContextImpl, suspendContext: SuspendContextImpl,
ignoreBreakpoints: Boolean ignoreBreakpoints: Boolean
): SuspendContextCommandImpl? { ): SuspendContextCommandImpl {
return when (this) { return when (this) {
is Action.RUN_TO_CURSOR -> { is Action.RUN_TO_CURSOR -> {
runReadAction { runReadAction {