Affects PMD Version:
4.1+
Rule:
AvoidFinalLocalVariable
Description:
This rule is suspect in general, but it really encourages bad code in unit tests. It is okay, even recommended, to use final local variables. Not everything needs to be the public class Animal we were taught in school. As a workaround, I am disabling this rule in my rulesets.xml:
<rule ref="category/java/codestyle.xml">
<exclude name="AvoidFinalLocalVariable" />
</rule>
Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other]
Gradle
Affects PMD Version:
4.1+
Rule:
AvoidFinalLocalVariable
Description:
This rule is suspect in general, but it really encourages bad code in unit tests. It is okay, even recommended, to use
finallocal variables. Not everything needs to be thepublic class Animalwe were taught in school. As a workaround, I am disabling this rule in my rulesets.xml:Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other]
Gradle