Table of Contents
27-November-2026 - 7.30.0-SNAPSHOT
The PMD team is pleased to announce PMD 7.30.0-SNAPSHOT.
This is a minor release.
🚀️ New and noteworthy
🌟️ New and Changed Rules
New Rules
- The new Java rule
ControlFlowInTestreports control flow in test methods that can obscure which assertions are executed. It checks conditionals, switch statements and expressions, explicit throw statements, try statements with catch clauses, and plain try-finally statements. Loops are allowed by default and can be reported by settingallowLoopstofalse.
Deprecated Rules
- The Java rule
AddEmptyStringis deprecated without replacement and will be removed with PMD 8.0.0. Its performance claim is not valid on modern JDKs: constant string concatenations are evaluated at compile time, and replacing concatenation withtoString()orString.valueOf()does not generally improve performance. The rule is excluded when referencing the whole Performance category, but explicit rule references continue to work during the deprecation period.
🐛️ Fixed Issues
- apex
- #7182: [apex] Expose the referenced type name on ClassRefExpression for XPath rules
- apex-design
- #4863: [apex] CyclomaticComplexity: False negative with switch statements
- core
- #5760: [core] SarifRenderer does not respect relativizeRoots
- java
- #7144: [java] Lambda block body that cannot complete normally is not treated as value-compatible
- #7240: [java] “Not a Java binary name” when importing a class with non-ASCII (e.g. Japanese) letters in its name; the whole file is skipped
- #7313: [java] Casts to boolean and boolean equality are not folded as constant expressions
- java-bestpractices
- java-codestyle
- java-design
- java-errorprone
- java-performance
- kotlin
- misc
- #6655: Deprecate ANTLR generated lexer implementation classes
🚨️ API Changes and Deprecations
Experimental API
- kotlin
KtVariableDeclarationAttributesnow implementsHasTypeName, soVariableDeclarationnodes have a@TypeNameattribute. This covers property and for-loop variables, lambda parameters, and each component of a destructuring declaration (val (a, b) = ...,for ((a, b) in ...),{ (a, b) -> ... }). The XPath functionspmd-kotlin:typeIs,pmd-kotlin:typeIsExactlyandpmd-kotlin:isNullablesupportVariableDeclarationnodes as well.- A destructuring
PropertyDeclaration(e.g.val (a, b) = Pair(1, "x")) no longer has a@TypeName. Before, it wrongly got the type of the first component. To find destructured variables by type, query the component nodes instead://VariableDeclaration[pmd-kotlin:typeIs('kotlin.Int')].
Deprecations
- coco
CocoLexerhas been deprecated. The class is an implementation detail and should have never been part of the public API.
- css
CssLexerhas been deprecated. The class is an implementation detail and should have never been part of the public API.
- csharp
CSharpLexerhas been deprecated. The class is an implementation detail and should have never been part of the public API.
- dart
DartLexerhas been deprecated. The class is an implementation detail and should have never been part of the public API.
- gherkin
GherkinLexerhas been deprecated. The class is an implementation detail and should have never been part of the public API.
- go
GolangLexerhas been deprecated. The class is an implementation detail and should have never been part of the public API.
- javascript
TypeScriptLexerhas been deprecated. The class is an implementation detail and should have never been part of the public API.
- julia
JuliaLexerhas been deprecated. The class is an implementation detail and should have never been part of the public API.
- kotlin
KotlinBaseListenerhas been deprecated. The class is an implementation detail and should have never been part of the public API.KotlinLexerhas been deprecated. The class is an implementation detail and should have never been part of the public API.KotlinListenerhas been deprecated. The class is an implementation detail and should have never been part of the public API.
- lua
LuaLexerhas been deprecated. The class is an implementation detail and should have never been part of the public API.
- rust
RustLexerhas been deprecated. The class is an implementation detail and should have never been part of the public API.
- swift
SwiftBaseListenerhas been deprecated. The class is an implementation detail and should have never been part of the public API.SwiftLexerhas been deprecated. The class is an implementation detail and should have never been part of the public API.SwiftListenerhas been deprecated. The class is an implementation detail and should have never been part of the public API.
- tsql
TSqlLexerhas been deprecated. The class is an implementation detail and should have never been part of the public API.
- xml
XMLLexerhas been deprecated. The class is an implementation detail and should have never been part of the public API.
- The generated
KotlinParserandSwiftParserclasses and their nested AST node classes are intentionally not deprecated yet. These classes still contain the public AST node types, which have no replacement API yet. They will be deprecated once we have decided how to handle the inner classes.