Add JSpecifyExperimental configuration flag - #1648
Conversation
|
This change is part of the following stack:
Change managed by git-spice. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1648 +/- ##
=========================================
Coverage 88.17% 88.17%
Complexity 3064 3064
=========================================
Files 105 105
Lines 10301 10304 +3
Branches 2079 2079
=========================================
+ Hits 9083 9086 +3
Misses 576 576
Partials 642 642 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
c0a7b38 to
974105a
Compare
a9e1661 to
2191a1c
Compare
WalkthroughAdds 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 |
lazaroclapp
left a comment
There was a problem hiding this comment.
Approved with suggestion!
974105a to
ccd037a
Compare
2191a1c to
faaed55
Compare
ccd037a to
7aaa8e3
Compare
faaed55 to
4276a87
Compare
7aaa8e3 to
1c4dc6d
Compare
4276a87 to
e39330a
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@nullaway/src/test/java/com/uber/nullaway/ErrorProneCLIFlagsConfigTest.java`:
- Around line 89-101: Add a test case alongside
jspecifyExperimentalEnablesExperimentalFeatures using JSpecifyExperimental=true
with JSpecifyJDKModels=false and HandleWildcardGenerics=false, then assert
isJSpecifyJDKModels() and handleWildcardGenerics() both return false, confirming
explicit per-feature flags override the experimental fallback.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: ece69863-f5ec-42ca-a113-7e5a2b35f267
📒 Files selected for processing (2)
nullaway/src/main/java/com/uber/nullaway/ErrorProneCLIFlagsConfig.javanullaway/src/test/java/com/uber/nullaway/ErrorProneCLIFlagsConfigTest.java
| @Test | ||
| public void jspecifyExperimentalEnablesExperimentalFeatures() { | ||
| ErrorProneCLIFlagsConfig config = | ||
| new ErrorProneCLIFlagsConfig( | ||
| ErrorProneFlags.fromMap( | ||
| Map.of( | ||
| "NullAway:AnnotatedPackages", "foo", | ||
| "NullAway:JSpecifyMode", "true", | ||
| "NullAway:JSpecifyExperimental", "true"))); | ||
|
|
||
| assertTrue(config.isJSpecifyJDKModels()); | ||
| assertTrue(config.handleWildcardGenerics()); | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Cover explicit per-feature overrides.
This test only verifies the experimental true fallback. Add a case with JSpecifyExperimental=true, JSpecifyJDKModels=false, and HandleWildcardGenerics=false, asserting both accessors remain false. This protects the contract that the individual flags continue to override the umbrella flag.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@nullaway/src/test/java/com/uber/nullaway/ErrorProneCLIFlagsConfigTest.java`
around lines 89 - 101, Add a test case alongside
jspecifyExperimentalEnablesExperimentalFeatures using JSpecifyExperimental=true
with JSpecifyJDKModels=false and HandleWildcardGenerics=false, then assert
isJSpecifyJDKModels() and handleWildcardGenerics() both return false, confirming
explicit per-feature flags override the experimental fallback.
Adds a new boolean CLI flag,
JSpecifyExperimental.When enabled, it enables both experimental JSpecify features:
JSpecifyJDKModelsHandleWildcardGenericsThe existing individual flags continue to work independently. The plan is to encourage users to test with
JSpecifyExperimentalenabled to shake out more bugs before enabling these features by default in JSpecify mode.Added a regression test confirming that
JSpecifyExperimentalenables both underlying options.Summary by CodeRabbit