From 2522f73fbb25db1760dca8de507ae398dca81896 Mon Sep 17 00:00:00 2001 From: Maksim Zuev Date: Thu, 21 Nov 2024 17:50:19 +0100 Subject: [PATCH] [debugger] Mark final method in SuspendContextCommandImpl GitOrigin-RevId: d075ae3a21081335f37f20f5035cb83f645d48a7 --- .../intellij/debugger/engine/events/DebuggerCommandImpl.kt | 5 +++++ .../debugger/engine/events/SuspendContextCommandImpl.kt | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/events/DebuggerCommandImpl.kt b/java/debugger/impl/src/com/intellij/debugger/engine/events/DebuggerCommandImpl.kt index d3c0ab6967ee..eab84fe8f22e 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/events/DebuggerCommandImpl.kt +++ b/java/debugger/impl/src/com/intellij/debugger/engine/events/DebuggerCommandImpl.kt @@ -47,6 +47,7 @@ abstract class DebuggerCommandImpl(private val myPriority: PrioritizedTask.Prior override fun getPriority() = myPriority + @ApiStatus.Internal fun notifyCancelled() { try { commandCancelled() @@ -72,9 +73,11 @@ abstract class DebuggerCommandImpl(private val myPriority: PrioritizedTask.Prior } } + @ApiStatus.Internal protected open fun onSuspendOrFinish() { } + @ApiStatus.Internal protected open fun invokeContinuation() { executeContinuation() } @@ -88,6 +91,8 @@ abstract class DebuggerCommandImpl(private val myPriority: PrioritizedTask.Prior } internal fun resetContinuation(runnable: Runnable?): Runnable? = continuation.getAndSet(runnable) + + @ApiStatus.Internal protected fun executeContinuation() { resetContinuation(null)?.run() } diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/events/SuspendContextCommandImpl.kt b/java/debugger/impl/src/com/intellij/debugger/engine/events/SuspendContextCommandImpl.kt index 0b4a425e6fb9..ae447d52285d 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/events/SuspendContextCommandImpl.kt +++ b/java/debugger/impl/src/com/intellij/debugger/engine/events/SuspendContextCommandImpl.kt @@ -22,7 +22,7 @@ abstract class SuspendContextCommandImpl protected constructor(open val suspendC @ApiStatus.Experimental open suspend fun contextActionSuspend(suspendContext: SuspendContextImpl) = contextAction(suspendContext) - override suspend fun actionSuspend() { + final override suspend fun actionSuspend() { if (LOG.isDebugEnabled) { LOG.debug("trying $this") } @@ -45,7 +45,7 @@ abstract class SuspendContextCommandImpl protected constructor(open val suspendC check(resetContinuation(null) == null) { "Continuation is not null after resume" } } - override fun invokeContinuation() = invokeWithChecks { + final override fun invokeContinuation() = invokeWithChecks { executeContinuation() } @@ -83,7 +83,7 @@ abstract class SuspendContextCommandImpl protected constructor(open val suspendC } } - override fun onSuspendOrFinish() { + final override fun onSuspendOrFinish() { if (mySuspendContextSetInProgress) { suspendContext?.myInProgress = false }