30 July 2022
The PMD team is pleased to announce PMD 6.48.0.
This is a minor release.
This release of PMD brings support for Java 19. There are no new standard language features.
PMD supports JEP 427: Pattern Matching for switch (Third Preview) and JEP 405: Record Patterns (Preview) as preview language features.
In order to analyze a project with PMD that uses these language features,
you’ll need to enable it via the environment variable
PMD_JAVA_OPTS and select the new language
export PMD_JAVA_OPTS=--enable-preview ./run.sh pmd -language java -version 19-preview ...
Note: Support for Java 17 preview language features have been removed. The version “17-preview” is no longer available.
Thanks to the contribution from Anne Brouwers PMD now has CPD support for the Gherkin language. It is used to defined test cases for the Cucumber testing tool for behavior-driven development.
Being based on a proper Antlr grammar, CPD can:
--debug. This option has the same behavior as in PMD. It enables more verbose logging output.
test-codeis deprecated. The new attribute
disabledshould be used instead for defining whether a rule test should be skipped or not.
test-codeare deprecated and assumed true. They will not be replaced.
test-codeallows disabling all tests except the focused one temporarily.
ASTGuardedPatternhas been deprecated and will be removed. It was introduced for Java 17 and Java 18 Preview as part of pattern matching for switch, but it is no longer supported with Java 19 Preview.
CPDRendereris deprecated. For custom CPD renderers the new interface
CPDReportRenderershould be used.
TestDescriptoris deprecated, replaced with
RuleTsthave been deprecated as internal API.
Those APIs are not intended to be used by clients, and will be hidden or removed with PMD 7.0.0.
You can identify them with the
@InternalApi annotation. You’ll also get a deprecation warning.
Many thanks to our sponsors: