Skip to content

Add JSpecifyExperimental configuration flag - #1648

Merged
msridhar merged 4 commits into
masterfrom
add-jspecify-experimental
Jul 24, 2026
Merged

Add JSpecifyExperimental configuration flag#1648
msridhar merged 4 commits into
masterfrom
add-jspecify-experimental

Conversation

@msridhar

@msridhar msridhar commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Adds a new boolean CLI flag, JSpecifyExperimental.

When enabled, it enables both experimental JSpecify features:

  • JSpecifyJDKModels
  • HandleWildcardGenerics

The existing individual flags continue to work independently. The plan is to encourage users to test with JSpecifyExperimental enabled to shake out more bugs before enabling these features by default in JSpecify mode.

Added a regression test confirming that JSpecifyExperimental enables both underlying options.

Summary by CodeRabbit

  • New Features
    • Added a new experimental JSpecify flag; when enabled, it automatically turns on wildcard generic handling and enhanced JSpecify JDK model support.
  • Tests
    • Added a new unit test to verify the experimental option enables both related behaviors.

@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.17%. Comparing base (78055dd) to head (c4cfd1f).
⚠️ Report is 1 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Adds NullAway:JSpecifyExperimental to ErrorProneCLIFlagsConfig. When enabled, it activates wildcard-generic handling and JSpecify JDK models. A test verifies both settings.

Possibly related PRs

Suggested reviewers: lazaroclapp

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding the new JSpecifyExperimental configuration flag.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-jspecify-experimental

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@lazaroclapp lazaroclapp left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with suggestion!

Comment thread nullaway/src/main/java/com/uber/nullaway/ErrorProneCLIFlagsConfig.java Outdated
@msridhar
msridhar force-pushed the supplier-assigned-lambda-returning-null branch from 974105a to ccd037a Compare July 24, 2026 04:02
@msridhar
msridhar force-pushed the add-jspecify-experimental branch from 2191a1c to faaed55 Compare July 24, 2026 04:02
@msridhar
msridhar force-pushed the supplier-assigned-lambda-returning-null branch from ccd037a to 7aaa8e3 Compare July 24, 2026 04:28
@msridhar
msridhar force-pushed the add-jspecify-experimental branch from faaed55 to 4276a87 Compare July 24, 2026 04:28
@msridhar
msridhar force-pushed the supplier-assigned-lambda-returning-null branch from 7aaa8e3 to 1c4dc6d Compare July 24, 2026 14:12
Base automatically changed from supplier-assigned-lambda-returning-null to master July 24, 2026 14:27
@msridhar
msridhar force-pushed the add-jspecify-experimental branch from 4276a87 to e39330a Compare July 24, 2026 14:31

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4276a87 and e39330a.

📒 Files selected for processing (2)
  • nullaway/src/main/java/com/uber/nullaway/ErrorProneCLIFlagsConfig.java
  • nullaway/src/test/java/com/uber/nullaway/ErrorProneCLIFlagsConfigTest.java

Comment on lines +89 to +101
@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());
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 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.

@msridhar
msridhar enabled auto-merge (squash) July 24, 2026 14:39
@msridhar
msridhar merged commit a7f21cc into master Jul 24, 2026
12 checks passed
@msridhar
msridhar deleted the add-jspecify-experimental branch July 24, 2026 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants