Skip to content

Comments

Fix infinite recursion in ReactPropAnnotationSetterSpecTest#55662

Open
edelron wants to merge 1 commit intofacebook:mainfrom
edelron:export-D93927939
Open

Fix infinite recursion in ReactPropAnnotationSetterSpecTest#55662
edelron wants to merge 1 commit intofacebook:mainfrom
edelron:export-D93927939

Conversation

@edelron
Copy link

@edelron edelron commented Feb 20, 2026

Summary:
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).

Differential Revision: D93927939

Summary:
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).

Differential Revision: D93927939
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 20, 2026
@meta-codesync
Copy link

meta-codesync bot commented Feb 20, 2026

@edelron has exported this pull request. If you are a Meta employee, you can view the originating Diff in D93927939.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants