[java] InvalidLogMessageFormat may examine the value of a different but identically named String variable #3284
Labels
a:false-positive
PMD flags a piece of code that is not problematic
Milestone
Affects PMD Version: 6.33.0 (via Eclipse PMD For Eclipse 4.22.0)
Rule: InvalidLogMessageFormat
Description:
InvalidLogMessageFormat does not respect the scope in which a String format variable is declared and may use the value of an identically named variable that has been declared in a different scope.
Code Sample demonstrating the issue:
Expected outcome:
PMD reports a violation at line 8, but that's wrong. That's a false positive.
Specifically, the error is reported as:
InvalidLogMessageFormat: Missing arguments, expected 3 arguments but have 1
Running PMD through: Eclipse
The text was updated successfully, but these errors were encountered: