Skip to content

[java] Deprecate AvoidFinalLocalVariable #1612

@mcandre

Description

@mcandre

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions