Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
Java doesn't propagate annotations (@Nullable, etc) to inherited methods.
Fromhttps://dynamite-preprod.sandbox.google.com/room/AAAAtmrKBc8/PktDIRkr9j4 :
" java does not propagate annotations to inherited methods by default
however you can meta-annotate annotations on types with @Inherited
so i believe even if you have @Inherited on an annotation used on a method, it will never be inherited
JDK docs say the same thing in a slightly less readable way
"
However, Metalava currently skips outputting overridden methods into signature files if their signatures appear to match regardless of annotations. See aosp/1665763 for the workaround we have at the moment, skipping validating nullability of methods that are newly overridden rather than inherited.
It would be good if Metalava were to save some information about the annotations of overridden methods into the signature files, to allow us to check nullability correctly even for newly overridden methods.