Table of Contents
29-May-2026 - 7.25.0-SNAPSHOT
The PMD team is pleased to announce PMD 7.25.0-SNAPSHOT.
This is a minor release.
🚀️ New and noteworthy
Updated antlr library to 4.13.2
We have updated the antlr library (parser generator) from 4.9.3 to the latest version 4.13.2, in order to be able to use the latest version of Apex parser library.
This is an incompatible update: In case you use custom language modules based on antlr, you need to make sure to regenerate all of your lexers and parsers with the new antlr version.
For the antlr based language modules, that PMD ships (kotlin and swift and various CPD modules), this is already done.
🌟️ Changed Rules
- The rule
OnlyOneReturnhas a new propertyallowGuardIfs. When this property is true, then guard ifs at the beginning of a method are allowed their return statements don’t count. - We are continuously working to improve the precision of violation reporting for various rules.
The goal is to ensure that rules report issues on the correct line and highlight only the relevant lines.
For example, instead of flagging an entire class declaration (including its body), we now generally report only
the class name. For more details, see [java] Single Line Warnings #730
and [java] Review reported locations of rules #3769. While this effort
is still ongoing, the following Java rules have been updated in this release:
AbstractClassWithoutAbstractMethodAbstractClassWithoutAnyMethodAtLeastOneConstructorAvoidDollarSignsAvoidCatchingGenericExceptionAvoidSynchronizedStatement(now reports only on synchronized keyword and not the whole synchronized block)ClassNamingConventionsClassWithOnlyPrivateConstructorsShouldBeFinalCommentDefaultAccessModifierCommentRequiredCouplingBetweenObjects(now reports only on class identifier and not whole compilation unit anymore)CyclomaticComplexityDataClassExcessiveImports(now reports only on imports and not the whole compilation unit anymore)ExcessiveParameterListExcessivePublicCountExhaustiveSwitchHasDefault(now reports only on switch keyword and not the whole switch block)GodClassImplicitFunctionalInterfaceJUnit5TestShouldBePackagePrivateLocalHomeNamingConventionLocalInterfaceSessionNamingConventionMissingSerialVersionUIDMissingStaticMethodInNonInstantiatableClassNcssCountNonExhaustiveSwitch(now reports only on switch keyword and not the whole switch block)NoPackagePublicMemberInNonPublicTypeShortClassNameSingleMethodSingletonSwitchDensity(now reports only on switch keyword and not the whole switch block)TestClassWithoutTestCasesTooFewBranchesForSwitch(now reports only on switch keyword and not the whole switch block)TooManyFields(now reports only on class identifier and not the whole class body anymore)TooManyMethods(now reports only on class identifier and not the whole class body anymore)TooManyStaticImports(now reports only on the first static import and not the whole compilation unit anymore)UnnecessaryModifierUseUtilityClass
🐛️ Fixed Issues
- core
- java
- #5721: [java] StackOverflowError in 7.17.0 with nested wildcard generics
- java-bestpractices
- #3212: [java] Enhance UseStandardCharsets to flag some constructors of IO-related classes
- java-codestyle
- java-errorprone
- java-multithreading
- #6520: [java] DoNotUseThreads: False positive on legitimate java.lang.Thread.onSpinWait() call
- kotlin
- #6648: [kotlin] Multi-dollar interpolation parse error in annotations
🚨️ API Changes
✨️ Merged pull requests
- #6084: [java] Shrink reported locations for some rules - UncleOwen (@UncleOwen)
- #6522: [java] Fix #6520: DoNotUseThreads: fix false positive on Thread.onSpinWait() - leemeii (@leemeii)
- #6524: [java] Fix #6517: UselessPureMethodCall: fix false negative for primitive streams - leemeii (@leemeii)
- #6553: [java] Fix StackOverflowError in TypeOps projection of cyclic captured type vars - Sebastian Lövdahl (@slovdahl)
- #6561: [java] Fix #6163: ConstructorCallsOverridableMethod: False positive with call to enclosing class - Lukas Gräf (@lukasgraef)
- #6573: [java] Fix #6427: Add bitwise and/or/xor to BINARY_PROMOTED_OPS - UncleOwen (@UncleOwen)
- #6587: [java] Fix #2801: Add a property to OnlyOneReturnRule to allow guard ifs - UncleOwen (@UncleOwen)
- #6597: [java] Fix #3212: Enhance UseStandardCharsets - UncleOwen (@UncleOwen)
- #6601: [java] Fix #4288: Document that CallSuperFirst and CallSuperLast are android only - UncleOwen (@UncleOwen)
- #6605: [java] Fix #6308: Add syntax highlighting to MarkdownRenderer - UncleOwen (@UncleOwen)
- #6621: [core] Fix #4972: Update antlr from 4.9.3 to 4.13.2 - UncleOwen (@UncleOwen)
- #6623: [java] Cleanup: Remove TODO from ModifierOwner.getVisibility() - UncleOwen (@UncleOwen)
- #6646: [test] Split up AbstractRuleSetFactoryTest.testAllPMDBuiltInRulesMeetConventions() - UncleOwen (@UncleOwen)
- #6653: [kotlin] Fix #6648: Multi-dollar interpolation for regular strings - Peter Paul Bakker (@stokpop)
- #6654: [swift] Fix invalid swift token OSXApplicationExtension - Andreas Dangel (@adangel)