Skip to content

Enable inference failure warnings by default#1568

Draft
msridhar wants to merge 1 commit into
masterfrom
remove-inf-failure-warning-flag
Draft

Enable inference failure warnings by default#1568
msridhar wants to merge 1 commit into
masterfrom
remove-inf-failure-warning-flag

Conversation

@msridhar

@msridhar msridhar commented May 8, 2026

Copy link
Copy Markdown
Collaborator

Fixes #1551. Unfortunately this leads to too many new warnings on real-world benchmarks to just enable it. I think we need to get better wildcards support into place, and possibly more JDK modeling, and then we can try to land this.

Summary by CodeRabbit

  • New Features

    • Added support for legacy annotation location configuration handling.
  • Changes

    • Generic type inference failures are now unconditionally reported as errors in all cases, changing from the previous behavior where reporting was optional based on configuration.
    • Removed the WarnOnGenericInferenceFailure configuration option from available settings.

@msridhar

msridhar commented May 8, 2026

Copy link
Copy Markdown
Collaborator Author

This change is part of the following stack:

Change managed by git-spice.

@coderabbitai

coderabbitai Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 20d8e550-8568-4ae1-95ec-f3c35754f751

📥 Commits

Reviewing files that changed from the base of the PR and between dff4b58 and c9a17fc.

📒 Files selected for processing (8)
  • nullaway/src/main/java/com/uber/nullaway/Config.java
  • nullaway/src/main/java/com/uber/nullaway/DummyOptionsConfig.java
  • nullaway/src/main/java/com/uber/nullaway/ErrorProneCLIFlagsConfig.java
  • nullaway/src/main/java/com/uber/nullaway/generics/GenericsChecks.java
  • nullaway/src/test/java/com/uber/nullaway/jspecify/GenericDiamondTests.java
  • nullaway/src/test/java/com/uber/nullaway/jspecify/GenericMethodLambdaOrMethodRefArgTests.java
  • nullaway/src/test/java/com/uber/nullaway/jspecify/GenericMethodTests.java
  • nullaway/src/test/java/com/uber/nullaway/jspecify/WildcardTests.java
💤 Files with no reviewable changes (3)
  • nullaway/src/main/java/com/uber/nullaway/DummyOptionsConfig.java
  • nullaway/src/main/java/com/uber/nullaway/ErrorProneCLIFlagsConfig.java
  • nullaway/src/main/java/com/uber/nullaway/Config.java

Walkthrough

This PR removes the warnOnGenericInferenceFailure() configuration option from NullAway's Config API and implementations, and adds a new isLegacyAnnotationLocation() configuration method. Generic inference failure handling in GenericsChecks is changed to always report errors unconditionally instead of guarding error reporting behind the deleted config flag. All test infrastructure and test cases are refactored to remove references to the WarnOnGenericInferenceFailure compiler flag, with test helper methods simplified and test cases updated to use a common makeHelper() method.

Possibly related PRs

  • uber/NullAway#1280: Both PRs modify GenericsChecks' handling of generic inference failures and UnsatisfiableConstraintsException paths.
  • uber/NullAway#1289: Both PRs affect GenericMethodTests and the WarnOnGenericInferenceFailure test helper flag.
  • uber/NullAway#1484: The addition of Config.isLegacyAnnotationLocation() directly enables the varargs type-use nullability checks added in that PR.

Suggested labels

run-benchmarks

Suggested reviewers

  • yuxincs
  • lazaroclapp
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.86% 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 accurately summarizes the main change: removing the WarnOnGenericInferenceFailure configuration flag and making generic inference failure warnings always enabled by default.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 remove-inf-failure-warning-flag

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 and usage tips.

@msridhar msridhar marked this pull request as draft May 8, 2026 15:38
@msridhar msridhar force-pushed the remove-inf-failure-warning-flag branch 2 times, most recently from cb5df31 to 0c60412 Compare May 15, 2026 23:36
@msridhar msridhar force-pushed the remove-inf-failure-warning-flag branch 3 times, most recently from 82a9c94 to 2cee127 Compare May 23, 2026 20:14
@msridhar msridhar force-pushed the remove-inf-failure-warning-flag branch 10 times, most recently from f015094 to b82c15b Compare May 30, 2026 17:52
@msridhar msridhar force-pushed the remove-inf-failure-warning-flag branch 3 times, most recently from 8ea63b3 to 4d7e20c Compare June 5, 2026 17:55
@msridhar msridhar force-pushed the remove-inf-failure-warning-flag branch 3 times, most recently from 752f984 to 4f080ba Compare June 16, 2026 23:11
@msridhar msridhar force-pushed the remove-inf-failure-warning-flag branch 3 times, most recently from eef1224 to 3813e13 Compare June 26, 2026 17:01
@msridhar msridhar force-pushed the remove-inf-failure-warning-flag branch from 3813e13 to cf67caf Compare July 3, 2026 21:12
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.

Report inference failures as errors by default

1 participant