25-July-2025 - 7.16.0-SNAPSHOT
The PMD team is pleased to announce PMD 7.16.0-SNAPSHOT.
This is a minor release.
Table Of Contents
- ๐ New and noteworthy
- ๐ New: Java 25 Support
- New: CPD support for CSS
- โจ New Rules
- ๐ Fixed Issues
- ๐จ API Changes
- Experimental APIs that are now considered stable
- โจ Merged pull requests
- ๐ฆ Dependency updates
- ๐ Stats
๐ New and noteworthy
๐ New: Java 25 Support
This release of PMD brings support for Java 25.
There are the following new standard language features:
- JEP 511: Module Import Declarations
- JEP 512: Compact Source Files and Instance Main Methods
- JEP 513: Flexible Constructor Bodies
And one preview language feature:
In order to analyze a project with PMD that uses these preview language features,
you'll need to enable it via the environment variable PMD_JAVA_OPTS
and select the new language
version 25-preview
:
export PMD_JAVA_OPTS=--enable-preview
pmd check --use-version java-25-preview ...
Note: Support for Java 23 preview language features have been removed. The version "23-preview"
is no longer available.
New: CPD support for CSS
CPD now supports CSS (Cascading Style Sheets), a language for describing the rendering of structured
documents (such as HTML) on screen, on paper etc.
It is shipped with the new module pmd-css
.
โจ New Rules
- Two new rules have been added to Java's Error Prone category:
ReplaceJavaUtilCalendar
andReplaceJavaUtilDate
. These rules help to migrate away from old Java APIs around
java.util.Calendar
andjava.util.Date
. It is recommended to use the modernjava.time
API instead, which
is available since Java 8.
๐ Fixed Issues
- core
- java
- java-codestyle
- #5892: [java] ShortVariable false positive for java 22 unnamed variable
_
- #5892: [java] ShortVariable false positive for java 22 unnamed variable
- java-design
- #5858: [java] FinalFieldCouldBeStatic false positive for array initializers
- java-errorprone
- #2862: [java] New Rules: Avoid java.util.Date and Calendar classes
๐จ API Changes
Experimental APIs that are now considered stable
- pmd-java
ASTImportDeclaration#isModuleImport
is now stable API.ASTCompilationUnit#isCompact
is now stable API. Note, it was previously
calledisSimpleCompilationUnit
.ASTImplicitClassDeclaration
is now stable API.JavaVisitorBase#visit(ASTImplicitClassDeclaration, P)
is now
stable API.
โจ Merged pull requests
- #5733: [css] Add new CPD language - Thomas Prouvot (@tprouvot)
- #5859: Fix #5858: [java] Fix false positive in FinalFieldCouldBeStatic for array initializers - Zbynek Konecny (@zbynek)
- #5876: chore: license header cleanup - Andreas Dangel (@adangel)
- #5883: Fix #2862: [java] Add rules discouraging the use of java.util.Calendar and java.util.Date - UncleOwen (@UncleOwen)
- #5893: chore: Fix Mockito javaagent warning for Java 21+ - Andreas Dangel (@adangel)
- #5894: chore: Fix JUnit warning about invalid test factory - Andreas Dangel (@adangel)
- #5895: Fix #5597: Move dogfood profile to separate settings.xml - Andreas Dangel (@adangel)
- #5899: Fix #5344: [java] Just log invalid annotation target type - Andreas Dangel (@adangel)
- #5909: [ci] Create a pre-release for snapshot builds - Andreas Dangel (@adangel)
- #5911: [doc] Reference CPD Capable Languages in CPD CLI docu - Andreas Dangel (@adangel)
- #5914: Fix #5892: [java] ShortVariable FP for java 22 Unnamed Variable - Lukas Grรคf (@lukasgraef)
- #5918: chore: [cli] Improve symbolic link tests for Windows - Andreas Dangel (@adangel)
- #5920: chore: [scala] Fix javadoc config - Andreas Dangel (@adangel)