Table of Contents
30-October-2026 - 7.29.0-SNAPSHOT
The PMD team is pleased to announce PMD 7.29.0-SNAPSHOT.
This is a minor release.
🚀️ New and noteworthy
🌟️ New and Changed Rules
Changed Rules
- The Java rule
FinalFieldCouldBeStaticno longer reports casts or conditional expressions whose constant classification previously depended on a boxed static final field. Direct static field references are still reported. - The Java rule
UnconditionalIfStatementnow excludes final local boolean constants, consistently with its existing exclusion of named compile-time constants used for conditional compilation. - The Java rule
UnusedNullCheckInEqualsnow recognizes final local String constants and unqualified instance String constants as non-null receivers, avoiding unnecessary reports. - The Java rule
AvoidReassigningLoopVariables, withforReassign=skip, now accepts a final local constant equal to one as the increment of a conditional skip. - The Java rule
UnusedAssignmentnow recognizes final local boolean constants when analyzing short-circuit conditions, avoiding false positives caused by assignments that cannot execute. - The Java rule
LiteralsFirstInComparisonsnow recognizes final local String constants and unqualified references to non-static final String constants. This may add violations when such a constant is the argument of a comparison, or remove them when it is already the receiver. - The Java rule
UseExplicitTypeshas a new propertyallowLongTypeNames. It allows to usevarwhen the explicit type name would be longer than a given minimum length configured with this property.
🐛️ Fixed Issues
- core
- groovy
- #7110: [groovy] Fix #7100: CPD fails on GStrings ending in an interpolated variable
- html
- #5313: [html] CPD gets end line wrong for HTML
- java
- java-bestpractices
- java-codestyle
- #6903: [java] Enhance UseExplicitTypes to allow verbose long explicit types
- java-design
🚨️ API Changes
- Java constant folding now recognizes final primitive and String variables initialized with constant expressions,
including local variables and unqualified instance fields. Numeric references are converted to their declared type.
Boxed fields and field accesses qualified by expressions (such as
this.CONSTANT) are not compile-time constants. These changes affectASTExpression.getConstValue(),isCompileTimeConstant(), and the XPath attribute@CompileTimeConstant; custom Java and XPath rules relying on them may report different results.