You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix ReflectionMethodUse: Remove reflection in NativeAnimatedNodesManager error messages (#55362)
Summary:
Fixed ReflectionMethodUse lint errors in NativeAnimatedNodesManager.kt.
Replaced `::class.java.name` reflection calls with hardcoded class names in
error messages to avoid issues with Redex obfuscation in production builds.
changelog: [internal] internal
Reviewed By: cortinico
Differential Revision: D91738126
Copy file name to clipboardExpand all lines: packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedNodesManager.kt
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -233,7 +233,7 @@ public class NativeAnimatedNodesManager(
233
233
)
234
234
if (node !isValueAnimatedNode) {
235
235
throwJSApplicationIllegalArgumentException(
236
-
("startAnimatingNode: Animated node [${animatedNodeTag}] should be of type ${ValueAnimatedNode::class.java.name}")
236
+
("startAnimatingNode: Animated node [${animatedNodeTag}] should be of type ValueAnimatedNode")
237
237
)
238
238
}
239
239
@@ -389,7 +389,7 @@ public class NativeAnimatedNodesManager(
389
389
)
390
390
if (node !isPropsAnimatedNode) {
391
391
throwJSApplicationIllegalArgumentException(
392
-
("connectAnimatedNodeToView: Animated node connected to view [${viewTag}] should be of type ${PropsAnimatedNode::class.java.name}")
392
+
("connectAnimatedNodeToView: Animated node connected to view [${viewTag}] should be of type PropsAnimatedNode")
393
393
)
394
394
}
395
395
checkNotNull(reactApplicationContext) {
@@ -420,7 +420,7 @@ public class NativeAnimatedNodesManager(
420
420
)
421
421
if (node !isPropsAnimatedNode) {
422
422
throwJSApplicationIllegalArgumentException(
423
-
("disconnectAnimatedNodeFromView: Animated node connected to view [${viewTag}] should be of type ${PropsAnimatedNode::class.java.name}")
423
+
("disconnectAnimatedNodeFromView: Animated node connected to view [${viewTag}] should be of type PropsAnimatedNode")
424
424
)
425
425
}
426
426
node.disconnectFromView(viewTag)
@@ -463,7 +463,7 @@ public class NativeAnimatedNodesManager(
463
463
// default values since it will never actually update the view.
464
464
if (node !isPropsAnimatedNode) {
465
465
throwJSApplicationIllegalArgumentException(
466
-
"Animated node connected to view [?] should be of type ${PropsAnimatedNode::class.java.name}"
466
+
"Animated node connected to view [?] should be of type PropsAnimatedNode"
467
467
)
468
468
}
469
469
node.restoreDefaultValues()
@@ -483,7 +483,7 @@ public class NativeAnimatedNodesManager(
483
483
)
484
484
if (node !isValueAnimatedNode) {
485
485
throwJSApplicationIllegalArgumentException(
486
-
("addAnimatedEventToView: Animated node on view [${viewTag}] connected to event handler (${eventHandlerName}) should be of type ${ValueAnimatedNode::class.java.name}")
486
+
("addAnimatedEventToView: Animated node on view [${viewTag}] connected to event handler (${eventHandlerName}) should be of type ValueAnimatedNode")
0 commit comments