[java] FinalFieldCouldBeStatic FN when the right side of the assignment is a constant expression #2440
Labels
a:false-negative
PMD doesn't flag a problematic piece of code
Milestone
Affects PMD Version:
6.22.0+
7.0.0
Rule: FinalFieldCouldBeStatic
Description:
FinalFieldCouldBeStatic can not detect that the right side of the assignment is not a literal, but an expression (such as: Math.PI * 0.5).
This rule is implemented through xpath search:
Code Sample demonstrating the issue:
Expected outcome:
false-negative
Running PMD through:
CLI
The text was updated successfully, but these errors were encountered: