Table of Contents
30-May-2025 - 7.14.0
The PMD team is pleased to announce PMD 7.14.0.
This is a minor release.
🚀 New and noteworthy
PMD CLI now uses threaded execution by default
In the PMD CLI, the --threads
(-t
) option can now accept a thread
count given relative to the number of cores of the machine. For instance,
it is now possible to write -t 1C
to spawn one thread per core, or -t 0.5C
to spawn one thread for every other core.
The thread count option now defaults to 1C
, meaning parallel execution
is used by default. You can disable this by using -t 1
.
New Rule UnnecessaryWarningSuppression (experimental)
This new Java rule UnnecessaryWarningSuppression
reports unused suppression
annotations and comments. Violations of this rule cannot be suppressed.
How to use it? Just include it in your ruleset:
<rule ref="category/java/bestpractices.xml/UnnecessaryWarningSuppression" />
Note: This rule is currently experimental. It is available for now only for Java.
The rule for now only reports annotations specific to PMD, like @SuppressWarnings("PMD")
.
In the future we might be able to check for other common ones like @SuppressWarnings("unchecked")
or "fallthrough"
.
Since violations of this rule cannot be suppressed, we opted here on the side of false-negatives and
don’t report every unused case yet.
However, suppressing specific PMD rules is working as expected.
Migrating to Central Publisher Portal
We’ve now migrated to Central Publisher Portal. Snapshots of PMD are still available, however the repository URL changed. To consume these with maven, you can use the following snippet:
<repositories>
<repository>
<name>Central Portal Snapshots</name>
<id>central-portal-snapshots</id>
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
Releases of PMD are available on Maven Central as before without change.
More CLI parameters shared between PMD and CPD
When executing PMD or CPD, the same parameters are now understood for selecting which files should be analyzed. See File collection options for a list of common, shared parameters that are valid for both commands.
🐛 Fixed Issues
- core
- java-bestpractices
- java-codestyle
- java-design
- java-errorprone
- #5702: [java] InvalidLogMessageFormat: Lombok @Slf4j annotation is not interpreted by PMD
- java-performance
- #5711: [java] UseArraysAsList false positive with Sets
- visualforce
- #5476: [visualforce] NPE when analyzing standard field references in visualforce page
🚨 API Changes
CLI
- CPD now supports
--report-file
(-r) and--exclude-file-list
. - PMD now supports
--exclude
and--non-recursive
. - The option
--ignore-list
in PMD is renamed to--exclude-file-list
.
Deprecations
- CLI
- The option
--ignore-list
has been deprecated. Use--exclude-file-list
instead.
- The option
- core
AstInfo#getSuppressionComments
: UsegetAllSuppressionComments
orgetSuppressionComment
.AstInfo#withSuppressMap
: UsewithSuppressionComments
AbstractTokenManager#suppressMap
: Don’t use this map directly anymore. Instead, usegetSuppressionComments
.AbstractTokenManager#getSuppressMap
: UsegetSuppressionComments
instead.
- pmd-java
ASTCompactConstructorDeclaration#getDeclarationNode
: This method just returnsthis
and isn’t useful.JavaMetrics#NPATH
: UseNPATH_COMP
, which is available on more nodes, and uses Long instead of BigInteger.
Experimental
- core
- pmd-java
✨ Merged pull requests
- #5584: [ci] New workflow “Publish Snapshot” - Andreas Dangel (@adangel)
- #5599: [java] Rewrite NPath complexity metric - Clément Fournier (@oowekyala)
- #5609: [core] Add rule to report unnecessary suppression comments/annotations - Clément Fournier (@oowekyala)
- #5699: Fix #5702: [java] First-class support for lombok @Slf4j - Clément Fournier (@oowekyala)
- #5700: [core] Don’t accidentally catch unexpected runtime exceptions in CpdAnalysis - Elliotte Rusty Harold (@elharo)
- #5712: Fix #5711: [java] UseArrayAsList - only consider List.add - Andreas Dangel (@adangel)
- #5715: Fix #5476: [visualforce] Resolve data types of standard object fields - Andreas Dangel (@adangel)
- #5716: Fix #5634: [java] CommentDefaultAccessModifier: Comment between annotation and constructor not recognized - Lukas Gräf (@lukasgraef)
- #5726: Fix #5724: [java] Implicit functional interface FP with sealed interface - Clément Fournier (@oowekyala)
- #5727: Fix #5621: [java] Fix FPs with UnusedPrivateMethod - Clément Fournier (@oowekyala)
- #5728: [ci] Improvements for “Publish Pull Requests” - Andreas Dangel (@adangel)
- #5730: [ci] Refactor git-repo-sync - Andreas Dangel (@adangel)
- #5731: [cli] Share more CLI options between CPD and PMD - Clément Fournier (@oowekyala)
- #5736: Fix #5061: [java] UnusedLocalVariable FP when using compound assignment - Lukas Gräf (@lukasgraef)
- #5741: [cli] Make CLI default to multithreaded - Clément Fournier (@oowekyala)
- #5742: [ci] publish-snapshot/old build: migrate to central portal - Andreas Dangel (@adangel)
- #5743: [ci] Make build a reuseable workflow - Andreas Dangel (@adangel)
- #5744: Fix #5705: [cli] Always determine PMD_HOME based on script location - Andreas Dangel (@adangel)
- #5748: [core] Reformat SarifLog to comply to coding standards - Andreas Dangel (@adangel)
- #5763: [java] Support annotated constructor return type in symbol API - Clément Fournier (@oowekyala)
- #5764: Fix #2462: [java] LinguisticNaming should ignore setters for Builders - Lukas Gräf (@lukasgraef)
📦 Dependency updates
- #5706: Bump PMD from 7.12.0 to 7.13.0
- #5709: Bump com.google.code.gson:gson from 2.13.0 to 2.13.1
- #5710: Bump com.puppycrawl.tools:checkstyle from 10.23.0 to 10.23.1
- #5717: Bump scalameta.version from 4.13.4 to 4.13.5
- #5718: Bump org.checkerframework:checker-qual from 3.49.2 to 3.49.3
- #5719: Bump org.jsoup:jsoup from 1.19.1 to 1.20.1
- #5751: Bump scalameta.version from 4.13.5 to 4.13.6
- #5754: Bump com.google.protobuf:protobuf-java from 4.30.2 to 4.31.0
- #5766: Bump io.github.git-commit-id:git-commit-id-maven-plugin from 9.0.1 to 9.0.2
- #5767: Bump org.mockito:mockito-core from 5.17.0 to 5.18.0
- #5768: Bump com.puppycrawl.tools:checkstyle from 10.23.1 to 10.24.0
📈 Stats
- 165 commits
- 33 closed tickets & PRs
- Days since last release: 35