PMD v6.15.0 Release Notes
Release Date: 2019-05-26 // almost 5 years ago-
26-May-2019 - 6.15.0
The PMD team is pleased to announce PMD 6.15.0.
π This is a minor release.
Table Of Contents
π New and noteworthy
β¨ Enhanced Matlab support
Thanks to the contributions from Maikel Steneker CPD for Matlab can
π now parse Matlab programs which use the question mark operator to specify access to
class members:classdef Class1 properties (SetAccess = ?Class2)
π CPD also understands now double quoted strings, which are supported since version R2017a of Matlab:
str = "This is a string"
β¨ Enhanced C++ support
π CPD now supports digit separators in C++ (language module "cpp"). This is a C++14 feature.
Example:
auto integer_literal = 1'000'000;
The single quotes can be used to add some structure to large numbers.
π CPD also parses raw string literals now correctly (see #1784).
π New Rules
The new Apex rule
FieldNamingConventions
(apex-codestyle
) checks the naming
0οΈβ£ conventions for field declarations. By default this rule uses the standard Apex naming convention (Camel case),
π§ but it can be configured through properties.The new Apex rule
FormalParameterNamingConventions
(apex-codestyle
) checks the
0οΈβ£ naming conventions for formal parameters of methods. By default this rule uses the standard Apex naming
π§ convention (Camel case), but it can be configured through properties.The new Apex rule
LocalVariableNamingConventions
(apex-codestyle
) checks the
0οΈβ£ naming conventions for local variable declarations. By default this rule uses the standard Apex naming
π§ convention (Camel case), but it can be configured through properties.The new Apex rule
PropertyNamingConventions
(apex-codestyle
) checks the naming
0οΈβ£ conventions for property declarations. By default this rule uses the standard Apex naming convention (Camel case),
π§ but it can be configured through properties.The new Java rule
UseShortArrayInitializer
(java-codestyle
) searches for
array initialization expressions, which can be written shorter.Modified Rules
The Apex rule
ClassNamingConventions
(apex-codestyle
) can now be configured
using various properties for the specific kind of type declarations (e.g. class, interface, enum).
0οΈβ£ As before, this rule uses by default the standard Apex naming convention (Pascal case).The Apex rule
MethodNamingConventions
(apex-codestyle
) can now be configured
β using various properties to differenciate e.g. static methods and test methods.
0οΈβ£ As before, this rule uses by default the standard Apex naming convention (Camel case).The Java rule
FieldNamingConventions
(java-codestyle
) now by default ignores
the fieldserialPersistentFields
. Since this is a field which needs to have this special name, no
field naming conventions can be applied here. It is excluded the same way likeserialVersionUID
via the
propertyexclusions
.The Java rule
CommentRequired
(java-documentation
) has a new property
0οΈβ£serialPersistentFieldsCommentRequired
with the default value "Ignored". This means that from now
on comments for the fieldserialPersistentFields
are not required anymore. You can change the property
βͺ to restore the old behavior.The Java rule
ProperLogger
(java-errorprone
) has two new properties
π§ to configure the logger class (e.g. "org.slf4j.Logger") and the logger name of the special case,
π§ when the logger is not static. The name of the static logger variable was already configurable.
π² The new property "loggerClass" allows to use this rule for different logging frameworks.
This rule covers all the cases of the now deprecated ruleLoggerIsNotStaticFinal
.The Java rule
CommentDefaultAccessModifier
(java-codestyle
) now reports also
π¦ missing comments for top-level classes and annotations, that are package-private.π Deprecated Rules
The Apex rule
VariableNamingConventions
(apex-codestyle
) has been deprecated and
π will be removed with PMD 7.0.0. The rule is replaced by the more general rules
FieldNamingConventions
,
FormalParameterNamingConventions
,
LocalVariableNamingConventions
, and
PropertyNamingConventions
.The Java rule
LoggerIsNotStaticFinal
(java-errorprone
) has been deprecated
and will be removed with PMD 7.0.0. The rule is replaced byProperLogger
.π Fixed Issues
- apex
- cpp
- #1784: [cpp] Improve support for raw string literals
- dart
- #1809: [dart] [cpd] Parse error with escape sequences
- java
- #1842: [java] Annotated module declarations cause parse error
- java-bestpractices
- #1738: [java] MethodReturnsInternalArray does not work in inner classes
- π java-codestyle
- python
- #1810: [python] [cpd] Parse error when using Python 2 backticks
- matlab
API Changes
π Deprecated APIs
For removal
- The
DumpFacades
in all languages, that could be used to transform a AST into a textual representation,
π will be removed with PMD 7. The rule designer is a better way to inspect nodes.net.sourceforge.pmd.lang.apex.ast.DumpFacade
net.sourceforge.pmd.lang.java.ast.DumpFacade
net.sourceforge.pmd.lang.ecmascript.ast.DumpFacade
net.sourceforge.pmd.lang.jsp.ast.DumpFacade
net.sourceforge.pmd.lang.plsql.ast.DumpFacade
net.sourceforge.pmd.lang.vf.ast.DumpFacade
net.sourceforge.pmd.lang.vm.ast.AbstractVmNode#dump
net.sourceforge.pmd.lang.xml.ast.DumpFacade
- The method
LanguageVersionHandler#getDumpFacade
will be
β removed as well. It is deprecated, along with all its implementations in the subclasses ofLanguageVersionHandler
.
External Contributions
- #1647: [java] Rule to detect overly verbose array initialization - Victor
- π§ #1762: [java] LoggerIsNotStaticFinal and ProperLogger - make class-name configurable - Ivo Ε mΓd
- 0οΈβ£ #1798: [java] Make CommentDefaultAccessModifier work for top-level classes - Boris Petrov
- π #1799: [java] MethodReturnsInternalArray does not work in inner classes - Fixed #1738 - Srinivasan Venkatachalam
- π #1802: [python] [cpd] Add support for Python 2 backticks - Maikel Steneker
- #1803: [dart] [cpd] Dart escape sequences - Maikel Steneker
- β #1807: [ci] Fix missing local branch issues when executing pmd-regression-tester - BBG
- #1813: [matlab] [cpd] Matlab comments - Maikel Steneker
- #1816: [apex] Fix ApexDoc handling with inner classes - Jeff Hube
- π§ #1817: [apex] Add configurable naming convention rules - Jeff Hube
- π #1819: [cpp] [cpd] Add support for digit separators - Maikel Steneker
- π #1820: [cpp] [cpd] Improve support for raw string literals - Maikel Steneker
- #1821: [matlab] [cpd] Matlab question mark token - Maikel Steneker
- #1822: [matlab] [cpd] Double quoted string - Maikel Steneker
- π #1837: [core] Minor performance improvements - Michael Hausegger
- #1838: [dart] [cpd] Improved string tokenization - Maikel Steneker
- #1840: [java] Whitelist serialPersistentFields - Marcel HΓ€rle