31-July-2021 - 6.37.0-SNAPSHOT
The PMD team is pleased to announce PMD 6.37.0-SNAPSHOT.
This is a minor release.
New and noteworthy
New rules
This release ships with 2 new Java rules.
SimplifiableTestAssertion
suggests rewriting some test assertions to be more readable.
<rule ref="category/java/bestpractices.xml/SimplifiableTestAssertion" />
The rule is part of the quickstart.xml ruleset.
ReturnEmptyCollectionRatherThanNull
suggests returning empty collections / arrays instead of null.
<rule ref="category/java/errorprone.xml/ReturnEmptyCollectionRatherThanNull" />
The rule is part of the quickstart.xml ruleset.
Renamed rules
- The Java rule
MissingBreakInSwitch
has been renamed toImplicitSwitchFallThrough
(category error prone) to better reflect the rule’s purpose: The rule finds implicit fall-through cases in switch statements, which are most likely unexpected. The old rule name described only one way how to avoid a fall-through, namely usingbreak
butcontinue
,throw
andreturn
avoid a fall-through as well. This enables us to improve this rule in the future.
Deprecated rules
The following Java rules are deprecated and removed from the quickstart ruleset,
as the new rule SimplifiableTestAssertion
merges
their functionality:
UseAssertEqualsInsteadOfAssertTrue
UseAssertNullInsteadOfAssertTrue
UseAssertSameInsteadOfAssertTrue
UseAssertTrueInsteadOfAssertEquals
SimplifyBooleanAssertion
The rule ReturnEmptyArrayRatherThanNull
is deprecated and removed from
the quickstart ruleset, as the new rule ReturnEmptyCollectionRatherThanNull
supersedes it.
Fixed Issues
- apex
- core
- java-bestpractices
- #2908: [java] Merge Junit assertion simplification rules
- java-errorprone
API Changes
External Contributions
- #3367: [apex] Check SOQL CRUD on for loops - Jonathan Wiesel
- #3373: [apex] Add ApexCRUDViolation support for database class, inline no-arg object construction DML and inline list initialization DML - Jonathan Wiesel
- #3385: [core] CPD: Optimize –skip-lexical-errors option - Woongsik Choi
- #3388: [doc] Add Code Inspector in the list of tools - Julien Delange