Skip to content

Commit 707fd69

Browse files
mdvaccameta-codesync[bot]
authored andcommitted
Fix ReflectionMethodUse: Remove reflection in NativeAnimatedNodesManager error messages (#55362)
Summary: Pull Request resolved: #55362 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 fbshipit-source-id: 42a3702f2e0f6a25c633cbfc0d13bf38abdcd413
1 parent e8590b7 commit 707fd69

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedNodesManager.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ public class NativeAnimatedNodesManager(
233233
)
234234
if (node !is ValueAnimatedNode) {
235235
throw JSApplicationIllegalArgumentException(
236-
("startAnimatingNode: Animated node [${animatedNodeTag}] should be of type ${ValueAnimatedNode::class.java.name}")
236+
("startAnimatingNode: Animated node [${animatedNodeTag}] should be of type ValueAnimatedNode")
237237
)
238238
}
239239

@@ -389,7 +389,7 @@ public class NativeAnimatedNodesManager(
389389
)
390390
if (node !is PropsAnimatedNode) {
391391
throw JSApplicationIllegalArgumentException(
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")
393393
)
394394
}
395395
checkNotNull(reactApplicationContext) {
@@ -420,7 +420,7 @@ public class NativeAnimatedNodesManager(
420420
)
421421
if (node !is PropsAnimatedNode) {
422422
throw JSApplicationIllegalArgumentException(
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")
424424
)
425425
}
426426
node.disconnectFromView(viewTag)
@@ -463,7 +463,7 @@ public class NativeAnimatedNodesManager(
463463
// default values since it will never actually update the view.
464464
if (node !is PropsAnimatedNode) {
465465
throw JSApplicationIllegalArgumentException(
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"
467467
)
468468
}
469469
node.restoreDefaultValues()
@@ -483,7 +483,7 @@ public class NativeAnimatedNodesManager(
483483
)
484484
if (node !is ValueAnimatedNode) {
485485
throw JSApplicationIllegalArgumentException(
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")
487487
)
488488
}
489489

0 commit comments

Comments
 (0)