Quick refactor of string tags used in UIManagerHelper

Summary:
this is a quick refactor of the string tags used in UIManagerHelper

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D28243264

fbshipit-source-id: c32c9908d40e6184d7e940b14c9782799db3f891
This commit is contained in:
David Vacca
2021-05-06 12:13:40 -07:00
committed by Facebook GitHub Bot
parent b0e8c1eac0
commit 570c6f1f29
@@ -29,6 +29,7 @@ import com.facebook.react.uimanager.events.EventDispatcherProvider;
/** Helper class for {@link UIManager}. */
public class UIManagerHelper {
private static final String TAG = UIManagerHelper.class.getName();
public static final int PADDING_START_INDEX = 0;
public static final int PADDING_END_INDEX = 1;
public static final int PADDING_TOP_INDEX = 2;
@@ -55,7 +56,7 @@ public class UIManagerHelper {
@Nullable UIManager uiManager = (UIManager) context.getJSIModule(JSIModuleType.UIManager);
if (uiManager == null) {
ReactSoftException.logSoftException(
"UIManagerHelper",
TAG,
new ReactNoCrashSoftException(
"Cannot get UIManager because the instance hasn't been initialized yet."));
return null;
@@ -65,7 +66,7 @@ public class UIManagerHelper {
if (!context.hasCatalystInstance()) {
ReactSoftException.logSoftException(
"UIManagerHelper",
TAG,
new ReactNoCrashSoftException(
"Cannot get UIManager because the context doesn't contain a CatalystInstance."));
return null;
@@ -74,7 +75,7 @@ public class UIManagerHelper {
// down.
if (!context.hasActiveReactInstance()) {
ReactSoftException.logSoftException(
"UIManagerHelper",
TAG,
new ReactNoCrashSoftException(
"Cannot get UIManager because the context doesn't contain an active CatalystInstance."));
if (returnNullIfCatalystIsInactive) {
@@ -89,7 +90,7 @@ public class UIManagerHelper {
} catch (IllegalArgumentException ex) {
// TODO T67518514 Clean this up once we migrate everything over to bridgeless mode
ReactSoftException.logSoftException(
"UIManagerHelper",
TAG,
new ReactNoCrashSoftException(
"Cannot get UIManager for UIManagerType: " + uiManagerType));
return catalystInstance.getNativeModule(UIManagerModule.class);
@@ -105,8 +106,7 @@ public class UIManagerHelper {
EventDispatcher eventDispatcher = getEventDispatcher(context, getUIManagerType(reactTag));
if (eventDispatcher == null) {
ReactSoftException.logSoftException(
"UIManagerHelper",
new IllegalStateException("Cannot get EventDispatcher for reactTag " + reactTag));
TAG, new IllegalStateException("Cannot get EventDispatcher for reactTag " + reactTag));
}
return eventDispatcher;
}
@@ -128,7 +128,7 @@ public class UIManagerHelper {
UIManager uiManager = getUIManager(context, uiManagerType, false);
if (uiManager == null) {
ReactSoftException.logSoftException(
"UIManagerHelper",
TAG,
new ReactNoCrashSoftException(
"Unable to find UIManager for UIManagerType " + uiManagerType));
return null;
@@ -136,7 +136,7 @@ public class UIManagerHelper {
EventDispatcher eventDispatcher = (EventDispatcher) uiManager.getEventDispatcher();
if (eventDispatcher == null) {
ReactSoftException.logSoftException(
"UIManagerHelper",
TAG,
new IllegalStateException(
"Cannot get EventDispatcher for UIManagerType " + uiManagerType));
}
@@ -181,7 +181,7 @@ public class UIManagerHelper {
// All Fabric-managed Views (should) have a ThemedReactContext attached.
if (surfaceId == -1) {
ReactSoftException.logSoftException(
"UIManagerHelper",
TAG,
new IllegalStateException(
"Fabric View [" + reactTag + "] does not have SurfaceId associated with it"));
}