diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/CompositeReactPackageTurboModuleManagerDelegate.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/CompositeReactPackageTurboModuleManagerDelegate.java index 89d695a24d92df..9ca49e89e207c2 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/CompositeReactPackageTurboModuleManagerDelegate.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/CompositeReactPackageTurboModuleManagerDelegate.java @@ -18,7 +18,8 @@ @Deprecated( since = - "CompositeReactPackageTurboModuleManagerDelegate is deprecated and will be deleted in the future. Please use ReactPackage interface or BaseReactPackage instead.") + "CompositeReactPackageTurboModuleManagerDelegate is deprecated and will be deleted in the" + + " future. Please use ReactPackage interface or BaseReactPackage instead.") @DoNotStrip public class CompositeReactPackageTurboModuleManagerDelegate extends ReactPackageTurboModuleManagerDelegate { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/DebugCorePackage.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/DebugCorePackage.java index 69471937ab8501..497bf0304e6df0 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/DebugCorePackage.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/DebugCorePackage.java @@ -92,7 +92,9 @@ private static void appendMap( map.put(name, ModuleSpec.viewManagerSpec(provider)); } - /** @return a map of view managers that should be registered with {@link UIManagerModule} */ + /** + * @return a map of view managers that should be registered with {@link UIManagerModule} + */ private Map getViewManagersMap() { if (mViewManagers == null) { Map viewManagers = new HashMap<>(); diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/LazyReactPackage.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/LazyReactPackage.java index 48e30d36b8e099..76159afecadb2e 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/LazyReactPackage.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/LazyReactPackage.java @@ -106,6 +106,7 @@ public final List createNativeModules(ReactApplicationContext reac } return modules; } + /** * @param reactContext react application context that can be used to create View Managers. * @return list of module specs that can create the View Managers. diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/NativeModuleRegistryBuilder.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/NativeModuleRegistryBuilder.java index cf85a64935b813..a33bc6e732b563 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/NativeModuleRegistryBuilder.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/NativeModuleRegistryBuilder.java @@ -50,8 +50,12 @@ public void processPackage(ReactPackage reactPackage) { + name + " tried to override " + existingNativeModule.getClassName() - + ". Check the getPackages() method in MainApplication.java, it might be that module is being created twice. If this was your intention, set canOverrideExistingModule=true. " - + "This error may also be present if the package is present only once in getPackages() but is also automatically added later during build time by autolinking. Try removing the existing entry and rebuild."); + + ". Check the getPackages() method in MainApplication.java, it might be that" + + " module is being created twice. If this was your intention, set" + + " canOverrideExistingModule=true. This error may also be present if the package" + + " is present only once in getPackages() but is also automatically added later" + + " during build time by autolinking. Try removing the existing entry and" + + " rebuild."); } mModules.remove(existingNativeModule); } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactFragment.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactFragment.java index 103b71cf894c17..12f2d9daba822b 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactFragment.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactFragment.java @@ -113,6 +113,7 @@ public void onDestroy() { super.onDestroy(); mReactDelegate.onHostDestroy(); } + // endregion @Override diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java index b0788f87da4990..fd0a4529eb0cf0 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java @@ -1024,7 +1024,9 @@ public void removeReactInstanceEventListener( mReactInstanceEventListeners.remove(listener); } - /** @return current ReactApplicationContext */ + /** + * @return current ReactApplicationContext + */ @VisibleForTesting public @Nullable ReactContext getCurrentReactContext() { synchronized (mReactContextLock) { @@ -1333,7 +1335,9 @@ private void tearDownReactContext(ReactContext reactContext) { mDevSupportManager.onReactInstanceDestroyed(reactContext); } - /** @return instance of {@link ReactContext} configured a {@link CatalystInstance} set */ + /** + * @return instance of {@link ReactContext} configured a {@link CatalystInstance} set + */ private ReactApplicationContext createReactContext( JavaScriptExecutor jsExecutor, JSBundleLoader jsBundleLoader) { FLog.d(ReactConstants.TAG, "ReactInstanceManager.createReactContext()"); diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java index 6551937866f7ed..2e979cd4d2131d 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java @@ -30,7 +30,8 @@ */ @DeprecatedInNewArchitecture( message = - "This class will be replaced by com.facebook.react.ReactHost in the new architecture of React Native.") + "This class will be replaced by com.facebook.react.ReactHost in the new architecture of" + + " React Native.") public abstract class ReactNativeHost { private final Application mApplication; diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactPackage.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactPackage.java index a94f0da6866671..940e50c24e10d8 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactPackage.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactPackage.java @@ -46,7 +46,9 @@ public interface ReactPackage { @DeprecatedInNewArchitecture List createNativeModules(@NonNull ReactApplicationContext reactContext); - /** @return a list of view managers that should be registered with {@link UIManagerModule} */ + /** + * @return a list of view managers that should be registered with {@link UIManagerModule} + */ @NonNull List createViewManagers(@NonNull ReactApplicationContext reactContext); diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactPackageTurboModuleManagerDelegate.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactPackageTurboModuleManagerDelegate.java index aba8502f55c405..d69de367e4fc11 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactPackageTurboModuleManagerDelegate.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactPackageTurboModuleManagerDelegate.java @@ -181,7 +181,8 @@ public TurboModule getModule(String moduleName) { FLog.e( ReactConstants.TAG, ex, - "Caught exception while constructing module '%s'. This was previously ignored but will not be caught in the future.", + "Caught exception while constructing module '%s'. This was previously ignored but will" + + " not be caught in the future.", moduleName); } } @@ -243,7 +244,8 @@ public NativeModule getLegacyModule(String moduleName) { FLog.e( ReactConstants.TAG, ex, - "Caught exception while constructing module '%s'. This was previously ignored but will not be caught in the future.", + "Caught exception while constructing module '%s'. This was previously ignored but will" + + " not be caught in the future.", moduleName); } } @@ -294,10 +296,12 @@ protected abstract ReactPackageTurboModuleManagerDelegate build( public ReactPackageTurboModuleManagerDelegate build() { Assertions.assertNotNull( mContext, - "The ReactApplicationContext must be provided to create ReactPackageTurboModuleManagerDelegate"); + "The ReactApplicationContext must be provided to create" + + " ReactPackageTurboModuleManagerDelegate"); Assertions.assertNotNull( mPackages, - "A set of ReactPackages must be provided to create ReactPackageTurboModuleManagerDelegate"); + "A set of ReactPackages must be provided to create" + + " ReactPackageTurboModuleManagerDelegate"); return build(mContext, mPackages); } } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java index 766836fd0b16d1..d61084070271f5 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java @@ -317,7 +317,8 @@ public void requestChildFocus(View child, View focused) { if (!hasActiveReactContext() || !isViewAttachedToReactInstance()) { FLog.w( TAG, - "Unable to handle child focus changed event as the catalyst instance has not been attached"); + "Unable to handle child focus changed event as the catalyst instance has not been" + + " attached"); super.requestChildFocus(child, focused); return; } @@ -420,8 +421,9 @@ public void run() { ReactSoftExceptionLogger.logSoftException( TAG, new ReactNoCrashSoftException( - "A view was illegally added as a child of a ReactRootView. " - + "This View should not be a direct child of a ReactRootView, because it is not visible and will never be reachable. Child: " + "A view was illegally added as a child of a ReactRootView. This View should" + + " not be a direct child of a ReactRootView, because it is not visible" + + " and will never be reachable. Child: " + child.getClass().getCanonicalName().toString() + " child ID: " + child.getId())); @@ -758,11 +760,11 @@ protected void finalize() throws Throwable { super.finalize(); Assertions.assertCondition( !mIsAttachedToInstance, - "The application this ReactRootView was rendering was not unmounted before the " - + "ReactRootView was garbage collected. This usually means that your application is " - + "leaking large amounts of memory. To solve this, make sure to call " - + "ReactRootView#unmountReactApplication in the onDestroy() of your hosting Activity or in " - + "the onDestroyView() of your hosting Fragment."); + "The application this ReactRootView was rendering was not unmounted before the" + + " ReactRootView was garbage collected. This usually means that your application is" + + " leaking large amounts of memory. To solve this, make sure to call" + + " ReactRootView#unmountReactApplication in the onDestroy() of your hosting Activity" + + " or in the onDestroyView() of your hosting Fragment."); } public int getRootViewTag() { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ViewManagerOnDemandReactPackage.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ViewManagerOnDemandReactPackage.java index 3644716614bd1e..758b7cbdc7aee7 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ViewManagerOnDemandReactPackage.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ViewManagerOnDemandReactPackage.java @@ -18,6 +18,7 @@ public interface ViewManagerOnDemandReactPackage { * Typically, this is ViewManager.getName(). */ Collection getViewManagerNames(ReactApplicationContext reactContext); + /** * Creates and returns a ViewManager with a specific name {@param viewManagerName}. It's up to an * implementing package how to interpret the name. diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java index 8a719ca35af1cc..e8c66da438d322 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java @@ -441,7 +441,8 @@ private void initializeLifecycleEventListenersForViewTag(final int viewTag) { ReactSoftExceptionLogger.logSoftException( NAME, new RuntimeException( - "initializeLifecycleEventListenersForViewTag could not get NativeAnimatedNodesManager")); + "initializeLifecycleEventListenersForViewTag could not get" + + " NativeAnimatedNodesManager")); } // Subscribe to UIManager (Fabric or non-Fabric) lifecycle events if we haven't yet diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedNodesManager.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedNodesManager.java index 4c3e81288ec900..0f7ae54eb03aed 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedNodesManager.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedNodesManager.java @@ -427,7 +427,8 @@ public void connectAnimatedNodeToView(int animatedNodeTag, int viewTag) { } if (mReactApplicationContext == null) { throw new IllegalStateException( - "connectAnimatedNodeToView: Animated node could not be connected, no ReactApplicationContext: " + "connectAnimatedNodeToView: Animated node could not be connected, no" + + " ReactApplicationContext: " + viewTag); } @@ -438,7 +439,8 @@ public void connectAnimatedNodeToView(int animatedNodeTag, int viewTag) { ReactSoftExceptionLogger.logSoftException( TAG, new ReactNoCrashSoftException( - "connectAnimatedNodeToView: Animated node could not be connected to UIManager - uiManager disappeared for tag: " + "connectAnimatedNodeToView: Animated node could not be connected to UIManager -" + + " uiManager disappeared for tag: " + viewTag)); return; } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/BaseActivityEventListener.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/BaseActivityEventListener.java index 507d1ed5cae401..1569b9bd12e552 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/BaseActivityEventListener.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/BaseActivityEventListener.java @@ -14,7 +14,9 @@ /** An empty implementation of {@link ActivityEventListener} */ public class BaseActivityEventListener implements ActivityEventListener { - /** @deprecated use {@link #onActivityResult(Activity, int, int, Intent)} instead. */ + /** + * @deprecated use {@link #onActivityResult(Activity, int, int, Intent)} instead. + */ @Deprecated public void onActivityResult(int requestCode, int resultCode, Intent data) {} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/BaseJavaModule.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/BaseJavaModule.java index c6a0d33a966edd..0d2f21e209be92 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/BaseJavaModule.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/BaseJavaModule.java @@ -64,7 +64,9 @@ public BaseJavaModule(@Nullable ReactApplicationContext reactContext) { mReactApplicationContext = reactContext; } - /** @return a map of constants this module exports to JS. Supports JSON types. */ + /** + * @return a map of constants this module exports to JS. Supports JSON types. + */ @DeprecatedInNewArchitecture() public @Nullable Map getConstants() { return null; @@ -94,7 +96,8 @@ public void invalidate() {} protected final ReactApplicationContext getReactApplicationContext() { return Assertions.assertNotNull( mReactApplicationContext, - "Tried to get ReactApplicationContext even though NativeModule wasn't instantiated with one"); + "Tried to get ReactApplicationContext even though NativeModule wasn't instantiated with" + + " one"); } /** diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.java index 0ee0dd6df275ee..4b099a9ebe8cb7 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.java @@ -46,6 +46,7 @@ public interface CatalystInstance @DoNotStrip void callFunction(String module, String method, NativeArray arguments); + /** * Destroys this catalyst instance, waiting for any other threads in ReactQueueConfiguration * (besides the UI thread) to finish running. Must be called from the UI thread so that we can @@ -73,7 +74,9 @@ public interface CatalystInstance @Deprecated( since = - "getJSIModule(JSIModuleType moduleType) is deprecated and will be deleted in the future. Please use ReactInstanceEventListener to subscribe for react instance events instead.") + "getJSIModule(JSIModuleType moduleType) is deprecated and will be deleted in the future." + + " Please use ReactInstanceEventListener to subscribe for react instance events" + + " instead.") JSIModule getJSIModule(JSIModuleType moduleType); Collection getNativeModules(); @@ -136,21 +139,26 @@ public interface CatalystInstance @Deprecated( since = - "setTurboModuleManager(JSIModule getter) is deprecated and will be deleted in the future. Please use setTurboModuleRegistry(TurboModuleRegistry turboModuleRegistry)instead.") + "setTurboModuleManager(JSIModule getter) is deprecated and will be deleted in the future." + + " Please use setTurboModuleRegistry(TurboModuleRegistry" + + " turboModuleRegistry)instead.") void setTurboModuleManager(JSIModule getter); @DeprecatedInNewArchitecture( message = - "This method will be deprecated later as part of Stable APIs with bridge removal and not encouraged usage.") + "This method will be deprecated later as part of Stable APIs with bridge removal and not" + + " encouraged usage.") void setTurboModuleRegistry(TurboModuleRegistry turboModuleRegistry); @DeprecatedInNewArchitecture( message = - "This method will be deprecated later as part of Stable APIs with bridge removal and not encouraged usage.") + "This method will be deprecated later as part of Stable APIs with bridge removal and not" + + " encouraged usage.") void setFabricUIManager(UIManager fabricUIManager); @DeprecatedInNewArchitecture( message = - "This method will be deprecated later as part of Stable APIs with bridge removal and not encouraged usage.") + "This method will be deprecated later as part of Stable APIs with bridge removal and not" + + " encouraged usage.") UIManager getFabricUIManager(); } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/FallbackJSBundleLoader.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/FallbackJSBundleLoader.java index c07c67b02f611c..0a673930d6aebf 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/FallbackJSBundleLoader.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/FallbackJSBundleLoader.java @@ -31,7 +31,9 @@ public final class FallbackJSBundleLoader extends JSBundleLoader { // Reasons why we fell-back on previous loaders, in order of occurrence. private final ArrayList mRecoveredErrors = new ArrayList<>(); - /** @param loaders Loaders for the sources to try, in descending order of preference. */ + /** + * @param loaders Loaders for the sources to try, in descending order of preference. + */ public FallbackJSBundleLoader(List loaders) { mLoaders = new Stack<>(); ListIterator it = loaders.listIterator(loaders.size()); diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModulePackage.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModulePackage.java index 7095a9f40052c0..0abc647b99db7f 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModulePackage.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModulePackage.java @@ -12,7 +12,9 @@ /** Interface used to initialize JSI Modules into the JSI Bridge. */ public interface JSIModulePackage { - /** @return a {@link List< JSIModuleSpec >} that contain the list of JSI Modules. */ + /** + * @return a {@link List< JSIModuleSpec >} that contain the list of JSI Modules. + */ List getJSIModules( ReactApplicationContext reactApplicationContext, JavaScriptContextHolder jsContext); } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JavaOnlyMap.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JavaOnlyMap.java index ccce30a7d60e36..5338c28421e3a6 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JavaOnlyMap.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JavaOnlyMap.java @@ -65,7 +65,9 @@ public static JavaOnlyMap deepClone(ReadableMap map) { return res; } - /** @param keysAndValues keys and values, interleaved */ + /** + * @param keysAndValues keys and values, interleaved + */ private JavaOnlyMap(Object... keysAndValues) { if (keysAndValues.length % 2 != 0) { throw new IllegalArgumentException("You must provide the same number of keys and values"); diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ModuleSpec.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ModuleSpec.java index 26183c87a6a1f7..f1261bdc7eadcc 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ModuleSpec.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ModuleSpec.java @@ -34,7 +34,8 @@ public static ModuleSpec nativeModuleSpec( TAG, "Could not find @ReactModule annotation on " + type.getName() - + ". So creating the module eagerly to get the name. Consider adding an annotation to make this Lazy"); + + ". So creating the module eagerly to get the name. Consider adding an annotation to" + + " make this Lazy"); NativeModule nativeModule = provider.get(); return new ModuleSpec(provider, nativeModule.getName()); } else { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java index d247714c51eaa5..7fae14d06bb32f 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java @@ -197,7 +197,9 @@ public Collection getNativeModules() { return mCatalystInstance.getNativeModules(); } - /** @return the instance of the specified module interface associated with this ReactContext. */ + /** + * @return the instance of the specified module interface associated with this ReactContext. + */ @Nullable public T getNativeModule(Class nativeModuleInterface) { if (mCatalystInstance == null) { @@ -236,7 +238,9 @@ public boolean hasActiveCatalystInstance() { return hasActiveReactInstance(); } - /** @return true if there is an non-null, alive react native instance */ + /** + * @return true if there is an non-null, alive react native instance + */ public boolean hasActiveReactInstance() { return mCatalystInstance != null && !mCatalystInstance.isDestroyed(); } @@ -417,7 +421,8 @@ public void assertOnNativeModulesQueueThread(String message) { /** TODO(T85807990): Fail fast if the ReactContext isn't initialized */ if (!mIsInitialized) { throw new IllegalStateException( - "Tried to call assertOnNativeModulesQueueThread(message) on an uninitialized ReactContext"); + "Tried to call assertOnNativeModulesQueueThread(message) on an uninitialized" + + " ReactContext"); } Assertions.assertNotNull(mNativeModulesMessageQueueThread).assertIsOnThread(message); } @@ -528,7 +533,9 @@ public boolean startActivityForResult(Intent intent, int code, Bundle bundle) { return mCurrentActivity.get(); } - /** @deprecated DO NOT USE, this method will be removed in the near future. */ + /** + * @deprecated DO NOT USE, this method will be removed in the near future. + */ @Deprecated public boolean isBridgeless() { return false; @@ -549,7 +556,8 @@ public boolean isBridgeless() { @DeprecatedInNewArchitecture( message = - "This method will be deprecated later as part of Stable APIs with bridge removal and not encouraged usage.") + "This method will be deprecated later as part of Stable APIs with bridge removal and not" + + " encouraged usage.") /** * Get the UIManager for Fabric from the CatalystInstance. * diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContextBaseJavaModule.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContextBaseJavaModule.java index 64b666cb541979..3ae572a631fb96 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContextBaseJavaModule.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContextBaseJavaModule.java @@ -16,7 +16,8 @@ */ @DeprecatedInNewArchitecture( message = - "ReactContextBaseJavaModule will be deprecated in new Architecture of React Native, use BaseJavaModule instead") + "ReactContextBaseJavaModule will be deprecated in new Architecture of React Native, use" + + " BaseJavaModule instead") public abstract class ReactContextBaseJavaModule extends BaseJavaModule { public ReactContextBaseJavaModule() { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactMarker.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactMarker.java index 0a649cd29b1743..6f77b7255a76bf 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactMarker.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactMarker.java @@ -45,7 +45,8 @@ public long getMarkerTime() { public interface MarkerListener { void logMarker(ReactMarkerConstants name, @Nullable String tag, int instanceKey); - }; + } + ; // This is for verbose, Fabric-only logging // In the future we can deprecate the old logMarker API and @@ -61,7 +62,8 @@ default void logFabricMarker( int counter) { logFabricMarker(name, tag, instanceKey, timestamp); } - }; + } + ; // Use a list instead of a set here because we expect the number of listeners // to be very small, and we want listeners to be called in a deterministic diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactModuleWithSpec.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactModuleWithSpec.java index ba5fd82f69bc19..37d3ef1ac331fc 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactModuleWithSpec.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactModuleWithSpec.java @@ -9,7 +9,9 @@ import com.facebook.proguard.annotations.DoNotStrip; -/** @deprecated Use {@link TurboModule} to identify generated specs */ +/** + * @deprecated Use {@link TurboModule} to identify generated specs + */ @DoNotStrip @Deprecated public interface ReactModuleWithSpec {} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/UIManager.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/UIManager.java index a40bab35365911..9a9724b12cd9d4 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/UIManager.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/UIManager.java @@ -74,7 +74,9 @@ void updateRootLayoutSpecs( */ void dispatchCommand(int reactTag, String commandId, @Nullable ReadableArray commandArgs); - /** @return the {@link EventDispatcher} object that is used by this class. */ + /** + * @return the {@link EventDispatcher} object that is used by this class. + */ T getEventDispatcher(); /** diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/UIManagerListener.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/UIManagerListener.java index 505999b3d5af33..2911f158feaab6 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/UIManagerListener.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/UIManagerListener.java @@ -16,18 +16,21 @@ public interface UIManagerListener { *

This is called by Paper only. */ void willDispatchViewUpdates(UIManager uiManager); + /** * Called on UIThread right before view updates are executed. * *

This is called by Fabric only. */ void willMountItems(UIManager uiManager); + /** * Called on UIThread right after view updates are executed. * *

This is called by Fabric only. */ void didMountItems(UIManager uiManager); + /** * Called on UIThread right after view updates are dispatched for a frame. Note that this will be * called for every frame even if there are no updates. @@ -35,6 +38,7 @@ public interface UIManagerListener { *

This is called by Fabric only. */ void didDispatchMountItems(UIManager uiManager); + /** * Called right after scheduleMountItems is called in Fabric, after a new tree is committed. * diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/UiThreadUtil.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/UiThreadUtil.java index 024902a1e856fc..6d5631b9ad6277 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/UiThreadUtil.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/UiThreadUtil.java @@ -29,7 +29,9 @@ public static Handler getUiThreadHandler() { return sMainHandler; } - /** @return {@code true} if the current thread is the UI thread. */ + /** + * @return {@code true} if the current thread is the UI thread. + */ public static boolean isOnUiThread() { return Looper.getMainLooper().getThread() == Thread.currentThread(); } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/queue/MessageQueueThreadHandler.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/queue/MessageQueueThreadHandler.java index ddac0bfec7360f..d5f26791de96d3 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/queue/MessageQueueThreadHandler.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/queue/MessageQueueThreadHandler.java @@ -31,10 +31,13 @@ public void dispatchMessage(Message msg) { if (e instanceof NullPointerException) { FLog.e( ReactConstants.TAG, - "Caught NullPointerException when dispatching message in MessageQueueThreadHandler. This is likely caused by runnable" - + "(msg.callback) being nulled in Android Handler after dispatching and before handling (see T170239922 for more details)." - + "Currently we observe that it only happen once which is during initialisation. Due to fixing probably involve Android " - + "System code, we decide to ignore here for now and print an error message for debugging purpose in case this cause more serious issues in future."); + "Caught NullPointerException when dispatching message in MessageQueueThreadHandler." + + " This is likely caused by runnable(msg.callback) being nulled in Android Handler" + + " after dispatching and before handling (see T170239922 for more" + + " details).Currently we observe that it only happen once which is during" + + " initialisation. Due to fixing probably involve Android System code, we decide" + + " to ignore here for now and print an error message for debugging purpose in case" + + " this cause more serious issues in future."); return; } mExceptionHandler.handleException(e); diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/queue/MessageQueueThreadImpl.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/queue/MessageQueueThreadImpl.java index 223b2ff30015d2..0ea83dff954253 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/queue/MessageQueueThreadImpl.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/queue/MessageQueueThreadImpl.java @@ -187,7 +187,9 @@ public static MessageQueueThreadImpl create( } } - /** @return a MessageQueueThreadImpl corresponding to Android's main UI thread. */ + /** + * @return a MessageQueueThreadImpl corresponding to Android's main UI thread. + */ private static MessageQueueThreadImpl createForMainThread( String name, QueueThreadExceptionHandler exceptionHandler) { final MessageQueueThreadImpl mqt = diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/DebugServerException.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/DebugServerException.java index 4170256331f7d9..533408b2d40366 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/DebugServerException.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/DebugServerException.java @@ -21,12 +21,17 @@ */ public class DebugServerException extends RuntimeException { private static final String GENERIC_ERROR_MESSAGE = - "\n\nTry the following to fix the issue:\n" + "\n\n" + + "Try the following to fix the issue:\n" + "\u2022 Ensure that Metro is running\n" - + "\u2022 Ensure that your device/emulator is connected to your machine and has USB debugging enabled - run 'adb devices' to see a list of connected devices\n" + + "\u2022 Ensure that your device/emulator is connected to your machine and has USB" + + " debugging enabled - run 'adb devices' to see a list of connected devices\n" + "\u2022 Ensure Airplane Mode is disabled\n" - + "\u2022 If you're on a physical device connected to the same machine, run 'adb reverse tcp: tcp:' to forward requests from your device\n" - + "\u2022 If your device is on the same Wi-Fi network, set 'Debug server host & port for device' in 'Dev settings' to your machine's IP address and the port of the local dev server - e.g. 10.0.1.1:\n\n"; + + "\u2022 If you're on a physical device connected to the same machine, run 'adb reverse" + + " tcp: tcp:' to forward requests from your device\n" + + "\u2022 If your device is on the same Wi-Fi network, set 'Debug server host & port for" + + " device' in 'Dev settings' to your machine's IP address and the port of the local dev" + + " server - e.g. 10.0.1.1:\n\n"; public static DebugServerException makeGeneric( @NonNull String url, @NonNull String reason, Throwable t) { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/StandardCharsets.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/StandardCharsets.java index 4c886ef03832c6..cc2bfec6bb075f 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/StandardCharsets.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/StandardCharsets.java @@ -28,6 +28,7 @@ private StandardCharsets() {} /** Sixteen-bit UCS Transformation Format, big-endian byte order */ public static final Charset UTF_16BE = Charset.forName("UTF-16BE"); + /** Sixteen-bit UCS Transformation Format, little-endian byte order */ public static final Charset UTF_16LE = Charset.forName("UTF-16LE"); } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DebugOverlayController.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DebugOverlayController.java index 6341a5a8ee58ed..421377f7adaf24 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DebugOverlayController.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DebugOverlayController.java @@ -38,7 +38,8 @@ public static void requestPermission(Context context) { intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); FLog.w( ReactConstants.TAG, - "Overlay permissions needs to be granted in order for react native apps to run in dev mode"); + "Overlay permissions needs to be granted in order for react native apps to run in dev" + + " mode"); if (canHandleIntent(context, intent)) { context.startActivity(intent); } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DefaultDevSupportManagerFactory.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DefaultDevSupportManagerFactory.java index 0a9a2338ceb356..10decba6258e4b 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DefaultDevSupportManagerFactory.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DefaultDevSupportManagerFactory.java @@ -29,7 +29,9 @@ public class DefaultDevSupportManagerFactory implements DevSupportManagerFactory private static final String DEVSUPPORT_IMPL_PACKAGE = "com.facebook.react.devsupport"; private static final String DEVSUPPORT_IMPL_CLASS = "BridgeDevSupportManager"; - /** @deprecated in favor of the customisable create for DevSupportManagerFactory */ + /** + * @deprecated in favor of the customisable create for DevSupportManagerFactory + */ @Deprecated public DevSupportManager create( Context applicationContext, diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevServerHelper.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevServerHelper.java index a812b6a0a48d25..f67b9cb000b5d1 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevServerHelper.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevServerHelper.java @@ -336,7 +336,9 @@ public void downloadBundleFromURL( callback, outputFile, bundleURL, bundleInfo, requestBuilder); } - /** @return the host to use when connecting to the bundle server from the host itself. */ + /** + * @return the host to use when connecting to the bundle server from the host itself. + */ private String getHostForJSProxy() { // Use custom port if configured. Note that host stays "localhost". String host = Assertions.assertNotNull(mPackagerConnectionSettings.getDebugServerHost()); @@ -348,12 +350,16 @@ private String getHostForJSProxy() { } } - /** @return whether we should enable dev mode when requesting JS bundles. */ + /** + * @return whether we should enable dev mode when requesting JS bundles. + */ private boolean getDevMode() { return mSettings.isJSDevModeEnabled(); } - /** @return whether we should request minified JS bundles. */ + /** + * @return whether we should request minified JS bundles. + */ private boolean getJSMinifyMode() { return mSettings.isJSMinifyEnabled(); } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java index 05bd027eaa10fc..8f0e8762c5fd58 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java @@ -184,7 +184,8 @@ public void onReceive(Context context, Intent intent) { ? devLoadingViewManager : new DefaultDevLoadingViewImplementation(reactInstanceDevHelper); mSurfaceDelegateFactory = surfaceDelegateFactory; - }; + } + ; protected abstract String getUniqueTag(); diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/DevSplitBundleCallback.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/DevSplitBundleCallback.java index c2761d3fc813a6..24e9437211de02 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/DevSplitBundleCallback.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/DevSplitBundleCallback.java @@ -11,6 +11,7 @@ public interface DevSplitBundleCallback { /** Called when the split JS bundle has been downloaded and evaluated. */ void onSuccess(); + /** Called when the split JS bundle failed to load. */ void onError(String url, Throwable cause); } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricComponents.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricComponents.java index bf6c6a2aaa36d8..8d026c66ac5110 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricComponents.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricComponents.java @@ -42,7 +42,9 @@ public class FabricComponents { sComponentNames.put("ImpressionTrackingView", "RCTImpressionTrackingView"); } - /** @return the name of component in the Fabric environment */ + /** + * @return the name of component in the Fabric environment + */ public static String getFabricComponentName(String componentName) { String component = sComponentNames.get(componentName); return component != null ? component : componentName; diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java index 525f8ff3473269..1120f0fa3e1346 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java @@ -132,7 +132,8 @@ public class FabricUIManager implements UIManager, LifecycleEventListener { + " - Total commit time: %d ms. Avg: %.2f. Median: %.2f ms. Max: %d ms.\n" + " - Layout time: %d ms. Avg: %.2f. Median: %.2f ms. Max: %d ms.\n" + " - Diffing time: %d ms. Avg: %.2f. Median: %.2f ms. Max: %d ms.\n" - + " - FinishTransaction (Diffing + JNI serialization): %d ms. Avg: %.2f. Median: %.2f ms. Max: %d ms.\n" + + " - FinishTransaction (Diffing + JNI serialization): %d ms. Avg: %.2f. Median:" + + " %.2f ms. Max: %d ms.\n" + " - Mounting: %d ms. Avg: %.2f. Median: %.2f ms. Max: %d ms.\n", commitPoint.getCommitNumber(), commitDuration, @@ -1028,7 +1029,8 @@ public void onHostDestroy() {} public void dispatchCommand( final int reactTag, final int commandId, @Nullable final ReadableArray commandArgs) { throw new UnsupportedOperationException( - "dispatchCommand called without surfaceId - Fabric dispatchCommand must be called through Fabric JSI API"); + "dispatchCommand called without surfaceId - Fabric dispatchCommand must be called through" + + " Fabric JSI API"); } @Override @@ -1038,7 +1040,8 @@ public void dispatchCommand( public void dispatchCommand( final int reactTag, final String commandId, @Nullable final ReadableArray commandArgs) { throw new UnsupportedOperationException( - "dispatchCommand called without surfaceId - Fabric dispatchCommand must be called through Fabric JSI API"); + "dispatchCommand called without surfaceId - Fabric dispatchCommand must be called through" + + " Fabric JSI API"); } @Deprecated diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountItemDispatcher.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountItemDispatcher.java index 3261a598b041f3..c27c217fdd055d 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountItemDispatcher.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountItemDispatcher.java @@ -126,7 +126,8 @@ public void tryDispatchMountItems() { new ReactNoCrashSoftException( "Re-dispatched " + mReDispatchCounter - + " times. This indicates setState (?) is likely being called too many times during mounting.")); + + " times. This indicates setState (?) is likely being called too many times" + + " during mounting.")); } mReDispatchCounter++; diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java index 4d1df189d502b5..5547dff33d3f68 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java @@ -213,13 +213,15 @@ private void addRootView(@NonNull final View rootView) { } else if (rootView.getId() != View.NO_ID) { FLog.e( TAG, - "Trying to add RootTag to RootView that already has a tag: existing tag: [%d] new tag: [%d]", + "Trying to add RootTag to RootView that already has a tag: existing tag: [%d] new" + + " tag: [%d]", rootView.getId(), mSurfaceId); throw new IllegalViewOperationException( - "Trying to add a root view with an explicit id already set. React Native uses " - + "the id field to track react tags and will overwrite this field. If that is fine, " - + "explicitly overwrite the id field to View.NO_ID before calling addRootView."); + "Trying to add a root view with an explicit id already set. React Native uses the" + + " id field to track react tags and will overwrite this field. If that is" + + " fine, explicitly overwrite the id field to View.NO_ID before calling" + + " addRootView."); } rootView.setId(mSurfaceId); @@ -438,7 +440,8 @@ public void removeViewAt(final int tag, final int parentTag, int index) { ReactSoftExceptionLogger.logSoftException( TAG, new IllegalViewOperationException( - "removeViewAt tried to remove a React View that was actually reused. This indicates a bug in the Differ (specifically instruction ordering). [" + "removeViewAt tried to remove a React View that was actually reused. This indicates a" + + " bug in the Differ (specifically instruction ordering). [" + tag + "]")); return; @@ -1420,7 +1423,8 @@ public void doFrameGuarded(long frameTimeNanos) { ReactSoftExceptionLogger.logSoftException( TAG, new IllegalViewOperationException( - "RemoveDeleteTree recursively tried to remove a React View that was actually reused. This indicates a bug in the Differ. [" + "RemoveDeleteTree recursively tried to remove a React View that was actually" + + " reused. This indicates a bug in the Differ. [" + reactTag + "]")); continue; diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/BatchMountItem.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/BatchMountItem.java index 97c0f4f37b90ea..7d6ae64c24765f 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/BatchMountItem.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/BatchMountItem.java @@ -9,6 +9,8 @@ public interface BatchMountItem extends MountItem { - /** @return if the BatchMountItem contains any MountItem */ + /** + * @return if the BatchMountItem contains any MountItem + */ boolean isBatchEmpty(); } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/FabricNameComponentMapping.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/FabricNameComponentMapping.java index bd5e1488227c97..a3488ed73556aa 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/FabricNameComponentMapping.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/FabricNameComponentMapping.java @@ -42,7 +42,9 @@ class FabricNameComponentMapping { sComponentNames.put("ImpressionTrackingView", "RCTImpressionTrackingView"); } - /** @return the name of component in the Fabric environment */ + /** + * @return the name of component in the Fabric environment + */ static String getFabricComponentName(String componentName) { String component = sComponentNames.get(componentName); return component != null ? component : componentName; diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/MountItemFactory.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/MountItemFactory.java index b68adff51119f5..d1c00d659cf498 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/MountItemFactory.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/MountItemFactory.java @@ -16,25 +16,33 @@ /** Factory class that expose creation of {@link MountItem} */ public class MountItemFactory { - /** @return a {@link DispatchCommandMountItem} for commands identified by an int */ + /** + * @return a {@link DispatchCommandMountItem} for commands identified by an int + */ public static DispatchCommandMountItem createDispatchCommandMountItem( int surfaceId, int reactTag, int commandId, @Nullable ReadableArray commandArgs) { return new DispatchIntCommandMountItem(surfaceId, reactTag, commandId, commandArgs); } - /** @return a {@link DispatchCommandMountItem} for commands identified by a String */ + /** + * @return a {@link DispatchCommandMountItem} for commands identified by a String + */ public static DispatchCommandMountItem createDispatchCommandMountItem( int surfaceId, int reactTag, @NonNull String commandId, @Nullable ReadableArray commandArgs) { return new DispatchStringCommandMountItem(surfaceId, reactTag, commandId, commandArgs); } - /** @return a {@link MountItem} that will control the execution of an AccessibilityEvent */ + /** + * @return a {@link MountItem} that will control the execution of an AccessibilityEvent + */ public static MountItem createSendAccessibilityEventMountItem( int surfaceId, int reactTag, int eventType) { return new SendAccessibilityEventMountItem(surfaceId, reactTag, eventType); } - /** @return a {@link MountItem} that will be used to preallocate views */ + /** + * @return a {@link MountItem} that will be used to preallocate views + */ public static MountItem createPreAllocateViewMountItem( int surfaceId, int reactTag, @@ -46,6 +54,7 @@ public static MountItem createPreAllocateViewMountItem( return new PreAllocateViewMountItem( surfaceId, reactTag, component, props, stateWrapper, eventEmitterWrapper, isLayoutable); } + /** * @return a {@link MountItem} that will be read and execute a collection of MountItems serialized * in the int[] and Object[] received by parameter diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/ChoreographerProvider.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/ChoreographerProvider.java index 1cfcb2268e45b1..1d5fb949b9e5c9 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/ChoreographerProvider.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/ChoreographerProvider.java @@ -17,6 +17,7 @@ interface Choreographer { /** Posts a frame callback to run on the next frame. */ void postFrameCallback(android.view.Choreographer.FrameCallback callback); + /** Removes a previously posted frame callback. */ void removeFrameCallback(android.view.Choreographer.FrameCallback callback); } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/turbomodule/core/TurboModuleInteropUtils.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/turbomodule/core/TurboModuleInteropUtils.java index 50ce80eb46af0b..616c6366886ce7 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/turbomodule/core/TurboModuleInteropUtils.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/turbomodule/core/TurboModuleInteropUtils.java @@ -227,7 +227,8 @@ private static int getJsArgCount(String moduleName, String methodName, Class[ throw new ParsingException( moduleName, methodName, - "Unable to parse JavaScript arg count. Promises must be used as last parameter only."); + "Unable to parse JavaScript arg count. Promises must be used as last parameter" + + " only."); } return paramClasses.length - 1; diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/turbomodule/core/TurboModuleManagerDelegate.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/turbomodule/core/TurboModuleManagerDelegate.java index c80bd0e6e10a6f..92a6d8d410bace 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/turbomodule/core/TurboModuleManagerDelegate.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/turbomodule/core/TurboModuleManagerDelegate.java @@ -56,7 +56,8 @@ public NativeModule getLegacyModule(String moduleName) { public boolean unstable_isLegacyModuleRegistered(String moduleName) { return false; - }; + } + ; public List getEagerInitModuleNames() { return new ArrayList<>(); diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/module/model/ReactModuleInfo.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/module/model/ReactModuleInfo.java index ae4a56bbc3a969..ca228b3de4591a 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/module/model/ReactModuleInfo.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/module/model/ReactModuleInfo.java @@ -67,7 +67,9 @@ public boolean needsEagerInit() { return mNeedsEagerInit; } - /** @deprecated this is hardcoded to return true, regardless if the module has constants or not */ + /** + * @deprecated this is hardcoded to return true, regardless if the module has constants or not + */ @Deprecated public boolean hasConstants() { return true; diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/module/processing/ReactModuleSpecProcessor.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/module/processing/ReactModuleSpecProcessor.java index 969ea6ddb09939..5b60c1452808ad 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/module/processing/ReactModuleSpecProcessor.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/module/processing/ReactModuleSpecProcessor.java @@ -93,7 +93,8 @@ public boolean processImpl(Set annotations, RoundEnvironm reactModuleList = typeElement.getAnnotation(ReactModuleList.class); } catch (Exception ex) { throw new RuntimeException( - "Could not load classes set in @ReactModuleList.nativeModules. Check that they exist and are imported correctly on class: " + "Could not load classes set in @ReactModuleList.nativeModules. Check that they exist" + + " and are imported correctly on class: " + typeElement.getQualifiedName(), ex); } @@ -167,7 +168,8 @@ private CodeBlock getCodeBlockForReactModuleInfos(List nativeModules) if (turboModuleInterface == null) { throw new RuntimeException( - "com.facebook.react.internal.turbomodule.core.interfaces.TurboModule interface not found."); + "com.facebook.react.internal.turbomodule.core.interfaces.TurboModule interface not" + + " found."); } for (String nativeModule : nativeModules) { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/core/ChoreographerCompat.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/core/ChoreographerCompat.java index f9f4f00453c0de..10a8d22abaef87 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/core/ChoreographerCompat.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/core/ChoreographerCompat.java @@ -10,7 +10,9 @@ import android.view.Choreographer; public class ChoreographerCompat { - /** @deprecated Use Choreographer.FrameCallback instead */ + /** + * @deprecated Use Choreographer.FrameCallback instead + */ @Deprecated public abstract static class FrameCallback implements Choreographer.FrameCallback {} } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/debug/interfaces/DeveloperSettings.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/debug/interfaces/DeveloperSettings.java index 08a77564d557b0..43ad3e92b24ca3 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/debug/interfaces/DeveloperSettings.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/debug/interfaces/DeveloperSettings.java @@ -10,31 +10,47 @@ /** Provides access to React Native developers settings. */ public interface DeveloperSettings { - /** @return whether an overlay showing current FPS should be shown. */ + /** + * @return whether an overlay showing current FPS should be shown. + */ boolean isFpsDebugEnabled(); - /** @return Whether debug information about transitions should be displayed. */ + /** + * @return Whether debug information about transitions should be displayed. + */ boolean isAnimationFpsDebugEnabled(); - /** @return Whether dev mode should be enabled in JS bundles. */ + /** + * @return Whether dev mode should be enabled in JS bundles. + */ boolean isJSDevModeEnabled(); - /** @return Whether JS bundle should be minified. */ + /** + * @return Whether JS bundle should be minified. + */ boolean isJSMinifyEnabled(); - /** @return Whether element inspector is enabled. */ + /** + * @return Whether element inspector is enabled. + */ boolean isElementInspectorEnabled(); - /** @return Whether Nuclide JS debugging is enabled. */ + /** + * @return Whether Nuclide JS debugging is enabled. + */ boolean isDeviceDebugEnabled(); - /** @return Whether remote JS debugging is enabled. */ + /** + * @return Whether remote JS debugging is enabled. + */ boolean isRemoteJSDebugEnabled(); /** Enable/Disable remote JS debugging. */ void setRemoteJSDebugEnabled(boolean remoteJSDebugEnabled); - /** @return Whether Start Sampling Profiler on App Start is enabled. */ + /** + * @return Whether Start Sampling Profiler on App Start is enabled. + */ boolean isStartSamplingProfilerOnInit(); /** Add an item to the dev menu. */ diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/fresco/ReactOkHttpNetworkFetcher.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/fresco/ReactOkHttpNetworkFetcher.java index 18a7ce9d8d042d..557c6ca9ec30f3 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/fresco/ReactOkHttpNetworkFetcher.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/fresco/ReactOkHttpNetworkFetcher.java @@ -29,7 +29,9 @@ class ReactOkHttpNetworkFetcher extends OkHttpNetworkFetcher { private final OkHttpClient mOkHttpClient; private final Executor mCancellationExecutor; - /** @param okHttpClient client to use */ + /** + * @param okHttpClient client to use + */ public ReactOkHttpNetworkFetcher(OkHttpClient okHttpClient) { super(okHttpClient); mOkHttpClient = okHttpClient; diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkingModule.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkingModule.java index ca37fb2ed6524c..797115b160d9b4 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkingModule.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkingModule.java @@ -139,7 +139,9 @@ public NetworkingModule( this(context, defaultUserAgent, client, null); } - /** @param context the ReactContext of the application */ + /** + * @param context the ReactContext of the application + */ public NetworkingModule(final ReactApplicationContext context) { this(context, null, OkHttpClientProvider.createClient(context), null); } @@ -256,7 +258,9 @@ public void sendRequest( } } - /** @param timeout value of 0 results in no timeout */ + /** + * @param timeout value of 0 results in no timeout + */ public void sendRequestInternal( String method, String url, diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/network/OkHttpClientFactory.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/network/OkHttpClientFactory.java index 684d4a6165116b..ef1adbb198f2f2 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/network/OkHttpClientFactory.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/network/OkHttpClientFactory.java @@ -11,4 +11,5 @@ public interface OkHttpClientFactory { OkHttpClient createNewNetworkModuleClient(); -}; +} +; diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/network/ProgressiveStringDecoder.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/network/ProgressiveStringDecoder.java index 8580c14f5b8a1e..35646952b2c2a2 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/network/ProgressiveStringDecoder.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/network/ProgressiveStringDecoder.java @@ -31,7 +31,9 @@ class ProgressiveStringDecoder { private byte[] remainder = null; - /** @param charset expected charset of the data */ + /** + * @param charset expected charset of the data + */ public ProgressiveStringDecoder(Charset charset) { mDecoder = charset.newDecoder(); } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/FileIoHandler.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/FileIoHandler.java index 50dff8ff5486d9..2d8afa6ba2194b 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/FileIoHandler.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/FileIoHandler.java @@ -51,7 +51,8 @@ public String read(int size) throws IOException { public void close() throws IOException { mStream.close(); } - }; + } + ; private int mNextHandle; private final Handler mHandler; 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 cd929cc3b50d24..f37ae613672a0a 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 @@ -481,7 +481,8 @@ public TaskInterface destroy(String reason, @Nullable Exception ex) { if (mReloadTask != null) { log( method, - "Reloading React Native. Waiting for reload to finish before destroying React Native."); + "Reloading React Native. Waiting for reload to finish before destroying React" + + " Native."); return mReloadTask.continueWithTask( task -> getOrCreateDestroyTask(reason, ex), mBGExecutor); } @@ -573,7 +574,8 @@ T getNativeModule(Class nativeModuleInterface) { ReactSoftExceptionLogger.logSoftExceptionVerbose( TAG, new ReactNoCrashBridgeNotAllowedSoftException( - "getNativeModule(UIManagerModule.class) cannot be called when the bridge is disabled")); + "getNativeModule(UIManagerModule.class) cannot be called when the bridge is" + + " disabled")); } final ReactInstance reactInstance = mReactInstanceTaskRef.get().getResult(); diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactInstance.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactInstance.java index f9191d23d5b81d..99e17f66ce60eb 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactInstance.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactInstance.java @@ -489,7 +489,8 @@ public void handleMemoryPressure(int level) { ReactSoftExceptionLogger.logSoftException( TAG, new ReactNoCrashSoftException( - "Native method handleMemoryPressureJs is called earlier than librninstance.so got ready.")); + "Native method handleMemoryPressureJs is called earlier than librninstance.so got" + + " ready.")); } } @@ -500,7 +501,9 @@ public void handleMemoryPressure(int level) { return mFabricUIManager.getEventDispatcher(); } - /** @return The {@link FabricUIManager} if it's been initialized. */ + /** + * @return The {@link FabricUIManager} if it's been initialized. + */ /* package */ FabricUIManager getUIManager() { return mFabricUIManager; } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/AggregateException.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/AggregateException.java index fc90a3006c92d8..1c918d50a5fdd8 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/AggregateException.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/AggregateException.java @@ -103,7 +103,9 @@ public void printStackTrace(@NonNull PrintWriter err) { } } - /** @deprecated Please use {@link #getInnerThrowables()} instead. */ + /** + * @deprecated Please use {@link #getInnerThrowables()} instead. + */ @Deprecated public @NonNull List getErrors() { List errors = new ArrayList(); @@ -121,7 +123,9 @@ public void printStackTrace(@NonNull PrintWriter err) { return errors; } - /** @deprecated Please use {@link #getInnerThrowables()} instead. */ + /** + * @deprecated Please use {@link #getInnerThrowables()} instead. + */ @Deprecated public @NonNull Throwable[] getCauses() { return innerThrowables.toArray(new Throwable[innerThrowables.size()]); diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/AndroidExecutors.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/AndroidExecutors.java index 49518ccc90db0b..436643ae444f4e 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/AndroidExecutors.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/AndroidExecutors.java @@ -52,6 +52,7 @@ private AndroidExecutors() { *

https://github.com/android/platform_frameworks_base/commit/719c44e03b97e850a46136ba336d729f5fbd1f47 */ private static final int CPU_COUNT = Runtime.getRuntime().availableProcessors(); + /* package */ static final int CORE_POOL_SIZE = CPU_COUNT + 1; /* package */ static final int MAX_POOL_SIZE = CPU_COUNT * 2 + 1; /* package */ static final long KEEP_ALIVE_TIME = 1L; diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/CancellationTokenSource.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/CancellationTokenSource.java index 3febccbb7ce0bc..d86f12a64c8696 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/CancellationTokenSource.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/CancellationTokenSource.java @@ -49,7 +49,9 @@ public boolean isCancellationRequested() { } } - /** @return the token that can be passed to asynchronous method to control cancellation. */ + /** + * @return the token that can be passed to asynchronous method to control cancellation. + */ public @NonNull CancellationToken getToken() { synchronized (lock) { throwIfClosed(); diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/Task.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/Task.java index 1f4db71e3368bf..a41a9c224c7c76 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/Task.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/Task.java @@ -121,7 +121,9 @@ public boolean isCompleted() { } } - /** @return {@code true} if the task was cancelled, {@code false} otherwise. */ + /** + * @return {@code true} if the task was cancelled, {@code false} otherwise. + */ @Override public boolean isCancelled() { synchronized (lock) { @@ -129,7 +131,9 @@ public boolean isCancelled() { } } - /** @return {@code true} if the task has an error, {@code false} otherwise. */ + /** + * @return {@code true} if the task has an error, {@code false} otherwise. + */ @Override public boolean isFaulted() { synchronized (lock) { @@ -137,7 +141,9 @@ public boolean isFaulted() { } } - /** @return The result of the task, if set. {@code null} otherwise. */ + /** + * @return The result of the task, if set. {@code null} otherwise. + */ @Override public TResult getResult() { synchronized (lock) { @@ -145,7 +151,9 @@ public TResult getResult() { } } - /** @return The error for the task, if set. {@code null} otherwise. */ + /** + * @return The error for the task, if set. {@code null} otherwise. + */ @Override public Exception getError() { synchronized (lock) { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/TaskCompletionSource.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/TaskCompletionSource.java index 49884cea16cc5b..080c6c43a231f2 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/TaskCompletionSource.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/internal/bolts/TaskCompletionSource.java @@ -28,7 +28,9 @@ public TaskCompletionSource() { task = new Task<>(); } - /** @return the Task associated with this TaskCompletionSource. */ + /** + * @return the Task associated with this TaskCompletionSource. + */ public @NonNull Task getTask() { return task; } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java index b06dcc7d745983..aaf6717473212e 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java @@ -193,7 +193,9 @@ private static void appendMap( map.put(name, ModuleSpec.viewManagerSpec(provider)); } - /** @return a map of view managers that should be registered with {@link UIManagerModule} */ + /** + * @return a map of view managers that should be registered with {@link UIManagerModule} + */ @SuppressLint("VisibleForTests") public Map getViewManagersMap() { if (mViewManagers == null) { @@ -306,11 +308,13 @@ public ReactModuleInfoProvider getReactModuleInfoProvider() { return () -> reactModuleInfoMap; } catch (InstantiationException e) { throw new RuntimeException( - "No ReactModuleInfoProvider for com.facebook.react.shell.MainReactPackage$$ReactModuleInfoProvider", + "No ReactModuleInfoProvider for" + + " com.facebook.react.shell.MainReactPackage$$ReactModuleInfoProvider", e); } catch (IllegalAccessException e) { throw new RuntimeException( - "No ReactModuleInfoProvider for com.facebook.react.shell.MainReactPackage$$ReactModuleInfoProvider", + "No ReactModuleInfoProvider for" + + " com.facebook.react.shell.MainReactPackage$$ReactModuleInfoProvider", e); } } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/FabricViewStateManager.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/FabricViewStateManager.java index 02ea431f7f4828..aab49abf116e61 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/FabricViewStateManager.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/FabricViewStateManager.java @@ -26,7 +26,8 @@ */ @Deprecated( since = - "Deprecated class since v0.73.0, please use com.facebook.react.uimanager.StateWrapper instead.", + "Deprecated class since v0.73.0, please use com.facebook.react.uimanager.StateWrapper" + + " instead.", forRemoval = true) public class FabricViewStateManager { private static final String TAG = "FabricViewStateManager"; diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/IViewGroupManager.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/IViewGroupManager.java index 9dd93bb58724dd..9ae89aa3fd5968 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/IViewGroupManager.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/IViewGroupManager.java @@ -16,7 +16,9 @@ public interface IViewGroupManager extends IViewManagerWithChild /** Adds a child view into the parent at the index specified as a parameter */ void addView(T parent, View child, int index); - /** @return child of the parent view at the index specified as a parameter. */ + /** + * @return child of the parent view at the index specified as a parameter. + */ View getChildAt(T parent, int index); /** Removes View from the parent View at the index specified as a parameter. */ diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/MatrixMathHelper.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/MatrixMathHelper.java index 0d698f7918965e..b352398c1466e3 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/MatrixMathHelper.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/MatrixMathHelper.java @@ -98,7 +98,9 @@ public static void multiplyInto(double[] out, double[] a, double[] b) { out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; } - /** @param transformMatrix 16-element array of numbers representing 4x4 transform matrix */ + /** + * @param transformMatrix 16-element array of numbers representing 4x4 transform matrix + */ public static void decomposeMatrix(double[] transformMatrix, MatrixDecompositionContext ctx) { Assertions.assertCondition(transformMatrix.length == 16); diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java index 4aa409213b896e..7bc971fd73e03b 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java @@ -603,10 +603,9 @@ protected final synchronized void addRootViewGroup(int tag, View view) { TAG, "Trying to add a root view with an explicit id (" + view.getId() - + ") already " - + "set. React Native uses the id field to track react tags and will overwrite this field. " - + "If that is fine, explicitly overwrite the id field to View.NO_ID before calling " - + "addRootView."); + + ") already set. React Native uses the id field to track react tags and will" + + " overwrite this field. If that is fine, explicitly overwrite the id field to" + + " View.NO_ID before calling addRootView."); } mTagsToViews.put(tag, view); diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/PixelUtil.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/PixelUtil.java index b38c1beeeb0519..1521300f99cd91 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/PixelUtil.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/PixelUtil.java @@ -51,7 +51,9 @@ public static float toDIPFromPixel(float value) { return value / DisplayMetricsHolder.getWindowDisplayMetrics().density; } - /** @return {@link float} that represents the density of the display metrics for device screen. */ + /** + * @return {@link float} that represents the density of the display metrics for device screen. + */ public static float getDisplayMetricDensity() { return DisplayMetricsHolder.getWindowDisplayMetrics().density; } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactRoot.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactRoot.java index 20a89f746bf249..77c9d6acc5adf2 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactRoot.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactRoot.java @@ -18,6 +18,7 @@ public interface ReactRoot { /** This constant represents that ReactRoot hasn't started yet or it has been destroyed. */ int STATE_STOPPED = 0; + /** This constant represents that ReactRoot has started. */ int STATE_STARTED = 1; @@ -44,10 +45,14 @@ public interface ReactRoot { /** Return native view for root */ ViewGroup getRootViewGroup(); - /** @return Cached values for widthMeasureSpec. */ + /** + * @return Cached values for widthMeasureSpec. + */ int getWidthMeasureSpec(); - /** @return Cached values for and heightMeasureSpec. */ + /** + * @return Cached values for and heightMeasureSpec. + */ int getHeightMeasureSpec(); /** Sets a flag that determines whether to log that content appeared on next view added. */ @@ -62,6 +67,8 @@ public interface ReactRoot { @Nullable String getSurfaceID(); - /** @return an {@link AtomicInteger} that represents the state of the ReactRoot object. */ + /** + * @return an {@link AtomicInteger} that represents the state of the ReactRoot object. + */ AtomicInteger getState(); } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNode.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNode.java index efaba33cdc3f3a..f2c698c45a6065 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNode.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNode.java @@ -254,16 +254,24 @@ public interface ReactShadowNode { float getLayoutHeight(); - /** @return the x position of the corresponding view on the screen, rounded to pixels */ + /** + * @return the x position of the corresponding view on the screen, rounded to pixels + */ int getScreenX(); - /** @return the y position of the corresponding view on the screen, rounded to pixels */ + /** + * @return the y position of the corresponding view on the screen, rounded to pixels + */ int getScreenY(); - /** @return width corrected for rounding to pixels. */ + /** + * @return width corrected for rounding to pixels. + */ int getScreenWidth(); - /** @return height corrected for rounding to pixels. */ + /** + * @return height corrected for rounding to pixels. + */ int getScreenHeight(); YogaDirection getLayoutDirection(); diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNodeImpl.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNodeImpl.java index 1bb6e9ee4c1b6a..c08b1c73b6b067 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNodeImpl.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNodeImpl.java @@ -685,25 +685,33 @@ public final float getLayoutHeight() { return mYogaNode.getLayoutHeight(); } - /** @return the x position of the corresponding view on the screen, rounded to pixels */ + /** + * @return the x position of the corresponding view on the screen, rounded to pixels + */ @Override public int getScreenX() { return mScreenX; } - /** @return the y position of the corresponding view on the screen, rounded to pixels */ + /** + * @return the y position of the corresponding view on the screen, rounded to pixels + */ @Override public int getScreenY() { return mScreenY; } - /** @return width corrected for rounding to pixels. */ + /** + * @return width corrected for rounding to pixels. + */ @Override public int getScreenWidth() { return mScreenWidth; } - /** @return height corrected for rounding to pixels. */ + /** + * @return height corrected for rounding to pixels. + */ @Override public int getScreenHeight() { return mScreenHeight; diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/RootView.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/RootView.java index cf588887d93a76..4c501d88f99a29 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/RootView.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/RootView.java @@ -19,7 +19,9 @@ public interface RootView { */ void onChildStartedNativeGesture(View childView, MotionEvent ev); - /** @deprecated */ + /** + * @deprecated + */ @Deprecated default void onChildStartedNativeGesture(MotionEvent ev) { onChildStartedNativeGesture(null, ev); diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/Spacing.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/Spacing.java index 9ff37664d52b67..3c3eefa9254bd7 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/Spacing.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/Spacing.java @@ -19,38 +19,49 @@ public class Spacing { /** Spacing type that represents the left direction. E.g. {@code marginLeft}. */ public static final int LEFT = 0; + /** Spacing type that represents the top direction. E.g. {@code marginTop}. */ public static final int TOP = 1; + /** Spacing type that represents the right direction. E.g. {@code marginRight}. */ public static final int RIGHT = 2; + /** Spacing type that represents the bottom direction. E.g. {@code marginBottom}. */ public static final int BOTTOM = 3; + /** * Spacing type that represents start direction e.g. left in left-to-right, right in * right-to-left. */ public static final int START = 4; + /** * Spacing type that represents end direction e.g. right in left-to-right, left in right-to-left. */ public static final int END = 5; + /** * Spacing type that represents horizontal direction (left and right). E.g. {@code * marginHorizontal}. */ public static final int HORIZONTAL = 6; + /** * Spacing type that represents vertical direction (top and bottom). E.g. {@code marginVertical}. */ public static final int VERTICAL = 7; + /** * Spacing type that represents all directions (left, top, right, bottom). E.g. {@code margin}. */ public static final int ALL = 8; + /** Spacing type that represents block directions (top, bottom). E.g. {@code marginBlock}. */ public static final int BLOCK = 9; + /** Spacing type that represents the block end direction (bottom). E.g. {@code marginBlockEnd}. */ public static final int BLOCK_END = 10; + /** * Spacing type that represents the block start direction (top). E.g. {@code marginBlockStart}. */ diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerHelper.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerHelper.java index 52f635eaa6aac0..e4841d1ee593eb 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerHelper.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerHelper.java @@ -34,13 +34,17 @@ public class UIManagerHelper { public static final int PADDING_TOP_INDEX = 2; public static final int PADDING_BOTTOM_INDEX = 3; - /** @return a {@link UIManager} that can handle the react tag received by parameter. */ + /** + * @return a {@link UIManager} that can handle the react tag received by parameter. + */ @Nullable public static UIManager getUIManagerForReactTag(ReactContext context, int reactTag) { return getUIManager(context, getUIManagerType(reactTag)); } - /** @return a {@link UIManager} that can handle the react tag received by parameter. */ + /** + * @return a {@link UIManager} that can handle the react tag received by parameter. + */ @Nullable public static UIManager getUIManager(ReactContext context, @UIManagerType int uiManagerType) { return getUIManager(context, uiManagerType, true); @@ -76,7 +80,8 @@ private static UIManager getUIManager( ReactSoftExceptionLogger.logSoftException( TAG, new ReactNoCrashSoftException( - "Cannot get UIManager because the context doesn't contain an active CatalystInstance.")); + "Cannot get UIManager because the context doesn't contain an active" + + " CatalystInstance.")); if (returnNullIfCatalystIsInactive) { return null; } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/Event.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/Event.java index ba933b49f4eec3..2e830d64b6f1d6 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/Event.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/Event.java @@ -70,12 +70,16 @@ protected void init(int surfaceId, int viewTag, long timestampMs) { mInitialized = true; } - /** @return the view id for the view that generated this event */ + /** + * @return the view id for the view that generated this event + */ public final int getViewTag() { return mViewTag; } - /** @return the surfaceId for the view that generated this event */ + /** + * @return the surfaceId for the view that generated this event + */ public final int getSurfaceId() { return mSurfaceId; } @@ -88,7 +92,9 @@ public final long getTimestampMs() { return mTimestampMs; } - /** @return false if this Event can *never* be coalesced */ + /** + * @return false if this Event can *never* be coalesced + */ public boolean canCoalesce() { return true; } @@ -114,7 +120,9 @@ public short getCoalescingKey() { return 0; } - /** @return The unique id of this event. */ + /** + * @return The unique id of this event. + */ public int getUniqueID() { return mUniqueID; } @@ -134,7 +142,9 @@ public void onDispose() {} onDispose(); } - /** @return the name of this event as registered in JS */ + /** + * @return the name of this event as registered in JS + */ public abstract String getEventName(); public EventAnimationDriverMatchSpec getEventAnimationDriverMatchSpec() { @@ -144,7 +154,8 @@ public EventAnimationDriverMatchSpec getEventAnimationDriverMatchSpec() { @Override public boolean match(int viewTag, String eventName) { return viewTag == getViewTag() && eventName.equals(getEventName()); - }; + } + ; }; } return mEventAnimationDriverMatchSpec; diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/PointerEvent.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/PointerEvent.java index 66f3c1bdcfc12c..b4ed223d41ed0d 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/PointerEvent.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/PointerEvent.java @@ -102,7 +102,8 @@ public void dispatch(RCTEventEmitter rctEventEmitter) { ReactSoftExceptionLogger.logSoftException( TAG, new IllegalStateException( - "Cannot dispatch a Pointer that has no MotionEvent; the PointerEvehas been recycled")); + "Cannot dispatch a Pointer that has no MotionEvent; the PointerEvehas been" + + " recycled")); return; } if (mPointersEventData == null) { @@ -308,7 +309,8 @@ public void dispatchModern(RCTModernEventEmitter rctEventEmitter) { ReactSoftExceptionLogger.logSoftException( TAG, new IllegalStateException( - "Cannot dispatch a Pointer that has no MotionEvent; the PointerEvehas been recycled")); + "Cannot dispatch a Pointer that has no MotionEvent; the PointerEvehas been" + + " recycled")); return; } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/RCTModernEventEmitter.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/RCTModernEventEmitter.java index 4acb3351da4a5d..056c7dcdf3e215 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/RCTModernEventEmitter.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/RCTModernEventEmitter.java @@ -31,7 +31,9 @@ void receiveEvent( @Nullable WritableMap event, @EventCategoryDef int category); - /** @deprecated Dispatch the TouchEvent using {@link EventDispatcher} instead */ + /** + * @deprecated Dispatch the TouchEvent using {@link EventDispatcher} instead + */ @Deprecated void receiveTouches(TouchEvent event); } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/TouchEvent.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/TouchEvent.java index 16aceaf3ef6e34..494c52a902bc52 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/TouchEvent.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/TouchEvent.java @@ -227,7 +227,8 @@ private boolean verifyMotionEvent() { ReactSoftExceptionLogger.logSoftException( TAG, new IllegalStateException( - "Cannot dispatch a TouchEvent that has no MotionEvent; the TouchEvent has been recycled")); + "Cannot dispatch a TouchEvent that has no MotionEvent; the TouchEvent has been" + + " recycled")); return false; } return true; diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/TouchesHelper.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/TouchesHelper.java index 922b15ce4facd1..a4e0d685dac2ce 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/TouchesHelper.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/TouchesHelper.java @@ -128,7 +128,8 @@ private static WritableMap[] createPointersArray(TouchEvent event) { ReactSoftExceptionLogger.logSoftException( TAG, new IllegalStateException( - "Cannot dispatch a TouchEvent that has no MotionEvent; the TouchEvent has been recycled")); + "Cannot dispatch a TouchEvent that has no MotionEvent; the TouchEvent has been" + + " recycled")); return; } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/debuggingoverlay/DebuggingOverlayManager.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/debuggingoverlay/DebuggingOverlayManager.java index 7a9b8d4c004508..176d60baa69fe4 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/debuggingoverlay/DebuggingOverlayManager.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/debuggingoverlay/DebuggingOverlayManager.java @@ -50,7 +50,8 @@ public void receiveCommand( ReactSoftExceptionLogger.logSoftException( REACT_CLASS, new ReactNoCrashSoftException( - "Unexpected payload for highlighting trace updates: rectangle field is null")); + "Unexpected payload for highlighting trace updates: rectangle field is" + + " null")); successfullyParsedPayload = false; break; @@ -77,7 +78,8 @@ public void receiveCommand( ReactSoftExceptionLogger.logSoftException( REACT_CLASS, new ReactNoCrashSoftException( - "Unexpected payload for highlighting trace updates: rectangle field should have x, y, width, height fields")); + "Unexpected payload for highlighting trace updates: rectangle field should" + + " have x, y, width, height fields")); successfullyParsedPayload = false; break; @@ -121,7 +123,8 @@ public void receiveCommand( ReactSoftExceptionLogger.logSoftException( REACT_CLASS, new ReactNoCrashSoftException( - "Unexpected payload for highlighting elements: every element should have x, y, width, height fields")); + "Unexpected payload for highlighting elements: every element should have x," + + " y, width, height fields")); successfullyParsedPayload = false; break; diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageManager.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageManager.java index 67345805224b87..4850f56a118d5c 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageManager.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageManager.java @@ -94,7 +94,9 @@ public AbstractDraweeControllerBuilder getDraweeControllerBuilder() { return mDraweeControllerBuilder; } - /** @deprecated use {@link ReactCallerContextFactory} instead */ + /** + * @deprecated use {@link ReactCallerContextFactory} instead + */ @Deprecated public Object getCallerContext() { return mCallerContext; diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.java index 2ae3bb9bda3c1b..236e74dfabfa82 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.java @@ -416,7 +416,8 @@ public StateWrapper getStateWrapper() { public void setStateWrapper(StateWrapper stateWrapper) { mHostView.setStateWrapper(stateWrapper); - }; + } + ; public void updateState(final int width, final int height) { mHostView.updateState(width, height); diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java index 7dbcb788c3ac32..ec32a664f01d4d 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java @@ -175,8 +175,8 @@ private OverScroller getOverScrollerFromParent() { } else { FLog.w( TAG, - "Failed to cast mScroller field in HorizontalScrollView (probably due to OEM changes to AOSP)! " - + "This app will exhibit the bounce-back scrolling bug :("); + "Failed to cast mScroller field in HorizontalScrollView (probably due to OEM changes" + + " to AOSP)! This app will exhibit the bounce-back scrolling bug :("); scroller = null; } } catch (IllegalAccessException e) { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java index f66ed102018ab9..66ad8f90bcd14d 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java @@ -1189,7 +1189,8 @@ public void setScrollAwayTopPaddingEnabledUnstable(int topPadding) { Assertions.assertCondition( count <= 1, - "React Native ScrollView should not have more than one child, it should have exactly 1 child; a content View"); + "React Native ScrollView should not have more than one child, it should have exactly 1" + + " child; a content View"); if (count > 0) { for (int i = 0; i < count; i++) { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewAccessibilityDelegate.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewAccessibilityDelegate.java index d895f6333dd967..80e2d2e33dded9 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewAccessibilityDelegate.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewAccessibilityDelegate.java @@ -31,7 +31,8 @@ public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) ReactSoftExceptionLogger.logSoftException( TAG, new AssertionException( - "ReactScrollViewAccessibilityDelegate should only be used with ReactScrollView or ReactHorizontalScrollView, not with class: " + "ReactScrollViewAccessibilityDelegate should only be used with ReactScrollView or" + + " ReactHorizontalScrollView, not with class: " + host.getClass().getSimpleName())); } } @@ -45,10 +46,12 @@ public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCo ReactSoftExceptionLogger.logSoftException( TAG, new AssertionException( - "ReactScrollViewAccessibilityDelegate should only be used with ReactScrollView or ReactHorizontalScrollView, not with class: " + "ReactScrollViewAccessibilityDelegate should only be used with ReactScrollView or" + + " ReactHorizontalScrollView, not with class: " + host.getClass().getSimpleName())); } - }; + } + ; private void onInitializeAccessibilityEventInternal(View view, AccessibilityEvent event) { final ReadableMap accessibilityCollection = @@ -152,4 +155,5 @@ private void onInitializeAccessibilityNodeInfoInternal( info.setScrollable(scrollView.getScrollEnabled()); } } -}; +} +; diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java index c5cabecf7047f6..bb1a82bdd50e13 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java @@ -459,6 +459,7 @@ protected Spannable spannedFromShadowNode( protected int mFontStyle = ReactConstants.UNSET; protected int mFontWeight = ReactConstants.UNSET; + /** * NB: If a font family is used that does not have a style in a certain Android version (ie. * monospace bold pre Android 5.0), that style (ie. bold) will not be inherited by nested Text @@ -482,7 +483,9 @@ protected Spannable spannedFromShadowNode( */ protected @Nullable String mFontFamily = null; - /** @see android.graphics.Paint#setFontFeatureSettings */ + /** + * @see android.graphics.Paint#setFontFeatureSettings + */ protected @Nullable String mFontFeatureSettings = null; protected boolean mContainsImages = false; diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java index 25791e00679b34..e49f7102623ad3 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java @@ -109,6 +109,7 @@ public class TextAttributeProps implements EffectiveTextAttributeProvider { protected int mFontStyle = ReactConstants.UNSET; protected int mFontWeight = ReactConstants.UNSET; + /** * NB: If a font family is used that does not have a style in a certain Android version (ie. * monospace bold pre Android 5.0), that style (ie. bold) will not be inherited by nested Text @@ -132,7 +133,9 @@ public class TextAttributeProps implements EffectiveTextAttributeProvider { */ protected @Nullable String mFontFamily = null; - /** @see android.graphics.Paint#setFontFeatureSettings */ + /** + * @see android.graphics.Paint#setFontFeatureSettings + */ protected @Nullable String mFontFeatureSettings = null; protected boolean mContainsImages = false; diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java index 0915a49a0bb214..b3973683bab0cc 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java @@ -664,7 +664,8 @@ public void setContextMenuHidden(ReactEditText view, boolean contextMenuHidden) new View.OnLongClickListener() { public boolean onLongClick(View v) { return _contextMenuHidden; - }; + } + ; }); } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java index 6bd724ecb3424d..f05da93da38461 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java @@ -666,8 +666,8 @@ public void run() { ReactSoftExceptionLogger.logSoftException( TAG, new ReactNoCrashSoftException( - "Child view has been added to Parent view in which it is clipped and not visible." - + " This is not legal for this particular child view. Child: [" + "Child view has been added to Parent view in which it is clipped and not" + + " visible. This is not legal for this particular child view. Child: [" + child.getId() + "] " + child.toString() diff --git a/packages/react-native/ReactCommon/react/nativemodule/samples/platform/android/SampleTurboModule.java b/packages/react-native/ReactCommon/react/nativemodule/samples/platform/android/SampleTurboModule.java index 447f74529f4797..866f7c2e6ab6c1 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/samples/platform/android/SampleTurboModule.java +++ b/packages/react-native/ReactCommon/react/nativemodule/samples/platform/android/SampleTurboModule.java @@ -185,7 +185,8 @@ public void getValueWithPromise(boolean error, Promise promise) { @SuppressWarnings("unused") public void voidFuncThrows() { throw new RuntimeException("Intentional exception from JVM voidFuncThrows"); - }; + } + ; @Override @DoNotStrip @@ -193,21 +194,24 @@ public void voidFuncThrows() { public WritableMap getObjectThrows(ReadableMap arg) { throw new RuntimeException( "Intentional exception from JVM getObjectThrows with " + arg.toString()); - }; + } + ; @Override @DoNotStrip @SuppressWarnings("unused") public void promiseThrows(Promise promise) { throw new RuntimeException("Intentional exception from JVM promiseThrows"); - }; + } + ; @Override @DoNotStrip @SuppressWarnings("unused") public void voidFuncAssert() { assert false : "Intentional assert from JVM voidFuncAssert"; - }; + } + ; @Override @DoNotStrip @@ -215,14 +219,16 @@ public void voidFuncAssert() { public WritableMap getObjectAssert(ReadableMap arg) { assert false : "Intentional assert from JVM getObjectAssert with " + arg.toString(); return null; - }; + } + ; @Override @DoNotStrip @SuppressWarnings("unused") public void promiseAssert(Promise promise) { assert false : "Intentional assert from JVM promiseAssert"; - }; + } + ; private void log(String method, Object input, Object output) { if (mToast != null) {