Update dependency pmd to v7.25.0#490
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
7.24.0→7.25.0Release Notes
pmd/pmd (pmd)
v7.25.0: PMD 7.25.0 (29-May-2026)29-May-2026 - 7.25.0
The PMD team is pleased to announce PMD 7.25.0.
This is a minor release.
Table Of Contents
🚀️ 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.
🌟️ New and Changed Rules
New Rules
JUnitJupiterTestNoPrivateModifierfind JUnit test classes andmethods that are private. Test classes, test methods, and lifecycle methods are not required to be public,
but they must not be private. Otherwise, they won’t be found by the test framework.
UnnecessaryBlockreports blocks that are unnecessary asthey don't introduce a new scope. This rule helps simplify code structure by identifying and flagging
redundant blocks that can make code harder to read and may be misleading.
VariableDeclarationUsageDistanceflags local variables that are declaredfar from their usage, which can make code harder to read. The rule has a property
maxDistancethat allows toconfigure the maximum allowed distance between declaration and usage.
AssertStatementInTestdetects usages ofassertstatement in tests.These should be replaced by framework assertion methods such as
assertEquals.Such methods provide better error messages and make test behave correctly when running without
-ea.Changed Rules
OnlyOneReturnhas a new propertyallowGuardIfs. When this property istrue, then guard ifs at the beginning of a method are allowed their return statements don't count.
UseUtilityClassandClassNamingConventionsnow use thesame definition of what a utility class is. The most significant change is, that classes with
main()methods areno longer considered utility classes by
UseUtilityClass.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)UnnecessaryModifierUseUtilityClassRenamed rules and properties
JUnitJupiterTestShouldBePackagePrivate(Java Best Practices) was renamed fromJUnit5TestShouldBePackagePrivate.junitJupiterTestPatternof ruleMethodNamingConventions(Java Code Style) was renamed fromjunit5TestPattern.The old names still work but are deprecated.
🐛️ Fixed Issues
🚨️ API Changes
Deprecations
FieldDeclarationsShouldBeAtStartOfClassRule#visitis an implementation detail ofFieldDeclarationsShouldBeAtStartOfClassRule. It will be removed in a later release.CyclomaticComplexityRule#visitTypeDeclis an implementation detail ofCyclomaticComplexityRule. It will be removed in a later release.SwitchDensityRule#visitSwitchLikeis an implementation detail ofSwitchDensityRule. It will be removed in a later release.PmdKotlinParser#PmdKotlinParserhas been deprecated.Use
KotlinLanguageModule#getInstance,createProcessor,servicesandgetParserinsteadto retrieve a correctly configured parser instance.
KotlinHandler#KotlinHandlerhas been deprecated.Use
getInstance,createProcessorandservicesinstead to access the LanguageVersionHandlerfor Kotlin.
KotlinInnerNode#getImageandKotlinInnerNode#hasImageEqualTohave been deprecated.They have not been used yet in Kotlin and the long-term plan is to remove these methods on each node.
Concrete nodes (subclasses of KotlinInnerNode) should provide a more specific attribute like
"getName" or "getIdentifier" instead and not rely on "getImage".
The same deprecation has been done for
KotlinTerminalNode.See #4787 for more information.
Experimental API
KotlinLanguageProperties#PARSE_TIMEOUT_SECONDSKotlinLanguageProperties#getParseTimeoutSecondsAttributeViewKtClassDeclarationAttributesKtClassParameterAttributesKtCompanionObjectAttributesKtFunctionDeclarationAttributesKtImportAliasAttributesKtImportHeaderAttributesKtVariableDeclarationAttributesHasModifiersHasSimpleIdentifierKotlinInnerNode#attributes.The attributes are also automatically exposed for XPath rules.
✨️ Merged pull requests
📦️ Dependency updates
📈️ Stats
Configuration
📅 Schedule: (in timezone America/Los_Angeles)
* 0-4,22-23 * * 1-5)* * * * 0,6)🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.