Showing content from https://github.com/pmd/pmd/issues/5062 below:
[java] Support Java 23 · Issue #5062 · pmd/pmd · GitHub
Java 23 will be released on September 17th. It ships a number of new feature previews that will impact PMD.
OpenJDK 23 GA is scheduled for 2024/09/17.
I here list the JEPs I've so far confirmed to be of impact:
- 467: Markdown Documentation Comments
- It allows Javadocs to be written in Markdown using
///
on each line, instead of /** … */
. This will impact our grammar to identify these as Javadocs, but also all rules parsing these (ie: to detect unused imports).
- 476: Module Import Declarations (Preview)
- Preview feature, allows modules to be imported directly, treating all public classes in exported packages to be imported on demand. This will affect the grammar around imports, affect all rules working with them, and may require us to revamp how PMD models and manages modules (which is quite weak honestly, as no rules currently deal with them directly).
- 482: Flexible Constructor Bodies (Second Preview)
- Not much changed since the first preview at first glance, need to double check…
- 455: Primitive Types in Patterns, instanceof, and switch (Preview)
- Relaxed constraints on what is allowed in these patterns. Should be easy, but needs appropriate tests to be added.
- 477: Implicitly Declared Classes and Instance Main Methods (Third Preview)
In summary: https://javaalmanac.io/jdk/23/
This issue is similar to the previous: #4794
EA Release of JDK23 is available here: https://jdk.java.net/23/
Tasks:
- Add new java language versions 23 and 23-preview:
net.sourceforge.pmd.lang.java.JavaLanguageModule
- 23 is the new default
- update also java.md and ant.md
- and add in KotlinTestingDsl.kt.
- Update
net.sourceforge.pmd.lang.java.LanguageVersionTest
- Update
net.sourceforge.pmd.lang.java.JavaLanguageModuleTest#previewVersionShouldBeGreaterThanNonPreview
- Update
net.sourceforge.pmd.lang.java.ast.AllJavaAstTreeDumpTest
- Update
net.sourceforge.pmd.dist.BinaryDistributionIT
- Update asm dependency to 9.7:
- Remove java language version 21-preview:
net.sourceforge.pmd.lang.java.JavaLanguageModule
- update also java.md
- update KotlinTestingDsl.kt
- remove exclusions in pmd-core/src/main/resources/internal/all-java.xml
- Update
net.sourceforge.pmd.lang.java.LanguageVersionTest
- Remove
net.sourceforge.pmd.lang.java.ast.Java21PreviewTreeDumpTest
(including resources)
- Update implementation for "Implicitly Declared Classes and Instance Main Methods" (445, 463, 477)
- Update implementation for "Flexible Constructor Bodies" (447, 482)
- Implement preview feature "Markdown Documentation Comments" (467)
- Implement preview feature "Module Import Declarations" (476)
- Implement preview feature "Primitive Types in Patterns, instanceof, and switch" (455)
- Remove support for String Templates (430, 459)
- Write release notes
- removed experimental: done
- removed classes: none
- deprecated classes: none
- new experimental: done
- Add JDK23 to the build, so that we integration test with 23, as this is a LTS version
- integration test in pmd-dist
- Not necessary, as JDK23 is not LTS
- Make sure, we can build PMD with JDK23
- Update https://github.com/pmd/java-regression-tests
- new regular language features, so update needed
- not necessary for 23, as there are no new regular language features
- Note: This can only be done, after this issue has been implemented
- Create a new issue for the next Java version 24
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4