Fix for explicitly-typed lambda parameters in JDK 24+#1452
Conversation
WalkthroughThe pull request extends annotation matching logic in NullabilityUtil's hasAnyAnnotationMatching method to inspect type-use annotations via symbol.type.getAnnotationMirrors() in addition to direct symbol annotations. This supplements existing annotation checking to capture type annotations on symbols like explicitly-annotated lambda parameters. A new test case is added to GenericLambdaTests to validate the behavior of nullable lambda parameters in generic functional interface field initializers. Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1452 +/- ##
============================================
- Coverage 88.41% 88.41% -0.01%
- Complexity 2714 2715 +1
============================================
Files 99 99
Lines 9015 9019 +4
Branches 1801 1803 +2
============================================
+ Hits 7971 7974 +3
Misses 517 517
- Partials 527 528 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Main Branch: With This PR: |
In #1452 we added a comment implying that change was needed due to a `javac` bug but that was incorrect; it was our bug that was being masked before. This PR fixes the comments (no behavior change).
This case worked before JDK 24 since somehow our code that looked at the owner of a symbol found the annotation; for some reason it stopped working. Looking at annotations on the
typefield of the symbol seems to find what we need.Fixes #1448
Summary by CodeRabbit
Bug Fixes
Tests
✏️ Tip: You can customize this high-level summary in your review settings.