The PMD team is pleased to announce PMD 6.10.0.
This is a minor release.
java-codestyle) verifies that numeric literals over a given length (4 chars by default, but configurable) are using underscores every 3 digits for readability. The rule only applies to Java 7+ codebases.
exceptionfile of the rule
has been deprecated and will be removed with 7.0.0. Please use
The properties framework is about to get a lifting, and for that reason, we need to deprecate a lot of APIs to remove them in 7.0.0. The proposed changes to the API are described on the wiki
Construction of property descriptors has been possible through builders since 6.0.0. The 7.0.0 API will only allow
construction through builders. The builder hierarchy, currently found in the package
is being replaced by the simpler
PropertyBuilder. Their APIs enjoy a high degree of source compatibility.
Concrete property classes like
StringMultiProperty will gradually
all be deprecated until 7.0.0. Their usages should be replaced by direct usage of the
Instead of spreading properties across countless classes, the utility class
PropertyFactory will become
from 7.0.0 on the only provider for property descriptor builders. Each current property type will be replaced
by a corresponding method on
IntegerPropertyis replaced by
DoublePropertyare both replaced by
PropertyFactory#doubleProperty. Having a separate property for floats wasn’t that useful.
StringPropertyis replaced by
EnumeratedPropertyis replaced by
BooleanPropertyis replaced by
BooleanMultiProperty, is not replaced, because it doesn’t have a use case.
CharacterPropertyis replaced by
LongPropertyis replaced by
TypePropertyand their multi-valued counterparts are discontinued for lack of a use-case, and have no planned replacement in 7.0.0 for now.
Here’s an example:
// Before 7.0.0, these are equivalent: IntegerProperty myProperty = new IntegerProperty("score", "Top score value", 1, 100, 40, 3.0f); IntegerProperty myProperty = IntegerProperty.named("score").desc("Top score value").range(1, 100).defaultValue(40).uiOrder(3.0f); // They both map to the following in 7.0.0 PropertyDescriptor<Integer> myProperty = PropertyFactory.intProperty("score").desc("Top score value").require(inRange(1, 100)).defaultValue(40);
You’re highly encouraged to migrate to using this new API as soon as possible, to ease your migration to 7.0.0.
and the related builders (in
net.sourceforge.pmd.properties.builders) will be removed.
These specialized interfaces allowed additional constraints to be enforced on the
value of a property, but made the property class hierarchy very large and impractical
to maintain. Their functionality will be mapped uniformly to
which will allow virtually any constraint to be defined, and improve documentation and error reporting. The
PropertyTypeId#isPropertyPackaged are also deprecated.
are deprecated. 7.0.0 will introduce a new XML syntax which will remove the need for such a divide
between single- and multi-valued properties. The method
PropertyDescriptor#isMultiValue will be removed
preferredRowCountis deprecated with no intended replacement. It was never implemented, and does not belong in this interface. The methods
compareTo(PropertyDescriptor)are deprecated for the same reason. These methods mix presentation logic with business logic and are not necessary for PropertyDescriptors to work.
PropertyDescriptorwill not extend
Comparable<PropertyDescriptor>anymore come 7.0.0.
propertyErrorForis deprecated and will be removed with no intended replacement. It’s really just a shortcut for
(T)are deprecated and will be removed. These were used to serialize and deserialize properties to/from a string, but 7.0.0 will introduce a more flexible XML syntax which will make them obsolete.
typeare deprecated and won’t be replaced. The new XML syntax will remove the need for a divide between multi- and single-value properties, and will allow arbitrary types to be represented. Since arbitrary types may be represented,
typewill become obsolete as it can’t represent generic types, which will nevertheless be representable with the XML syntax. It was only used for documentation, but a new way to document these properties exhaustively will be added with 7.0.0.
errorForis deprecated as its return type will be changed to
Optional<String>with the shift to Java 8.
The implementation of the adapters for the XPath engines Saxon and Jaxen (package
are now deprecated. They’ll be moved to an internal package come 7.0.0. Only
Attribute remains public API.
PropertyDescriptorBuilderConversionWrapper, and the methods
These were used to read and write properties to and from XML, but were not intended as public API.
All classes from
net.sourceforge.pmd.lang.java.metrics.impl.visitors are now considered internal API. They’re deprecated
and will be moved into an internal package with 7.0.0. To implement your own metrics visitors,
JavaParserVisitorAdapter should be directly subclassed.
All classes from
net.sourceforge.pmd.properties.modules will be removed.
getVariableName on those two nodes will be removed, too.
All these are deprecated because those nodes may declare several variables at once, possibly
with different types (and obviously with different names). They both implement
though, so you should iterate on each declared variable. See #910.
Visitor decorators are now deprecated and will be removed in PMD 7.0.0. They were originally a way to write composable visitors, used in the metrics framework, but they didn’t prove cost-effective.
The LanguageModules of several languages, that only support CPD execution, have been deprecated. These languages are not fully supported by PMD, so having a language module does not make sense. The functionality of CPD is not affected by this change. The following classes have been deprecated and will be removed with PMD 7.0.0:
Optional AST processing stages like symbol table, type resolution or data-flow analysis will be reified in 7.0.0 to factorise common logic and make them extensible. Further explanations about this change can be found on #1426. Consequently, the following APIs are deprecated for removal:
isMultifile()and their respective setters.