Table of Contents
30-January-2026 - 7.21.0-SNAPSHOT
The PMD team is pleased to announce PMD 7.21.0-SNAPSHOT.
This is a minor release.
🚀️ New and noteworthy
Changed Rules
The following rules have been changed to use a consistent implementation of enum based rule properties:
- The property
checkAddressTypesof ruleAvoidUsingHardCodedIPhas changed:- Instead of
IPv4useipv4 - Instead of
IPv6useipv6 - Instead of
IPv4 mapped IPv6useipv4MappedIpv6 - The old values still work, but you’ll see a deprecation warning.
- Instead of
- The property
nullCheckBranchof ruleConfusingTernaryhas changed:- Instead of
Anyuseany - Instead of
Thenusethen - Instead of
Elseuseelse - The old values still work, but you’ll see a deprecation warning.
- Instead of
- The property
typeAnnotationsof ruleModifierOrderhas changed:- Instead of
ontypeuseonType - Instead of
ondecluseonDecl - The old values still work, but you’ll see a deprecation warning.
- Instead of
- The values of the properties of rule
CommentRequiredhave changed:- Instead of
Requireduserequired - Instead of
Ignoreduseignored - Instead of
Unwanteduseunwanted - The old values still work, but you’ll see a deprecation warning.
- Instead of
🐛️ Fixed Issues
- core
- #6184: [core] Consistent implementation of enum properties
🚨️ API Changes
Deprecations
- core
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. SeeconventionalEnumListProperty.- In
PropertyFactory:enumProperty(String, Map). UseconventionalEnumPropertyinstead.enumProperty(String, Class). UseconventionalEnumPropertyinstead.enumProperty(String, Class, Function). UseconventionalEnumPropertyinstead.enumListProperty(String, Map). UseconventionalEnumListPropertyinstead.enumListProperty(String, Class, Function). UseconventionalEnumListPropertyinstead.
- java
AvoidBranchingStatementAsLastInLoopRule#CHECK_FOR. This constant should have never been public.AvoidBranchingStatementAsLastInLoopRule#CHECK_DO. This constant should have never been public.AvoidBranchingStatementAsLastInLoopRule#CHECK_WHILE. This constant should have never been public.AvoidBranchingStatementAsLastInLoopRule#CHECK_BREAK_LOOP_TYPES. This property descriptor should have been private. It won’t be used anymore. UsegetPropertyDescriptoron the rule to retrieve the property descriptor.AvoidBranchingStatementAsLastInLoopRule#CHECK_CONTINUE_LOOP_TYPES. This property descriptor should have been private. It won’t be used anymore. UsegetPropertyDescriptoron the rule to retrieve the property descriptor.AvoidBranchingStatementAsLastInLoopRule#CHECK_RETURN_LOOP_TYPES. This property descriptor should have been private. It won’t be used anymore. UsegetPropertyDescriptoron 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#valueName
- lang-test
AbstractMetricTestRule#optionMappings. No extra mapping is required anymore. TheMetricOptionenum values are used. SeeAbstractMetricTestRule(Metric, Class)to provide the enum at construction time.