Repository navigation
Read nullable fields from JSpecify JDK models into astubx - #1901
Conversation
Signed-off-by: subhramit <subhramit.bb@live.in>
Signed-off-by: subhramit <subhramit.bb@live.in>
Signed-off-by: subhramit <subhramit.bb@live.in>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Important Review skippedWe couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: uber/NullAway/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (12)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. WalkthroughThe javac serializer now records eligible nullable fields and their enclosing classes. The astubx generator and writer carry this data into version 2 files, while retaining version 1 output when no nullable fields are present. The cache reads nullable-field records from version 2 files, and the library-model handler adds them to stubx-derived models. Tests cover serialization, file generation, and nullable-field diagnostics. Suggested reviewers: Priority: ➖ Normal Change: Bug fix Merge Risk: ⚪ Minimal · up to The change carries nullable field annotations into library models while preserving version 1 compatibility. No actionable merge-blocking issue is established; merge after normal checks pass. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change extends the analysis-data format without demonstrating a new untrusted entry point or privilege increase. Older consumers cannot read files using the new version, and damaged-input recovery and packaged-data integrity remain partially assessed. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1901 +/- ##
============================================
+ Coverage 87.67% 87.68% +0.01%
- Complexity 3511 3524 +13
============================================
Files 110 110
Lines 11674 11738 +64
Branches 2409 2425 +16
============================================
+ Hits 10235 10293 +58
- Misses 659 662 +3
- Partials 780 783 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
msridhar
left a comment
There was a problem hiding this comment.
Overall this looks really good! Just had a few comments.
Beyond the code comments, I'm wondering if we should separate out the re-generation of jspecify-jdk.astubx and the corresponding test. I've been meaning to update it anyway, as there have been changes on the main branch. I just pushed a new version of my test branch that includes those changes. I'm working on testing out the build now; may need to hack the build script further. I'll comment back when it's ready to go.
|
@subhramit I landed updated instructions for generating the astubx file on the master branch |
…ndling, cover protected field visibility Signed-off-by: subhramit <subhramit.bb@live.in>
…dels-nullable-fields
|
@subhramit FYI I now landed #1916 so re-generating the astubx file should be even easier :-) |
…dels-nullable-fields
Was just working on this - that makes things easier. Thanks. |
Signed-off-by: subhramit <subhramit.bb@live.in>
|
@msridhar this should now be done - could you go through 688327e and see if I missed anything while addressing? I also regenerated the astubx using the new script in this PR itself for the sake of completeness (to not add unused functionality to master), but let me know if you'd prefer separating into a follow-up PR. |
The task is registered in every module that applies the test conventions, but two setups leave it blind. Four modules hold tests of nullaway/src/main and no main code of their own, so :nullaway:pitestDiff never runs them and a mutant only they would kill looks alive. The tests of jdk-javac-plugin run the plugin inside javac through -Xplugin, and PIT records no coverage there: against the parent of apache#1901, :jdk-javac-plugin:pitestDiff reported all 14 mutants as not reached by any test, with 0 of 150 lines covered, although its 12 tests ran. CONTRIBUTING.md now names both gaps, and AGENTS.md keeps recommending the task for :nullaway only. Assisted-by: Claude Code (claude-opus-5-5)
Gradle moves every -Dname=value given through a Test task's jvmArgs into its systemProperties, and pitestDiff passed only jvmArgs and the heap limit to PIT. A test that reads such a property failed under PIT, and --skipFailingTests dropped it without a word. In jmh, three of the eight tests failed that way, and in jdk-javac-plugin every test did, since all of them read -Dtest.module.path: there, against the parent of apache#1901, all 14 mutants were reported as not reached and 0 of 150 lines as covered. With the properties passed, 10 of those 14 mutants are killed and 143 of 150 lines are covered. An argument that contains a comma now fails the task, since PIT splits --jvmArgs at commas and would pass it to the test JVM in pieces. Assisted-by: Claude Code (claude-opus-5-5)
Closes #1862
Serialize top-level nullable fields from JSpecify JDK sources into astubx v2 and load them as library models.
Regenerate the bundled JDK astubx.
Before pressing the "Create Pull Request" button, please provide the following:
A description about what and why you are contributing, even if it's trivial.
The issue number(s) or PR number(s) in the description if you are contributing in response to those.
If applicable, unit tests.
AI usage - Zed + GPT 5.6 Sol. I have manually verified all code and run all tests.
Summary by CodeRabbit