Repository navigation
Remove LegacyAnnotationLocations flag - #1640
Conversation
|
This change is part of the following stack: Change managed by git-spice. |
WalkthroughThe pull request removes the legacy annotation-location configuration and its CLI flag, replaces the Possibly related issues
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
nullaway/src/main/java/com/uber/nullaway/NullabilityUtil.java (1)
454-494: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winPass the annotated
Typehere instead ofsymbol
On the method-return and parameter fallback paths,symbolis the enclosingMethodSymbol, soisDirectTypeUseAnnotationruns againstMethodTypeand skips the nested-class innermost-type check. ThreadmethodSymbol.getReturnType()/varSymbol.typeinto the helper instead.🤖 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/main/java/com/uber/nullaway/NullabilityUtil.java` around lines 454 - 494, Update isDirectTypeUseAnnotation to accept the annotated Type rather than a Symbol, and use that Type for nested-class detection and nesting-depth checks. Change its method-return fallback caller to pass methodSymbol.getReturnType() and its parameter fallback caller to pass varSymbol.type, ensuring the helper never evaluates the enclosing MethodSymbol’s MethodType.
🤖 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.
Outside diff comments:
In `@nullaway/src/main/java/com/uber/nullaway/NullabilityUtil.java`:
- Around line 454-494: Update isDirectTypeUseAnnotation to accept the annotated
Type rather than a Symbol, and use that Type for nested-class detection and
nesting-depth checks. Change its method-return fallback caller to pass
methodSymbol.getReturnType() and its parameter fallback caller to pass
varSymbol.type, ensuring the helper never evaluates the enclosing MethodSymbol’s
MethodType.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 2b256290-fa75-4ac0-a955-433e2ceba062
📒 Files selected for processing (10)
nullaway/src/main/java/com/uber/nullaway/Config.javanullaway/src/main/java/com/uber/nullaway/DummyOptionsConfig.javanullaway/src/main/java/com/uber/nullaway/ErrorProneCLIFlagsConfig.javanullaway/src/main/java/com/uber/nullaway/NullAway.javanullaway/src/main/java/com/uber/nullaway/NullabilityUtil.javanullaway/src/main/java/com/uber/nullaway/Nullness.javanullaway/src/test/java/com/uber/nullaway/ArrayTests.javanullaway/src/test/java/com/uber/nullaway/LegacyAndJspecifyModeTest.javanullaway/src/test/java/com/uber/nullaway/LegacyVarargsTests.javanullaway/src/test/java/com/uber/nullaway/TypeUseAnnotationsTests.java
💤 Files with no reviewable changes (7)
- nullaway/src/test/java/com/uber/nullaway/LegacyAndJspecifyModeTest.java
- nullaway/src/main/java/com/uber/nullaway/Config.java
- nullaway/src/test/java/com/uber/nullaway/LegacyVarargsTests.java
- nullaway/src/main/java/com/uber/nullaway/DummyOptionsConfig.java
- nullaway/src/main/java/com/uber/nullaway/ErrorProneCLIFlagsConfig.java
- nullaway/src/test/java/com/uber/nullaway/TypeUseAnnotationsTests.java
- nullaway/src/test/java/com/uber/nullaway/ArrayTests.java
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1640 +/- ##
============================================
- Coverage 88.21% 88.17% -0.04%
+ Complexity 3076 3056 -20
============================================
Files 105 105
Lines 10296 10270 -26
Branches 2087 2072 -15
============================================
- Hits 9083 9056 -27
Misses 573 573
- Partials 640 641 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Remove support for legacy annotation locations (see current docs). This lets us delete a bunch of support and test code.
Fixes #1637
Summary by CodeRabbit
Breaking Changes
Bug Fixes