Open
Conversation
24025ab to
5a23d83
Compare
5a23d83 to
329252a
Compare
329252a to
08935b5
Compare
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.18.0→7.21.0Release Notes
pmd/pmd (pmd)
v7.21.0: PMD 7.21.0 (30-January-2026)30-January-2026 - 7.21.0
The PMD team is pleased to announce PMD 7.21.0.
This is a minor release.
Table Of Contents
🚀️ New and noteworthy
🚀️ New: Java 26 Support
This release of PMD brings support for Java 26.
There are no new standard language features.
There is one preview language feature:
In order to analyze a project with PMD that uses these preview language features,
you'll need to select the new language version
26-preview:Note: Support for Java 24 preview language features have been removed. The version "24-preview"
is no longer available.
Build Requirement is Java 21
From now on, Java 21 or newer is required to build PMD. PMD itself still remains compatible with Java 8,
so that it still can be used in a pure Java 8 environment. This allows us to use the latest
checkstyle version during the build.
CPD
CPD-ON/CPD-OFFcomment pairs. See #6417🌟️ New and Changed Rules
New Rules
PublicMemberInNonPublicTypedetects public members (such as methodsor fields) within non-public types. Non-public types should not declare public members, as their effective
visibility is limited, and using the
publicmodifier can create confusion.UnsupportedJdkApiUsageflags the use of unsupported and non-portableJDK APIs, including
sun.*packages,sun.misc.Unsafe, andjdk.internal.misc.Unsafe. These APIs are unstable,intended for internal use, and may change or be removed. The rule complements Java compiler warnings by
highlighting such usage during code reviews and encouraging migration to official APIs like VarHandle and
the Foreign Function & Memory API.
Changed Rules
The following rules have been changed to use a consistent implementation of enum based
rule properties:
checkAddressTypesof ruleAvoidUsingHardCodedIPhas changed:IPv4useipv4IPv6useipv6IPv4 mapped IPv6useipv4MappedIpv6nullCheckBranchof ruleConfusingTernaryhas changed:AnyuseanyThenusethenElseuseelsetypeAnnotationsof ruleModifierOrderhas changed:ontypeuseonTypeondecluseonDeclCommentRequiredhave changed:RequireduserequiredIgnoreduseignoredUnwanteduseunwantedDeprecated Rules
DontImportSunhas been deprecated. It is replaced byUnsupportedJdkApiUsage.🐛️ Fixed Issues
🚨️ API Changes
Deprecations
MetricOption#valueName: When metrics are used for (rule) properties,then the conventional enum mapping (from SCREAMING_SNAKE_CASE to camelCase) will be used for the enum values.
See
conventionalEnumListProperty.PropertyFactory:enumProperty(String, Map). UseconventionalEnumPropertyinstead.enumProperty(String, Class). UseconventionalEnumPropertyinstead.enumProperty(String, Class, Function). UseconventionalEnumPropertyinstead.enumListProperty(String, Map). UseconventionalEnumListPropertyinstead.enumListProperty(String, Class, Function). UseconventionalEnumListPropertyinstead.AvoidBranchingStatementAsLastInLoopRule#CHECK_FOR. This constant shouldhave never been public.
AvoidBranchingStatementAsLastInLoopRule#CHECK_DO. This constant shouldhave never been public.
AvoidBranchingStatementAsLastInLoopRule#CHECK_WHILE. This constant shouldhave never been public.
AvoidBranchingStatementAsLastInLoopRule#CHECK_BREAK_LOOP_TYPES. This propertydescriptor should have been private. It won't be used anymore. Use
getPropertyDescriptoron the rule to retrieve the property descriptor.
AvoidBranchingStatementAsLastInLoopRule#CHECK_CONTINUE_LOOP_TYPES. This propertydescriptor should have been private. It won't be used anymore. Use
getPropertyDescriptoron the rule to retrieve the property descriptor.
AvoidBranchingStatementAsLastInLoopRule#CHECK_RETURN_LOOP_TYPES. This propertydescriptor should have been private. It won't be used anymore. Use
getPropertyDescriptoron the rule to retrieve the property descriptor.
AvoidBranchingStatementAsLastInLoopRule#check.This method should have been private and will be internalized.
AvoidBranchingStatementAsLastInLoopRule#hasPropertyValue.This method should have been private and will be internalized.
AvoidBranchingStatementAsLastInLoopRule#checksNothing.This method should have been private and will be internalized.
ClassFanOutOption#valueName,CycloOption#valueName,NcssOption#valueNameAbstractMetricTestRule#optionMappings. No extra mapping is required anymore.The
MetricOptionenum values are used. SeeAbstractMetricTestRule(Metric, Class)to provide the enum at construction time.
✨️ Merged pull requests
📦️ Dependency updates
📈️ Stats
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ 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.