Skip to content

Commit

Permalink
Quick refactor of string tags used in UIManagerHelper
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mdvacca authored and facebook-github-bot committed May 6, 2021
1 parent b0e8c1e commit 570c6f1
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
/** 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;
Expand All @@ -55,7 +56,7 @@ private static UIManager getUIManager(
@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;
Expand All @@ -65,7 +66,7 @@ private static UIManager getUIManager(

if (!context.hasCatalystInstance()) {
ReactSoftException.logSoftException(
"UIManagerHelper",
TAG,
new ReactNoCrashSoftException(
"Cannot get UIManager because the context doesn't contain a CatalystInstance."));
return null;
Expand All @@ -74,7 +75,7 @@ private static UIManager getUIManager(
// down.
if (!context.hasActiveReactInstance()) {
ReactSoftException.logSoftException(
"UIManagerHelper",
TAG,
new ReactNoCrashSoftException(
"Cannot get UIManager because the context doesn't contain an active CatalystInstance."));
if (returnNullIfCatalystIsInactive) {
Expand All @@ -89,7 +90,7 @@ private static UIManager getUIManager(
} 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);
Expand All @@ -105,8 +106,7 @@ public static EventDispatcher getEventDispatcherForReactTag(ReactContext context
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;
}
Expand All @@ -128,15 +128,15 @@ public static EventDispatcher getEventDispatcher(
UIManager uiManager = getUIManager(context, uiManagerType, false);
if (uiManager == null) {
ReactSoftException.logSoftException(
"UIManagerHelper",
TAG,
new ReactNoCrashSoftException(
"Unable to find UIManager for UIManagerType " + uiManagerType));
return null;
}
EventDispatcher eventDispatcher = (EventDispatcher) uiManager.getEventDispatcher();
if (eventDispatcher == null) {
ReactSoftException.logSoftException(
"UIManagerHelper",
TAG,
new IllegalStateException(
"Cannot get EventDispatcher for UIManagerType " + uiManagerType));
}
Expand Down Expand Up @@ -181,7 +181,7 @@ public static int getSurfaceId(View view) {
// 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"));
}
Expand Down

0 comments on commit 570c6f1

Please sign in to comment.