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 missing hashCode() and/or equals() methods on types that implement Comparable. 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 the Set interface. While the Set interface relies on equals() to determine object equality, sorted sets like TreeSet use compareTo() instead. The same issue can arise when such objects are used as keys in sorted maps.
    This rule is very similar to OverrideBothEqualsAndHashcode which has always been skipping Comparable 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

๐Ÿ› Fixed Issues

  • apex-codestyle
    • #5650: [apex] New Rule: AnnotationsNamingConventions
  • java
    • #5874: [java] Update java regression tests with Java 25 language features
  • java-bestpractices
    • #2186: [java] New rule: Reliance on default charset
    • #4500: [java] AvoidReassigningLoopVariables - false negatives within for-loops and skip allowed
  • 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
    • #5837: [java] New Rule OverrideBothEqualsAndHashCodeOnComparable
    • #5881: [java] AvoidLosingExceptionInformation does not trigger when inside if-else
    • #5915: [java] AssignmentInOperand not raised when inside do-while loop

๐Ÿšจ 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)

๐Ÿ“ฆ Dependency updates

๐Ÿ“ˆ Stats