Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
pmd-doc-5.8.0.zip | 2017-06-24 | 64.5 MB | |
pmd-src-5.8.0.zip | 2017-06-24 | 28.6 MB | |
pmd-bin-5.8.0.zip | 2017-06-24 | 58.9 MB | |
PMD 5.8.0 (24-June-2017).tar.gz | 2017-06-24 | 27.1 MB | |
PMD 5.8.0 (24-June-2017).zip | 2017-06-24 | 28.6 MB | |
README.md | 2017-06-24 | 7.9 kB | |
Totals: 6 Items | 207.7 MB | 0 |
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
Java Type Resolution
As part of Google Summer of Code 2017, Bendegúz Nagy 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
andsuper
, 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 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]).
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 asfinal
. 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
-
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 calledallowExceptionNameRegex
. 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 eitherignored
orexpected
. 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].
Fixed Issues
- General
- apex
- #427: [apex] CPD error when parsing apex code from release 5.5.3
- cpp
- #431: [cpp] CPD gives wrong duplication blocks for CPP code
- java
- java-design
- java-empty
- java-imports:
- #348: [java] imports/UnusedImport rule not considering static inner classes of imports
- java-junit
- java-logging:
- #365: [java] InvalidSlf4jMessageFormat does not handle inline incrementation of arguments
- java-strictexceptions
- #350: [java] Throwing Exception in method signature is fine if the method is overriding or implementing something
- java-typeresolution
- #350: [java] Throwing Exception in method signature is fine if the method is overriding or implementing something
- java-unnecessary
- #421: [java] UnnecessaryFinalModifier final in private method
- jsp
- #311: [jsp] Parse error on HTML boolean attribute
External Contributions
- #406: [java] False positive with lambda in java-design/ConstructorCallsOverridableMethod
- #409: [java] Groundwork for the upcoming metrics framework
- #416: [java] FIXED: Java 8 parsing problem with annotations for wildcards
- #418: [java] Type resolution: super and this keywords
- #423: [java] Add field access type resolution in non-generic cases
- #425: [java] False positive with builder pattern in java-design/PreserveStackTrace
- #426: [java] UnnecessaryFinalModifier final in private method
- #436: [java] Metrics framework tests and various improvements
- #440: [core] Created ruleset schema 3.0.0 (to use metrics)
- #443: [java] Optimize typeresolution, by skipping package and import declarations in visit(ASTName)
- #444: [java] [typeresolution]: add support for generic fields
- #451: [java] Metrics framework: first metrics + first rule