Commit aabdf55
Fix infinite recursion in ReactPropAnnotationSetterSpecTest (#55662)
Summary:
Pull Request resolved: #55662
Fix infinite recursion bugs in `ReactPropAnnotationSetterSpecTest.kt`:
- `createShadowNodeInstance()` (line 25): Method calls itself recursively instead of creating a shadow node instance. Fixed to return `ReactShadowNodeImpl()`, which is the concrete implementation of `ReactShadowNode`.
- `createViewInstance(reactContext)` (line 30): Method calls itself recursively instead of creating a view instance. Fixed to return `View(reactContext)`, which creates a basic Android View.
Both methods are in an abstract inner `BaseViewManager` test class used to satisfy the `ViewManager` abstract contract. The test class is only used to verify `ReactProp` annotation validation, so these methods just need to return valid instances.
Detected by InfiniteRecursion lint detector (D93897169).
Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D93927939
fbshipit-source-id: b971f1fbc9e0c216e2cb9db642f34a6cbf38394a1 parent 352d73b commit aabdf55
File tree
1 file changed
+2
-3
lines changed- packages/react-native/ReactAndroid/src/test/java/com/facebook/react/uimanager
1 file changed
+2
-3
lines changedLines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
| 29 | + | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
| |||
0 commit comments