Repository navigation
Document that a nullImpliesNull model applies to overriding methods - #1771
Conversation
Since apache#1758 nullImpliesNullParameters uses the override-aware lookup, so the model reaches an overriding method whether or not that method is declared in annotated code. Two comments still stated the older rule. The lookup-policy comment in LibraryModelsHandler now gives the rule for each kind of model separately, and names the reason issue apache#445 carried rather than pointing at the URL for it. The LibraryModels SPI javadoc states the inheritance rule, since an implementer reading the published page cannot see the lookup code, and records that NullAway does not check an override against the contract (apache#803). Six @return lines described a MethodRef key as a method name. This file already spells the same thing correctly for ensuresNonNullIfTrueMethodCalls and methodTypeVariablesWithNullableUpperBounds, so they now match. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. WalkthroughUpdated Suggested reviewers: Merge Risk: ⚪ Minimal · up to This PR clarifies existing override behavior and corrects documentation wording without changing executable behavior, APIs, dependencies, or deployment characteristics; no actionable merge-blocking risk remains beyond normal checks and review. 🚥 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 |
|
Hope you don't mind |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1771 +/- ##
=========================================
Coverage 87.63% 87.63%
Complexity 3273 3273
=========================================
Files 109 109
Lines 11031 11031
Branches 2233 2233
=========================================
Hits 9667 9667
Misses 641 641
Partials 723 723 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Why
#1758 routed
nullImpliesNullParametersthrough the override-aware lookup, so anullImpliesNullmodel now reaches an overriding method whether or not that method is declared in annotated code. Two comments still state the older exact-signature rule: the lookup-policy comment inLibraryModelsHandler, twelve lines above the call that no longer follows it, and theLibraryModels#nullImpliesNullParametersjavadoc, which says nothing about overriders at all. Both cost me an investigation in #1769.What
The handler comment gives the rule for each kind of model separately, so it no longer reads as a claim about both. It also names the reason #445 carried, instead of sending the reader to the URL for it: covering the issue number in the old comment left
for why this is needed, which states nothing.The
LibraryModelsjavadoc states the inheritance rule, and records that NullAway does not check an override against the contract (#803).LibraryModelsis a published SPI, so an implementer reading the generated page cannot look at the lookup code to discover either fact.Six
@returnlines described aMethodRefkey as a method name, which is its own trap in a file whereMethodRef.methodNameis a separate field. This file already spells the same thing correctly forensuresNonNullIfTrueMethodCallsandmethodTypeVariablesWithNullableUpperBounds, so the six now match those. This was not part of the drift, and it is easy to drop from the branch if you would rather keep the two changes apart.How to verify
971 tests, 0 failures. Every changed line is a comment line, so no behavior changes.
Summary by CodeRabbit