similar to #17168
we need to update all internals to jdk21 usage but not a pom.xml with minimal jdk usage.
after preparation is done we will mirgate like we did at #17321 but in separate issue.
https://en.m.wikipedia.org/wiki/Java_version_history
https://docs.oracle.com/en/java/javase/24/migrate/significant-changes-jdk-21.html
Reason to enable preview features of jdk in checkstyle:
- Checkstyle vis always behind in jdk usage by 1 or 2 lat releases.
- Preview features are appearing and removed, good example is "String templates" in jdk21. It is very awaited feature by users, so user immediately would use it, but it challenging in consistent behavior, so it was removed few releases later. If checkstyle started to use such feature, it will be pain to refactor to stop using it. We removed support of string templates, as it was big problem for us to support too.
- checkstyle has its own parser of java, so even jdk preview feature is in , and we enable them, on first usage of it checkstyle will fail to parse it , CI will be very red. So we naturally limited to features that checkstyle java parser supports. Adding features to our parser is huge effort, and highly unlikely to be done for preview features.
Final migration to jdk21 will be done at #17430
similar to #17168
we need to update all internals to jdk21 usage but not a pom.xml with minimal jdk usage.
after preparation is done we will mirgate like we did at #17321 but in separate issue.
https://en.m.wikipedia.org/wiki/Java_version_history
https://docs.oracle.com/en/java/javase/24/migrate/significant-changes-jdk-21.html
Reason to enable preview features of jdk in checkstyle:
Final migration to jdk21 will be done at #17430