[pmd-devel] [ANNOUNCE] PMD 6.16.0 Released
A source code analyzer
Brought to you by:
adangel,
juansotuyo
|
From: Andreas D. <and...@pm...> - 2019-06-30 09:08:29
|
* Downloads: https://github.com/pmd/pmd/releases/tag/pmd_releases%2F6.16.0 * Documentation: https://pmd.github.io/pmd-6.16.0/ 30-June-2019 - 6.16.0 The PMD team is pleased to announce PMD 6.16.0. This is a minor release. Table Of Contents * New and noteworthy <https://sourceforge.net/p/pmd/news/2019/06/pmd-6160-released/#new-and-noteworthy> o Updated PMD Designer <https://sourceforge.net/p/pmd/news/2019/06/pmd-6160-released/#updated-pmd-designer> o PLSQL Grammar Updates <https://sourceforge.net/p/pmd/news/2019/06/pmd-6160-released/#plsql-grammar-updates> o New Rules <https://sourceforge.net/p/pmd/news/2019/06/pmd-6160-released/#new-rules> o Modified Rules <https://sourceforge.net/p/pmd/news/2019/06/pmd-6160-released/#modified-rules> o Deprecated Rules <https://sourceforge.net/p/pmd/news/2019/06/pmd-6160-released/#deprecated-rules> * Fixed Issues <https://sourceforge.net/p/pmd/news/2019/06/pmd-6160-released/#fixed-issues> * API Changes <https://sourceforge.net/p/pmd/news/2019/06/pmd-6160-released/#api-changes> o Deprecated APIs <https://sourceforge.net/p/pmd/news/2019/06/pmd-6160-released/#deprecated-apis> + In ASTs <https://sourceforge.net/p/pmd/news/2019/06/pmd-6160-released/#in-asts> * External Contributions <https://sourceforge.net/p/pmd/news/2019/06/pmd-6160-released/#external-contributions> New and noteworthy Updated PMD Designer This PMD release ships a new version of the pmd-designer. For the changes, see PMD Designer Changelog <https://github.com/pmd/pmd-designer/releases/tag/6.16.0>. PLSQL Grammar Updates The grammar has been updated to support inline constraints in CREATE TABLE statements. Additionally, the CREATE TABLE statement may now be followed by physical properties and table properties. However, these properties are skipped over during parsing. The CREATE VIEW statement now supports subquery views. The EXTRACT function can now be parsed correctly. It is used to extract values from a specified datetime field. Also date time literals are parsed now correctly. The CASE expression can now be properly used within SELECT statements. Table aliases are now supported when specifying columns in INSERT INTO clauses. New Rules * The Java rule |DoubleBraceInitialization| <https://pmd.github.io/pmd-6.16.0/pmd_rules_java_bestpractices.html#doublebraceinitialization> (|java-bestpractices|) detects non static initializers in anonymous classes also known as "double brace initialization". This can be problematic, since a new class file is generated and object holds a strong reference to the surrounding class. Note: This rule is also part of the Java quickstart ruleset (|rulesets/java/quickstart.xml|). Modified Rules * The Java rule |UnusedPrivateField| <https://pmd.github.io/pmd-6.16.0/pmd_rules_java_bestpractices.html#unusedprivatefield> (|java-bestpractices|) now ignores by default fields, that are annotated with the Lombok experimental annotation |@Delegate|. This can be customized with the property |ignoredAnnotations|. * The Java rule |SingularField| <https://pmd.github.io/pmd-6.16.0/pmd_rules_java_design.html#singularfield> (|java-design|) now ignores by default fields, that are annotated with the Lombok experimental annotation |@Delegate|. This can be customized with the property |ignoredAnnotations|. * The Java rules |UnsynchronizedStaticFormatter| <https://pmd.github.io/pmd-6.16.0/pmd_rules_java_multithreading.html#unsynchronizedstaticformatter> and |UnsynchronizedStaticDateFormatter| <https://pmd.github.io/pmd-6.16.0/pmd_rules_java_multithreading.html#unsynchronizedstaticdateformatter> (|java-multithreading|) now prefer synchronized blocks by default. They will raise a violation, if the synchronization is implemented on the method level. To allow the old behavior, the new property |allowMethodLevelSynchronization| can be enabled. * The Java rule |UseUtilityClass| <https://pmd.github.io/pmd-6.16.0/pmd_rules_java_design.html#useutilityclass> (|java-design|) has a new property |ignoredAnnotations|. By default, classes that are annotated with Lombok's |@UtilityClass| are ignored now. * The Java rule |NonStaticInitializer| <https://pmd.github.io/pmd-6.16.0/pmd_rules_java_errorprone.html#nonstaticinitializer> (|java-errorprone|) does not report non static initializers in anonymous classes anymore. For this use case, there is a new rule now: |DoubleBraceInitialization| <https://pmd.github.io/pmd-6.16.0/pmd_rules_java_bestpractices.html#doublebraceinitialization> (|java-bestpractices|). * The Java rule |CommentDefaultAccessModifier| <https://pmd.github.io/pmd-6.16.0/pmd_rules_java_codestyle.html#commentdefaultaccessmodifier> (|java-errorprone|) now by default searches for any unclosed |java.lang.AutoCloseable| resource. This includes now the standard |java.io.*Stream| classes. Previously only SQL-related resources were considered by this rule. The types can still be configured via the |types| property. Some resources do not need to be closed (e.g. |ByteArrayOutputStream|). These exceptions can be configured via the new property |allowedResourceTypes|. In order to restore the old behaviour, just remove the type |java.lang.AutoCloseable| from the |types| property and keep the remaining SQL-related classes. Deprecated Rules * The Java rule |AvoidFinalLocalVariable| <https://pmd.github.io/pmd-6.16.0/pmd_rules_java_codestyle.html#avoidfinallocalvariable> (|java-codestyle|) has been deprecated and will be removed with PMD 7.0.0. The rule is controversial and also contradicts other existing rules such as |LocalVariableCouldBeFinal| <https://pmd.github.io/pmd-6.16.0/pmd_rules_java_codestyle.html#localvariablecouldbefinal>. If the goal is to avoid defining constants in a scope smaller than the class, then the rule |AvoidDuplicateLiterals| <https://pmd.github.io/pmd-6.16.0/pmd_rules_java_errorprone.html#avoidduplicateliterals> should be used instead. Fixed Issues * apex o #1664 <https://github.com/pmd/pmd/issues/1664>: [apex] False positive ApexSharingViolationsRule, unsupported Apex feature * java o #1848 <https://github.com/pmd/pmd/issues/1848>: [java] Local classes should preserve their modifiers * java-bestpractices o #1703 <https://github.com/pmd/pmd/issues/1703>: [java] UnusedPrivateField on member annotated with lombok @Delegate o #1845 <https://github.com/pmd/pmd/issues/1845>: [java] Regression in MethodReturnsInternalArray not handling enums o #1854 <https://github.com/pmd/pmd/issues/1854>: [java] Rule to check for double brace initialisation * java-codestyle o #1612 <https://github.com/pmd/pmd/issues/1612>: [java] Deprecate AvoidFinalLocalVariable o #1880 <https://github.com/pmd/pmd/issues/1880>: [java] CommentDefaultAccessModifier should be configurable for top-level classes * java-design o #1094 <https://github.com/pmd/pmd/issues/1094>: [java] UseUtilityClass should be LombokAware * java-errorprone o #1000 <https://github.com/pmd/pmd/issues/1000>: [java] The rule CloseResource should deal with IO stream as default o #1853 <https://github.com/pmd/pmd/issues/1853>: [java] False positive for NonStaticInitializer in anonymous class * java-multithreading o #1814 <https://github.com/pmd/pmd/issues/1814>: [java] UnsynchronizedStaticFormatter documentation and implementation wrong o #1815 <https://github.com/pmd/pmd/issues/1815>: [java] False negative in UnsynchronizedStaticFormatter * plsql o #1828 <https://github.com/pmd/pmd/issues/1828>: [plsql] Parentheses stopped working o #1850 <https://github.com/pmd/pmd/issues/1850>: [plsql] Parsing errors with INSERT using returning or records and TRIM expression o #1873 <https://github.com/pmd/pmd/issues/1873>: [plsql] Expression list not working o #1878 <https://github.com/pmd/pmd/issues/1878>: [pslql] ParseException when parsing USING o #1879 <https://github.com/pmd/pmd/issues/1879>: [pslql] ParseException when parsing LEFT JOIN API Changes Deprecated APIs Reminder: Please don't use members marked with the annotation |InternalApi| <https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.16.0/net/sourceforge/pmd/annotation/InternalApi.html#>, as they will likely be removed, hidden, or otherwise intentionally broken with 7.0.0. In ASTs As part of the changes we'd like to do to AST classes for 7.0.0, we would like to hide some methods and constructors that rule writers should not have access to. The following usages are now deprecated *in the Java AST* (with other languages to come): * Manual instantiation of nodes. *Constructors of node classes are deprecated* and marked |InternalApi| <https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.16.0/net/sourceforge/pmd/annotation/InternalApi.html#>. Nodes should only be obtained from the parser, which for rules, means that never need to instantiate node themselves. Those constructors will be made package private with 7.0.0. * *Subclassing of abstract node classes, or usage of their type*. Version 7.0.0 will bring a new set of abstractions that will be public API, but the base classes are and will stay internal. You should not couple your code to them. * In the meantime you should use interfaces like |JavaNode| <https://javadoc.io/page/net.sourceforge.pmd/pmd-java/6.16.0/net/sourceforge/pmd/lang/java/ast/JavaNode.html#> or |Node| <https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.16.0/net/sourceforge/pmd/lang/ast/Node.html#>, or the other published interfaces in this package, to refer to nodes generically. * Concrete node classes will *be made final* with 7.0.0. * Setters found in any node class or interface. *Rules should consider the AST immutable*. We will make those setters package private with 7.0.0. Please look at |net.sourceforge.pmd.lang.java.ast| <https://javadoc.io/page/net.sourceforge.pmd/pmd-java/6.16.0/net/sourceforge/pmd/lang/java/ast/package-summary.html#> to find out the full list of deprecations. External Contributions * #1482 <https://github.com/pmd/pmd/pull/1482>: [java] Explain the existence of AvoidFinalLocalVariable in it's description - Karl-Philipp Richter <https://github.com/krichter722> * #1792 <https://github.com/pmd/pmd/pull/1792>: [java] Added lombok.experimental to AbstractLombokAwareRule - jakivey32 <https://github.com/jakivey32> * #1808 <https://github.com/pmd/pmd/pull/1808>: [plsql] Fix PL/SQL Syntax errors - Hugo Araya Nash <https://github.com/kabroxiko> * #1829 <https://github.com/pmd/pmd/pull/1829>: [java] Fix false negative in UnsynchronizedStaticFormatter - Srinivasan Venkatachalam <https://github.com/Srini1993> * #1847 <https://github.com/pmd/pmd/pull/1847>: [java] Regression in MethodReturnsInternalArray not handling enums - Artem <https://github.com/KroArtem> * #1863 <https://github.com/pmd/pmd/pull/1863>: [plsql] Add Table InlineConstraint - Hugo Araya Nash <https://github.com/kabroxiko> * #1864 <https://github.com/pmd/pmd/pull/1864>: [plsql] Add support for Subquery Views - Hugo Araya Nash <https://github.com/kabroxiko> * #1865 <https://github.com/pmd/pmd/pull/1865>: [plsql] Add Support for Extract Expression - Hugo Araya Nash <https://github.com/kabroxiko> * #1874 <https://github.com/pmd/pmd/pull/1874>: [plsql] Add parenthesis equation support for Update - Hugo Araya Nash <https://github.com/kabroxiko> * #1876 <https://github.com/pmd/pmd/pull/1876>: [plsql] Datetime support for queries - Hugo Araya Nash <https://github.com/kabroxiko> * #1883 <https://github.com/pmd/pmd/pull/1883>: [plsql] Fix #1873 Expression list not working - Hugo Araya Nash <https://github.com/kabroxiko> * #1884 <https://github.com/pmd/pmd/pull/1884>: [plsql] fix #1878 Support explicit INNER word for INNER JOIN - Hugo Araya Nash <https://github.com/kabroxiko> * #1885 <https://github.com/pmd/pmd/pull/1885>: [plsql] Correct case expression - Hugo Araya Nash <https://github.com/kabroxiko> * #1886 <https://github.com/pmd/pmd/pull/1886>: [plsql] Support table alias for Insert Clause - Hugo Araya Nash <https://github.com/kabroxiko> |