[pmd-devel] [ANNOUNCE] PMD 5.8.0 Released
A source code analyzer
Brought to you by:
adangel,
juansotuyo
|
From: Andreas D. <ad...@us...> - 2017-06-24 21:18:44
|
24-June-2017 - 5.8.0
The PMD team is pleased to announce PMD 5.8.0.
This is a minor release.
Table Of Contents
* New and noteworthy <#>
o Java Type Resolution <#>
o Metrics Framework <#>
o Modified Rules <#>
o Deprecated Rules <#>
* Fixed Issues <#>
* External Contributions <#>
New and noteworthy
Java Type Resolution
As part of Google Summer of Code 2017, Bendegúz Nagy
<https://github.com/WinterGrascph> has been working on completing type
resolution for Java. His progress so far has allowed to properly
resolve, in addition to previously supported statements:
* References to |this| and |super|, even when qualified
* References to fields, even when chained
(ie: |this.myObject.aField|), and properly handling inheritance /
shadowing
Lambda parameter types where these are infered rather than explicit are
still not supported. Expect future releases to do so.
Metrics Framework
As part of Google Summer of Code 2017, Clément Fournier
<https://github.com/oowekyala> has been working on a new metrics
framework for object-oriented metrics.
The basic groundwork has been done already and with this release,
including a first rule based on the metrics framework as a
proof-of-concept: The rule /CyclomaticComplexity/, currently in the
temporary ruleset /java-metrics/, uses the Cyclomatic Complexity metric
to find overly complex code. This rule will eventually replace the
existing three /CyclomaticComplexity/rules that are currently defined in
the /java-codesize/ ruleset (see also issue #445
<https://github.com/pmd/pmd/issues/445>).
Since this work is still in progress, the metrics API
(package |net.sourceforge.pmd.lang.java.oom|) is not finalized yet and
is expected to change.
Modified Rules
* The Java rule |UnnecessaryFinalModifier| (ruleset java-unnecessary)
now also reports on private methods marked as|final|. Being private,
such methods can't be overriden, and therefore, the final keyword is
redundant.
* The Java rule |PreserveStackTrace| (ruleset java-design) has been
relaxed to support the builder pattern on thrown exception. This
change may introduce some false positives if using the exception in
non-orthodox ways for things other than setting the root cause of
the exception. Contact us if you find any such scenarios.
* The ruleset java-junit now properly detects JUnit5, and rules are
being adapted to the changes on it's API. This support is, however,
still incomplete. Let us know of any uses we are still missing on
the issue tracker <https://github.com/pmd/pmd/issues>
* The Java rule |EmptyTryBlock| (ruleset java-empty) now allows empty
blocks when using try-with-resources.
* The Java rule |EmptyCatchBlock| (ruleset java-empty) now exposes a
new property called |allowExceptionNameRegex|. This allow to setup a
regular expression for names of exceptions you wish to ignore for
this rule. For instance, setting it to|^(ignored|expected)$| would
ignore all empty catch blocks where the catched exception is named
either |ignored| or|expected|. The default ignores no exceptions,
being backwards compatible.
Deprecated Rules
* The three complexity
rules |CyclomaticComplexity|, |StdCyclomaticComplexity|, |ModifiedCyclomaticComplexity| (ruleset
java-codesize) have been deprecated. They will be eventually
replaced by a new CyclomaticComplexity rule based on the metrics
framework. See also issue #445 <https://github.com/pmd/pmd/issues/445>.
Fixed Issues
* General
o #380 <https://github.com/pmd/pmd/issues/380>: [core] NPE in
RuleSet.hashCode
o #407 <https://github.com/pmd/pmd/issues/407>: [web] Release date
is not properly formatted
o #429 <https://github.com/pmd/pmd/issues/429>: [core] Error when
running PMD from folder with space
* apex
o #427 <https://github.com/pmd/pmd/issues/427>: [apex] CPD error
when parsing apex code from release 5.5.3
* cpp
o #431 <https://github.com/pmd/pmd/issues/431>: [cpp] CPD gives
wrong duplication blocks for CPP code
* java
o #414 <https://github.com/pmd/pmd/issues/414>: [java] Java 8
parsing problem with annotations for wildcards
o #415 <https://github.com/pmd/pmd/issues/415>: [java] Parsing
Error when having an Annotated Inner class
o #417 <https://github.com/pmd/pmd/issues/417>: [java] Parsing
Problem with Annotation for Array Member Types
* java-design
o #397 <https://github.com/pmd/pmd/issues/397>: [java]
ConstructorCallsOverridableMethodRule: false positive for method
called from lambda expression
o #410 <https://github.com/pmd/pmd/issues/410>: [java]
ImmutableField: False positive with lombok
o #422 <https://github.com/pmd/pmd/issues/422>: [java]
PreserveStackTraceRule: false positive when using builder pattern
* java-empty
o #413 <https://github.com/pmd/pmd/issues/413>: [java]
EmptyCatchBlock don't fail when exception is named ignore / expected
o #432 <https://github.com/pmd/pmd/issues/432>: [java]
EmptyTryBlock: false positive for empty try-with-resource
* java-imports:
o #348 <https://github.com/pmd/pmd/issues/348>: [java]
imports/UnusedImport rule not considering static inner classes
of imports
* java-junit
o #428 <https://github.com/pmd/pmd/issues/428>: [java] PMD
requires public modifier on JUnit 5 test
o #465 <https://github.com/pmd/pmd/issues/465>: [java]
NullPointerException in JUnitTestsShouldIncludeAssertRule
* java-logging:
o #365 <https://github.com/pmd/pmd/issues/365>: [java]
InvalidSlf4jMessageFormat does not handle inline incrementation
of arguments
* java-strictexceptions
o #350 <https://github.com/pmd/pmd/issues/350>: [java] Throwing
Exception in method signature is fine if the method is
overriding or implementing something
* java-typeresolution
o #350 <https://github.com/pmd/pmd/issues/350>: [java] Throwing
Exception in method signature is fine if the method is
overriding or implementing something
* java-unnecessary
o #421 <https://github.com/pmd/pmd/issues/421>: [java]
UnnecessaryFinalModifier final in private method
* jsp
o #311 <https://github.com/pmd/pmd/issues/311>: [jsp] Parse error
on HTML boolean attribute
External Contributions
* #406 <https://github.com/pmd/pmd/pull/406>: [java] False positive
with lambda in java-design/ConstructorCallsOverridableMethod
* #409 <https://github.com/pmd/pmd/pull/409>: [java] Groundwork for
the upcoming metrics framework
* #416 <https://github.com/pmd/pmd/pull/416>: [java] FIXED: Java 8
parsing problem with annotations for wildcards
* #418 <https://github.com/pmd/pmd/pull/418>: [java] Type resolution:
super and this keywords
* #423 <https://github.com/pmd/pmd/pull/423>: [java] Add field access
type resolution in non-generic cases
* #425 <https://github.com/pmd/pmd/pull/425>: [java] False positive
with builder pattern in java-design/PreserveStackTrace
* #426 <https://github.com/pmd/pmd/pull/426>: [java]
UnnecessaryFinalModifier final in private method
* #436 <https://github.com/pmd/pmd/pull/436>: [java] Metrics framework
tests and various improvements
* #440 <https://github.com/pmd/pmd/pull/440>: [core] Created ruleset
schema 3.0.0 (to use metrics)
* #443 <https://github.com/pmd/pmd/pull/443>: [java] Optimize
typeresolution, by skipping package and import declarations in
visit(ASTName)
* #444 <https://github.com/pmd/pmd/pull/444>: [java] [typeresolution]:
add support for generic fields
* #451 <https://github.com/pmd/pmd/pull/451>: [java] Metrics
framework: first metrics + first rule
--
Andreas Dangel
https://github.com/adangel
skype: andreas_dangel
|