From b8337ebf97149448ec1e0db602c8b77971d84f8d Mon Sep 17 00:00:00 2001 From: David Vacca Date: Mon, 11 Nov 2024 07:03:00 -0800 Subject: [PATCH] Migrate Continuation to kotlin (#47537) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/47537 Migrate Continuation interface to kotlin changelog: [internal] internal Reviewed By: javache Differential Revision: D65738326 fbshipit-source-id: 1a119f6d349101951dc528583f3dbaf5441da91e --- .../bolts/{Continuation.java => Continuation.kt} | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) rename packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/{Continuation.java => Continuation.kt} (59%) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/Continuation.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/Continuation.kt similarity index 59% rename from packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/Continuation.java rename to packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/Continuation.kt index 21674712251..c71dfa20872 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/Continuation.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/Continuation.kt @@ -5,20 +5,16 @@ * LICENSE file in the root directory of this source tree. */ -package com.facebook.react.runtime.internal.bolts; - -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; +package com.facebook.react.runtime.internal.bolts /** * A function to be called after a task completes. * *

If you wish to have the Task from a Continuation that does not return a Task be cancelled then - * throw a {@link java.util.concurrent.CancellationException} from the Continuation. + * throw a [java.util.concurrent.CancellationException] from the Continuation. * * @see Task */ public interface Continuation { - @Nullable - TContinuationResult then(@NonNull Task task) throws Exception; + @Throws(Exception::class) public fun then(task: Task): TContinuationResult? }