Skip to content

Comments

Fix infinite recursion in ReactPropAnnotationSetterSpecTest#55662

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

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.

Copy link
Contributor

@cortinico cortinico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

@meta-codesync meta-codesync bot closed this in aabdf55 Feb 23, 2026
@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by Ron Edelstein in aabdf55

When will my fix make it into a release? | How to file a pick request?

@react-native-bot react-native-bot added the Merged This PR has been merged. label Feb 23, 2026
@meta-codesync
Copy link

meta-codesync bot commented Feb 23, 2026

This pull request has been merged in aabdf55.

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 Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants