Fixed
Status Update
Comments
gh...@google.com <gh...@google.com> #2
I don't think the average developer understands the distinction between method references and method definitions in this context (inside a DEX file). I know I don't.
@jvg, can you elaborate?
an...@google.com <an...@google.com> #3
people who are looking at the bytecode in the dex to optimize their app through shrinking hopefully will learn the difference as string tables for method references between various dex files can account for quite a bit of disk space. but more importantly a definition is something you can analyze its code for where a reference you can't so the UI can be confusing without seeing the difference
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.