From 466deff0dec350f9a9640376524dd7a57af35cde Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Tue, 9 Jan 2024 19:07:01 -0800 Subject: [PATCH] Refactor: ReactHost: Rename getOrCreateReactInstanceTask -> getOrCreateReactInstance (#42165) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/42165 This will help avoid a name collision when we remove the new suffix from newGetOrCreateReactInstanceTask. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D52495532 fbshipit-source-id: 79a04cff51eef07b91876a1351b8444654a79274 --- .../main/java/com/facebook/react/runtime/ReactHostImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java index 1ae42cbe792..38a58ccd863 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java @@ -726,7 +726,7 @@ public class ReactHostImpl implements ReactHost { if (mStartTask == null) { log(method, "Schedule"); mStartTask = - getOrCreateReactInstanceTask() + getOrCreateReactInstance() .continueWithTask( task -> { if (task.isFaulted()) { @@ -824,7 +824,7 @@ public class ReactHostImpl implements ReactHost { final String callingMethod, final VeniceThenable runnable) { final String method = "callAfterGetOrCreateReactInstance(" + callingMethod + ")"; - return getOrCreateReactInstanceTask() + return getOrCreateReactInstance() .onSuccess( (Continuation) task -> { @@ -863,7 +863,7 @@ public class ReactHostImpl implements ReactHost { *

If the ReactInstance is reloading, will return the reload task. If the ReactInstance is * destroying, will wait until destroy is finished, before creating. */ - private Task getOrCreateReactInstanceTask() { + private Task getOrCreateReactInstance() { if (ReactFeatureFlags.enableBridgelessArchitectureNewCreateReloadDestroy) { return Task.call(this::waitThenCallNewGetOrCreateReactInstanceTask, mBGExecutor) .continueWithTask(Task::getResult);