From 6c6b71744b58e5aba2538f701563104d0788757e Mon Sep 17 00:00:00 2001 From: Vsevolod Tolstopyatov Date: Wed, 20 Oct 2021 12:21:53 +0300 Subject: [PATCH] Deprecate for removal redundant Delay method --- kotlinx-coroutines-core/common/src/Delay.kt | 15 ++++++--------- .../src/JavaFxDispatcher.kt | 1 - 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/kotlinx-coroutines-core/common/src/Delay.kt b/kotlinx-coroutines-core/common/src/Delay.kt index 4543c5dda1..35e83f3aba 100644 --- a/kotlinx-coroutines-core/common/src/Delay.kt +++ b/kotlinx-coroutines-core/common/src/Delay.kt @@ -19,15 +19,12 @@ import kotlin.time.* */ @InternalCoroutinesApi public interface Delay { - /** - * Delays coroutine for a given time without blocking a thread and resumes it after a specified time. - * - * This suspending function is cancellable. - * If the [Job] of the current coroutine is cancelled or completed while this suspending function is waiting, this function - * immediately resumes with [CancellationException]. - * There is a **prompt cancellation guarantee**. If the job was cancelled while this function was - * suspended, it will not resume successfully. See [suspendCancellableCoroutine] documentation for low-level details. - */ + + /** @suppress **/ + @Deprecated( + message = "Deprecated without replacement as an internal method never intended for public use", + level = DeprecationLevel.ERROR + ) // Error since 1.6.0 public suspend fun delay(time: Long) { if (time <= 0) return // don't delay return suspendCancellableCoroutine { scheduleResumeAfterDelay(time, it) } diff --git a/ui/kotlinx-coroutines-javafx/src/JavaFxDispatcher.kt b/ui/kotlinx-coroutines-javafx/src/JavaFxDispatcher.kt index 0a35cbf22e..6915c53972 100644 --- a/ui/kotlinx-coroutines-javafx/src/JavaFxDispatcher.kt +++ b/ui/kotlinx-coroutines-javafx/src/JavaFxDispatcher.kt @@ -10,7 +10,6 @@ import javafx.event.* import javafx.util.* import kotlinx.coroutines.* import kotlinx.coroutines.internal.* -import kotlinx.coroutines.javafx.JavaFx.delay import java.lang.UnsupportedOperationException import java.lang.reflect.* import java.util.concurrent.*