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 field serialPersistentFields. 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 like serialVersionUID via the
    property exclusions.

    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 field serialPersistentFields 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 rule LoggerIsNotStaticFinal.

    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 by ProperLogger.

    πŸ›  Fixed Issues

    • apex
      • #1321: [apex] Should VariableNamingConventions require properties to start with a lowercase letter?
      • #1783: [apex] comments on constructor not recognized when the Class has inner class
    • 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
      • #1495: [java] Rule to detect overly verbose array initializiation
      • #1684: [java] Properly whitelist serialPersistentFields
      • #1804: [java] NPE in UnnecessaryLocalBeforeReturnRule
    • python
      • #1810: [python] [cpd] Parse error when using Python 2 backticks
    • matlab
      • #1830: [matlab] [cpd] Parse error with comments
      • #1793: [java] CommentDefaultAccessModifier not working for classes

    API Changes

    πŸ—„ Deprecated APIs

    For removal

    External Contributions