[jdk21u-dev] RFR: 8334870: javac does not accept classfiles with certain permitted RuntimeVisibleParameterAnnotations and RuntimeInvisibleParameterAnnotations attributes

Severin Gehwolf sgehwolf at openjdk.org
Wed Aug 6 08:45:11 UTC 2025


On Tue, 5 Aug 2025 20:19:38 GMT, Liam Miller-Cushon <cushon at openjdk.org> wrote:

> That is a good question, and I'm not sure how to evaluate the risk/benefit.
> 
> There is some impact from the bug, there was some related discussion on compiler-dev with some input from owners of affected tools ([linked here](https://bugs.openjdk.org/browse/JDK-8341779?focusedId=14728458&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14728458)). I think this is also a concern for Spring which has been trying to adopt more type annotations ([see here](https://spring.io/blog/2025/03/10/null-safety-in-spring-apps-with-jspecify-and-null-away)) and also supports JDK 17 and 21, and can't practically ensure all users are going to pass the `-XD` flag.

Thanks for the additional context @cushon.

I understand the argument. Proponents seem to be tool developers which is one bucket of JDK users (I want this new feature). With JDK 25 GA being around the corner (September 2025) they'd have ample opportunity to use the on-by-default behaviour and drive the positive feedback loop. If they really want it in JDK 21 as well there is the option of passing the `-XD` flag which should be an improvement over the workarounds in place in various tools.

The other bucket of users are existing JDK 21 users who want stability, which I'd claim is the majority. I.e. my code compiled fine on `21.0.8` but doesn't any more on `21.0.x` (where `x > 8`). Therefore, I'm proposing to leave the situation as-is (with `21.0.8` and better). I may be convinced otherwise but I haven't seen a really compelling argument to date. It's a disruptive change and we need to be cautious with any (more) `javac` changes going forward in JDK 21.

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

PR Comment: https://git.openjdk.org/jdk21u-dev/pull/1930#issuecomment-3158296721


More information about the jdk-updates-dev mailing list