* Downloads: https://github.com/pmd/pmd/releases/tag/pmd_releases%2F6.19.0
* Documentation: https://pmd.github.io/pmd-6.19.0/
31-October-2019 - 6.19.0
The PMD team is pleased to announce PMD 6.19.0.
This is a minor release.
Table Of Contents
* New and noteworthy
<https://sourceforge.net/p/pmd/news/2019/10/pmd-6190-released/#new-and-noteworthy>
o Updated PMD Designer
<https://sourceforge.net/p/pmd/news/2019/10/pmd-6190-released/#updated-pmd-designer>
o Java Metrics
<https://sourceforge.net/p/pmd/news/2019/10/pmd-6190-released/#java-metrics>
o Modified Rules
<https://sourceforge.net/p/pmd/news/2019/10/pmd-6190-released/#modified-rules>
o Renamed Rules
<https://sourceforge.net/p/pmd/news/2019/10/pmd-6190-released/#renamed-rules>
* Fixed Issues
<https://sourceforge.net/p/pmd/news/2019/10/pmd-6190-released/#fixed-issues>
* API Changes
<https://sourceforge.net/p/pmd/news/2019/10/pmd-6190-released/#api-changes>
o Deprecated APIs
<https://sourceforge.net/p/pmd/news/2019/10/pmd-6190-released/#deprecated-apis>
+ For removal
<https://sourceforge.net/p/pmd/news/2019/10/pmd-6190-released/#for-removal>
+ Internal APIs
<https://sourceforge.net/p/pmd/news/2019/10/pmd-6190-released/#internal-apis>
* External Contributions
<https://sourceforge.net/p/pmd/news/2019/10/pmd-6190-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.19.0>.
Java Metrics
* The new metric "Class Fan Out Complexity" has been added. See
Java Metrics Documentation
<https://sourceforge.net/p/pmd/news/2019/10/pmd_java_metrics_index.html#class-fan-out-complexity-class_fan_out>
for details.
Modified Rules
*
The Java rules |InvalidLogMessageFormat|
<https://pmd.github.io/pmd-6.19.0/pmd_rules_java_errorprone.html#invalidlogmessageformat>
and |MoreThanOneLogger|
<https://pmd.github.io/pmd-6.19.0/pmd_rules_java_errorprone.html#morethanonelogger>
(|java-errorprone|) now both support Log4j2
<https://logging.apache.org/log4j/2.x/>. Note that the
rule "InvalidSlf4jMessageFormat" has been renamed to
"InvalidLogMessageFormat" to reflect the fact, that it now
supports more than slf4j.
*
The Java rule |LawOfDemeter|
<https://pmd.github.io/pmd-6.19.0/pmd_rules_java_design.html#lawofdemeter>
(|java-design|) ignores now also Builders, that are
not assigned to a local variable, but just directly used within a
method call chain. The method, that creates
the builder needs to end with "Builder", e.g. |newBuilder()| or
|initBuilder()| works. This change
fixes a couple of false positives.
*
The Java rule |DataflowAnomalyAnalysis|
<https://pmd.github.io/pmd-6.19.0/pmd_rules_java_errorprone.html#dataflowanomalyanalysis>
(|java-errorprone|) doesn't check for
UR anomalies (undefined and then referenced) anymore. These checks
were all false-positives, since actual
UR occurrences would lead to compile errors.
*
The java rule |DoNotUseThreads|
<https://pmd.github.io/pmd-6.19.0/pmd_rules_java_multithreading.html#donotusethreads>
(|java-multithreading|) has been changed
to not report usages of |java.lang.Runnable| anymore. Just using
|Runnable| does not automatically create
a new thread. While the check for |Runnable| has been removed, the
rule now additionally checks for
usages of |Executors| and |ExecutorService|. Both create new
threads, which are not managed by a J2EE
server.
Renamed Rules
* The Java rule |InvalidSlf4jMessageFormat|
<https://pmd.github.io/pmd-6.19.0/pmd_rules_java_errorprone.html#invalidslf4jmessageformat>
has been renamed to
|InvalidLogMessageFormat|
<https://pmd.github.io/pmd-6.19.0/pmd_rules_java_errorprone.html#invalidlogmessageformat>
since it supports now both slf4j and log4j2
message formats.
Fixed Issues
* core
o #1978 <https://github.com/pmd/pmd/issues/1978>: [core] PMD fails
on excluding unknown rules
o #2014 <https://github.com/pmd/pmd/issues/2014>: [core] Making
add(SourceCode sourceCode) public for alternative file systems
o #2020 <https://github.com/pmd/pmd/issues/2020>: [core] Wrong
deprecation warnings for unused XPath attributes
o #2036 <https://github.com/pmd/pmd/issues/2036>: [core] Wrong
include/exclude patterns are silently ignored
o #2048 <https://github.com/pmd/pmd/issues/2048>: [core] Enable
type resolution by default for XPath rules
o #2067 <https://github.com/pmd/pmd/issues/2067>: [core] Build
issue on Windows
o #2068 <https://github.com/pmd/pmd/pull/2068>: [core] Rule loader
should use the same resources loader for the ruleset
o #2071 <https://github.com/pmd/pmd/issues/2071>: [ci] Add travis
build on windows
o #2072 <https://github.com/pmd/pmd/issues/2072>: [test][core] Not
enough info in "test setup error" when numbers of lines do not match
o #2082 <https://github.com/pmd/pmd/issues/2082>: [core] Incorrect
logging of deprecated/renamed rules
* java
o #2042 <https://github.com/pmd/pmd/issues/2042>: [java] PMD
crashes with ClassFormatError: Absent Code attribute...
* java-bestpractices
o #1531 <https://github.com/pmd/pmd/issues/1531>: [java]
UnusedPrivateMethod false-positive with method result
o #2025 <https://github.com/pmd/pmd/issues/2025>: [java]
UnusedImports when @see <https://sourceforge.net/u/see/> / @link
<https://sourceforge.net/u/link/> pattern includes a FQCN
* java-codestyle
o #2017 <https://github.com/pmd/pmd/issues/2017>: [java]
UnnecessaryFullyQualifiedName triggered for inner class
* java-design
o #1912 <https://github.com/pmd/pmd/issues/1912>: [java] Metrics
not computed correctly with annotations
* java-errorprone
o #336 <https://github.com/pmd/pmd/issues/336>: [java]
InvalidSlf4jMessageFormat applies to log4j2
o #1636 <https://github.com/pmd/pmd/issues/1636>: [java] Stop
checking UR anomalies for DataflowAnomalyAnalysis
* java-multithreading
o #1627 <https://github.com/pmd/pmd/issues/1627>: [java]
DoNotUseThreads should not warn on Runnable
* doc
o #2058 <https://github.com/pmd/pmd/issues/2058>: [doc] CLI
reference for |-norulesetcompatibility| shows a boolean default
value
API Changes
Deprecated APIs
For removal
* pmd-core
o All the package |net.sourceforge.pmd.dcd|
<https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.19.0/net/sourceforge/pmd/dcd/package-summary.html#>
and its subpackages. See |DCD|
<https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.19.0/net/sourceforge/pmd/dcd/DCD.html#>.
o In |LanguageRegistry|
<https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.19.0/net/sourceforge/pmd/lang/LanguageRegistry.html#>:
+ |commaSeparatedTerseNamesForLanguageVersion|
<https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.19.0/net/sourceforge/pmd/lang/LanguageRegistry.html#commaSeparatedTerseNamesForLanguageVersion(List)>
+ |commaSeparatedTerseNamesForLanguage|
<https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.19.0/net/sourceforge/pmd/lang/LanguageRegistry.html#commaSeparatedTerseNamesForLanguage(List)>
+ |findAllVersions|
<https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.19.0/net/sourceforge/pmd/lang/LanguageRegistry.html#findAllVersions()>
+ |findLanguageVersionByTerseName|
<https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.19.0/net/sourceforge/pmd/lang/LanguageRegistry.html#findLanguageVersionByTerseName(String)>
+ |getInstance|
<https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.19.0/net/sourceforge/pmd/lang/LanguageRegistry.html#getInstance()>
o |RuleSet#getExcludePatterns|
<https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.19.0/net/sourceforge/pmd/RuleSet.html#getExcludePatterns()>.
Use the new method |getFileExclusions|
<https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.19.0/net/sourceforge/pmd/RuleSet.html#getFileExclusions()>
instead.
o |RuleSet#getIncludePatterns|
<https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.19.0/net/sourceforge/pmd/RuleSet.html#getIncludePatterns()>.
Use the new method |getFileInclusions|
<https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.19.0/net/sourceforge/pmd/RuleSet.html#getFileInclusions()>
instead.
o |Parser#canParse|
<https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.19.0/net/sourceforge/pmd/lang/Parser.html#canParse()>
o |Parser#getSuppressMap|
<https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.19.0/net/sourceforge/pmd/lang/Parser.html#getSuppressMap()>
o |RuleBuilder#RuleBuilder|
<https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.19.0/net/sourceforge/pmd/rules/RuleBuilder.html#RuleBuilder(String,String,String)>.
Use the new constructor with the correct ResourceLoader instead.
o |RuleFactory#RuleFactory|
<https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.19.0/net/sourceforge/pmd/rules/RuleFactory.html#RuleFactory()>.
Use the new constructor with the correct ResourceLoader instead.
* pmd-java
o |CanSuppressWarnings|
<https://javadoc.io/page/net.sourceforge.pmd/pmd-java/6.19.0/net/sourceforge/pmd/lang/java/ast/CanSuppressWarnings.html#>
and its implementations
o |isSuppressed|
<https://javadoc.io/page/net.sourceforge.pmd/pmd-java/6.19.0/net/sourceforge/pmd/lang/java/rule/AbstractJavaRule.html#isSuppressed(Node)>
o |getDeclaringType|
<https://javadoc.io/page/net.sourceforge.pmd/pmd-java/6.19.0/net/sourceforge/pmd/lang/java/rule/AbstractJavaRule.html#getDeclaringType(Node)>.
o |isSupressed|
<https://javadoc.io/page/net.sourceforge.pmd/pmd-java/6.19.0/net/sourceforge/pmd/lang/java/rule/JavaRuleViolation.html#isSupressed(Node,Rule)>
o |ASTMethodDeclarator|
<https://javadoc.io/page/net.sourceforge.pmd/pmd-java/6.19.0/net/sourceforge/pmd/lang/java/ast/ASTMethodDeclarator.html#>
o |getMethodName|
<https://javadoc.io/page/net.sourceforge.pmd/pmd-java/6.19.0/net/sourceforge/pmd/lang/java/ast/ASTMethodDeclaration.html#getMethodName()>
o |getBlock|
<https://javadoc.io/page/net.sourceforge.pmd/pmd-java/6.19.0/net/sourceforge/pmd/lang/java/ast/ASTMethodDeclaration.html#getBlock()>
o |getParameterCount|
<https://javadoc.io/page/net.sourceforge.pmd/pmd-java/6.19.0/net/sourceforge/pmd/lang/java/ast/ASTConstructorDeclaration.html#getParameterCount()>
* pmd-apex
o |CanSuppressWarnings|
<https://javadoc.io/page/net.sourceforge.pmd/pmd-apex/6.19.0/net/sourceforge/pmd/lang/apex/ast/CanSuppressWarnings.html#>
and its implementations
o |isSupressed|
<https://javadoc.io/page/net.sourceforge.pmd/pmd-apex/6.19.0/net/sourceforge/pmd/lang/apex/rule/ApexRuleViolation.html#isSupressed(Node,Rule)>
Internal APIs
* pmd-core
o All the package |net.sourceforge.pmd.util|
<https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.19.0/net/sourceforge/pmd/util/package-summary.html#>
and its subpackages,
except |net.sourceforge.pmd.util.datasource|
<https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.19.0/net/sourceforge/pmd/util/datasource/package-summary.html#>
and |net.sourceforge.pmd.util.database|
<https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.19.0/net/sourceforge/pmd/util/database/package-summary.html#>.
o |GridBagHelper|
<https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.19.0/net/sourceforge/pmd/cpd/GridBagHelper.html#>
o |ColumnDescriptor|
<https://javadoc.io/page/net.sourceforge.pmd/pmd-core/6.19.0/net/sourceforge/pmd/renderers/ColumnDescriptor.html#>
External Contributions
* #2010 <https://github.com/pmd/pmd/pull/2010>: [java] LawOfDemeter to
support inner builder pattern - Gregor Riegler
<https://github.com/gregorriegler>
* #2012 <https://github.com/pmd/pmd/pull/2012>: [java] Fixes 336,
slf4j log4j2 support - Mark Hall <https://github.com/markhall82>
* #2032 <https://github.com/pmd/pmd/pull/2032>: [core] Allow adding
SourceCode directly into CPD - Nathan Braun
<https://github.com/nbraun-Google>
* #2047 <https://github.com/pmd/pmd/pull/2047>: [java] Fix computation
of metrics with annotations - Andi Pabst <https://github.com/andipabst>
* #2065 <https://github.com/pmd/pmd/pull/2065>: [java] Stop checking
UR anomalies - Carlos Macasaet <https://github.com/l0s>
* #2068 <https://github.com/pmd/pmd/pull/2068>: [core] Rule loader
should use the same resources loader for the ruleset - Chen Yang
<https://github.com/willamette>
* #2070 <https://github.com/pmd/pmd/pull/2070>: [core] Fix renderer
tests for windows builds - Saladoc <https://github.com/Saladoc>
* #2073 <https://github.com/pmd/pmd/pull/2073>: [test][core] Add
expected and actual line of numbers to message wording - snuyanzin
<https://github.com/snuyanzin>
* #2076 <https://github.com/pmd/pmd/pull/2076>: [java] Add Metric
ClassFanOutComplexity - Andi Pabst <https://github.com/andipabst>
* #2078 <https://github.com/pmd/pmd/pull/2078>: [java] DoNotUseThreads
should not warn on Runnable #1627 - Michael Clay
<https://github.com/mclay>
|