Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
Walkthrough
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This is an invalid fix for this issue |
Fixes #1631
Summary
Fix a false positive where NullAway incorrectly reports that a
@NonNullvalue is required for a record component annotated with a type-use@Nullableannotation when the record defines a compact (custom) constructor.Root Cause
When analyzing canonical record constructors, NullAway only considered annotations attached directly to the constructor parameter. For canonical record constructors, the corresponding record component also carries relevant nullability annotations, but these were not being considered during analysis, causing the
@Nullableannotation to be missed in this scenario.Fix
Update
NullabilityUtil.getAllAnnotationsForParameterto detect canonical record constructors and retrieve annotations from the corresponding record component in addition to the constructor parameter. This ensures that declaration and type-use annotations on record components are available during nullability analysis.Tests
Added a regression test that reproduces the issue using a record with a compact constructor and a type-use
@Nullablearray component. The test fails without the fix and passes with the fix.Summary by CodeRabbit
Bug Fixes
Tests