29-October-2022 - 6.51.0-SNAPSHOT
The PMD team is pleased to announce PMD 6.51.0-SNAPSHOT.
This is a minor release.
New and noteworthy
New Rules
- The new Apex rule
ApexUnitTestClassShouldHaveRunAs
ensures that unit tests use System.runAs() at least once. This makes the tests more robust, and independent from the user running it.
<rule ref="category/apex/bestpractices.xml/ApexUnitTestClassShouldHaveRunAs"/>
The rule is part of the quickstart.xml ruleset.
Fixed Issues
- apex
- #4149: [apex] New rule: ApexUnitTestClassShouldHaveRunAs
- doc
- java-documentation
- #4141: [java] UncommentedEmptyConstructor FP when constructor annotated with @Autowired
- java-performance
- #1167: [java] AvoidArrayLoops false positive on double assignment
- #2080: [java] StringToString rule false-positive with field access
- #2692: [java] [doc] AvoidArrayLoops flags copy assignment in same array as sub-optimal
- #3437: [java] StringToString doesn’t trigger on Bar.class.getSimpleName().toString()
- #3681: [java] StringToString doesn’t trigger on string literals
- #3847: [java] AvoidArrayLoops should consider final variables
- #3977: [java] StringToString false-positive with local method name confusion
- #4091: [java] AvoidArrayLoops false negative with do-while loops
- #4148: [java] UseArrayListInsteadOfVector ignores Vector when other classes are imported
API Changes
External Contributions
- #4142: [java] fix #4141 Update UncommentedEmptyConstructor - ignore @Autowired annotations - Lynn (@LynnBroe)
- #4147: [java] Added support for Do-While for AvoidArrayLoops - Yasar Shaikh (@yasarshaikh)
- #4150: [apex] New rule ApexUnitTestClassShouldHaveRunAs #4149 - Thomas Prouvot (@tprouvot)