Repository navigation
test case for issue 1493 - #1496
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 (1)
WalkthroughA new test method Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 Tip CodeRabbit can approve the review once all CodeRabbit's comments are resolved.Enable the |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1496 +/- ##
=========================================
Coverage 88.43% 88.43%
Complexity 2790 2790
=========================================
Files 99 99
Lines 9279 9279
Branches 1872 1872
=========================================
Hits 8206 8206
Misses 524 524
Partials 549 549 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…odels (uber#2033) With `WarnOnGenericInferenceFailure` on and no JDK models, returning `Objects.requireNonNullElse(nullable, nonNull)` from a method with a non-null `String` return reports `inference failure: type variable T constrained to be both @nonnull and @Nullable` (uber#1493). The JSpecify JDK models (uber#1641, NullAway 0.14.0) declare `<T> T requireNonNullElse(@nullable T obj, @nullable T defaultObj)`, so `T` is inferred as non-null `String` and nothing is reported. The models are enabled by `-XepOpt:NullAway:JSpecifyJDKModels=true`, or by `-XepOpt:NullAway:JSpecifyExperimental=true`, whose value that flag defaults to. `GenericMethodTests.issue1493` was added with `@Ignore` in uber#1496 and passes now. This change enables it as `issue1493RequireNonNullElseWithJdkModels` and adds `issue1493RequireNonNullElseWithoutJdkModels`, which compiles the same source with `JSpecifyJDKModels=false` and expects the inference failure. Both tests set `WarnOnGenericInferenceFailure=true` and `JSpecifyJDKModels` explicitly instead of taking them from the `JSpecifyExperimental` default, so the pair differs only in the models flag; with that flag set to `true`, the second test fails with "There were no errors". Refs uber#1493. Merging does not close it: the reporter's configuration without the models (`JSpecifyMode` plus `WarnOnGenericInferenceFailure=true`) still reports the warning, and whether the issue can close before the models are on by default is for the maintainers to decide. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Tests** * Added enabled coverage for `Objects.requireNonNullElse` generic inference with JSpecify JDK models enabled and disabled. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
We should test that this passes once we get the JSpecify JDK models in (#950)
Summary by CodeRabbit