Skip to content

Commit a105ada

Browse files
mdvaccafacebook-github-bot
authored andcommitted
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
1 parent 9853072 commit a105ada

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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)