Repository navigation
Add more modeling for Optional - #1613
Conversation
|
This change is part of the following stack: Change managed by git-spice. |
|
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 (1)
💤 Files with no reviewable changes (1)
Walkthrough
Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1613 +/- ##
============================================
+ Coverage 88.09% 88.10% +0.01%
Complexity 3046 3046
============================================
Files 105 105
Lines 10170 10181 +11
Branches 2062 2062
============================================
+ Hits 8959 8970 +11
Misses 572 572
Partials 639 639 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
1bec1d8 to
5155f0b
Compare
5155f0b to
16f54dc
Compare
4235633 to
a347dc6
Compare
3f7be7e to
15ac4a4
Compare
15ac4a4 to
811606b
Compare
Observed when running #1613 on Spring Framework. If have a class `Box<T>` with a method method `foo(T)` with a library model making it `foo(@nullable T)`, and a call site invoking `foo` on a `Box<?>`, we could crash trying to put an invalid `@Nullable` on the wildcard. Instead, we can just not substitute in the `@Nullable` annotation; our existing wildcard checking logic should handle the `@Nullable` on the formal correctly for this case.
Fixes #1611
We manually write more models for
Optional, so we can address before fully fixing #950. Note that we do not modelorElseGetas in JSpecify JDK right now due to false positives; see #1616.Summary by CodeRabbit
Summary by CodeRabbit
Bug Fixes
java.util.Optional, including more accurate nullability propagation and diagnostics forofNullable,map,orElse,equals, andfilter.Tests
Optionalwith jspecify nullability, adding new positive and negative compilation assertions, with one scenario temporarily skipped pending a tracked issue.