RFR: 8371960: Missing null check in AnnotatedType annotation accessor methods

Alan Bateman alanb at openjdk.org
Mon Nov 17 10:48:15 UTC 2025


On Sun, 16 Nov 2025 19:24:41 GMT, Chen Liang <liach at openjdk.org> wrote:

> I think the main impact of this change is that `AnnotatedType` is the only way to retrieve type annotations, so the accessors might see more frequent usage compared to those on other `AnnotatedElement`s.

Yes, it seems this will really only be noticed if getAnnotatedReturnType/getAnnotatedParameterTypes/etc. methods are used and something has a bug that results in invoking AnnotatedType methods with null. Seems low risk.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28341#issuecomment-3541102393


More information about the core-libs-dev mailing list