Fixed
Status Update
Comments
gh...@google.com <gh...@google.com> #2
an...@google.com <an...@google.com> #3
For Android-imposed version restrictions we should override that using AndroidLanguageFeatureProvider (and if the feature provider scheme isn't supported for a particular inspection, upstreaming a patch to add that).
Description
Certain Android SDK annotations are available only in the stub jar (android.jar) and not in attached sources because they are injected by Metalava at build time. This discrepancy confuses certain IntelliJ inspections which search for annotations in sources instead of bytecode (presumably to handle annotations with source retention).
Most notably this affects nullability annotations, which Metalava injects in many
java.*
classes. For example, the following code snippet does not trigger a nullability warning in the editor, even though it should:I have a solution ready, partly as a side effect of my recent deep dive into b/366309455 . I'll upload soon.