[jdk17u-dev] RFR: 8341779: [REDO BACKPORT] type annotations are not visible to javac plugins across compilation boundaries (JDK-8225377) [v2]
Goetz Lindenmaier
goetz at openjdk.org
Wed Dec 3 12:21:29 UTC 2025
On Mon, 24 Nov 2025 09:58:11 GMT, Liam Miller-Cushon <cushon at openjdk.org> wrote:
>> Hi @cushon,
>> do we really need this in 17?
>> How far is the feature used in 21 by the community given the flag is needed? Is there any adoption?
>> Why can't users just go to 25 or 21?
>> It is not very desireable to have kind of hidden features in an update release.
>
>> Hi @cushon, do we really need this in 17? How far is the feature used in 21 by the community given the flag is needed? Is there any adoption? Why can't users just go to 25 or 21? It is not very desireable to have kind of hidden features in an update release.
>
> Hi @GoeLin, here's the background I have:
>
> Spring Boot 4 has adopted type use annotations for nullness (see [this blog post](https://spring.io/blog/2025/11/12/null-safe-applications-with-spring-boot-4#null-safe-applications)). The post mentions using `-XDaddTypeAnnotationsToSymbol` with JDK 21. They also support JDK 17 as a baseline. So there are going to be some users of Spring Boot 4 who upgrade, but stay on JDK 17, and would benefit from the fix.
>
> Another use-case is NullAway, which [recommends the `-XD` flag if it is available](https://github.com/uber/NullAway/pull/1317), and [supports JDK 17](https://github.com/uber/NullAway/issues/1170).
>
> I appreciate the desire to not have hidden features. At the same time I think having this fix available even behind an `-XD` flag has some value to the ecosystem. There has been some additional recent usage of type annotations due to the [JSpecify annotations](https://jspecify.dev/), and if [Null-Restricted and Nullable Types](https://openjdk.org/jeps/8303099) happens in a future release then we may be in a window where type annotations are most useful. I would like to try to make this fix available to parts of the ecosystem that aren't able to upgrade from 17 to 21 yet.
>
> What do you think?
Hi @cushon
Thanks for the detailed explanation. I will approve it.
Please backport the follow-ups asap, especially the flag switching it off.
-------------
PR Comment: https://git.openjdk.org/jdk17u-dev/pull/4124#issuecomment-3606589348
More information about the jdk-updates-dev
mailing list