Table of Contents
12-September-2025 - 7.17.0-SNAPSHOT
The PMD team is pleased to announce PMD 7.17.0-SNAPSHOT.
This is a minor release.
๐ New and noteworthy
โจ New Rules
- The new apex rule
AnnotationsNamingConventions
enforces that annotations are used consistently in PascalCase.
The rule is referenced in the quickstart.xml ruleset for Apex. - The new java rule
TypeParameterNamingConventions
replaces the now deprecated rule GenericsNaming. The new rule is configurable and checks for naming conventions of type parameters in generic types and methods. It can be configured via a regular expression.
By default, this rule uses the standard Java naming convention (single uppercase letter).
The rule is referenced in the quickstart.xml ruleset for Java. - The new java rule
OverrideBothEqualsAndHashCodeOnComparable
finds missinghashCode()
and/orequals()
methods on types that implementComparable
. This is important if instances of these classes are used in collections. Failing to do so can lead to unexpected behavior in sets which then do not conform to theSet
interface. While theSet
interface relies onequals()
to determine object equality, sorted sets likeTreeSet
usecompareTo()
instead. The same issue can arise when such objects are used as keys in sorted maps.
This rule is very similar toOverrideBothEqualsAndHashcode
which has always been skippingComparable
and only reports if one of the two methods is missing. The new rule will also report, if both methods (hashCode and equals) are missing.
The rule is referenced in the quickstart.xml ruleset for Java. - The new java rule
UselessPureMethodCall
finds method calls of pure methods whose result is not used. Ignoring the result of such method calls is likely as mistake as pure methods are side effect free.
The rule is referenced in the quickstart.xml ruleset for Java. - The new java rule
RelianceOnDefaultCharset
finds method calls that depend on the JVMโs default charset. Using these method without specifying the charset explicitly can lead to unexpected behavior on different platforms.
Deprecated Rules
- The java rule
GenericsNaming
has been deprecated for removal in favor of the new ruleTypeParameterNamingConventions
. - The java rule
AvoidLosingExceptionInformation
has been deprecated for removal in favor of the new ruleUselessPureMethodCall
. - The java rule
UselessOperationOnImmutable
has been deprecated for removal in favor of the new ruleUselessPureMethodCall
.
๐ Fixed Issues
- apex-codestyle
- #5650: [apex] New Rule: AnnotationsNamingConventions
- java
- #5874: [java] Update java regression tests with Java 25 language features
- java-bestpractices
- java-codestyle
- #972: [java] Improve naming conventions rules
- java-design
- #5023: [java] UseUtilityClass implementation hardcodes a message instead of using the one defined in the XML
- java-errorprone
๐จ API Changes
โจ Merged pull requests
- #5822: Fix #5650: [apex] New Rule: AnnotationsNamingConventions - Mitch Spano (@mitchspano)
- #5856: Fix #5837: [java] New Rule OverrideBothEqualsAndHashCodeOnComparable - Vincent Potucek (@Pankraz76)
- #5907: [java] New rule: UselessPureMethodCall - Zbynek Konecny (@zbynek)
- #5922: Fix #972: [java] Add a new rule TypeParameterNamingConventions - UncleOwen (@UncleOwen)
- #5924: Fix #5915: [java] Fix AssignmentInOperandRule to also work an do-while loops and switch statements - UncleOwen (@UncleOwen)
- #5930: Fix #4500: [java] Fix AvoidReassigningLoopVariablesRule to allow only simple assignments in the forReassign=skip case - UncleOwen (@UncleOwen)
- #5931: Fix #5023: [java] Fix UseUtilityClassRule to use the message provided in design.xml - UncleOwen (@UncleOwen)
- #5932: [ci] Reuse GitHub Pre-Releases - Andreas Dangel (@adangel)
- #5934: Fix #2186: [java] New Rule: RelianceOnDefaultCharset - UncleOwen (@UncleOwen)
- #5938: [doc] Update suppression docs to reflect PMD 7 changes - Zbynek Konecny (@zbynek)
- #5965: Fix #5881: AvoidLosingException - Consider nested method calls - Andreas Dangel (@adangel)
- #5967: [doc][java] ReplaceJavaUtilDate - improve doc to mention java.sql.Date - Andreas Dangel (@adangel)