You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
adangel
changed the title
[java] UnusedLocalVariable false-positive with compound assignments
[java] UnusedLocalVariable false-negative with compound assignments
Apr 28, 2023
adangel
changed the title
[java] UnusedLocalVariable false-negative with compound assignments
[java] UnusedLocalVariable: false-negative with compound assignments
Apr 28, 2023
Affects PMD Version: 6.x
Rule: UnusedLocalVariable
Description:
If a variable is only used in a compound statement (e.g.
+=
), then this should not count as usage and a violation should be reported.Note: This has already been fixed with PMD 7.0.0-rc1. (via #3113)
Found via #3123.
Code Sample demonstrating the issue:
Expected outcome:
PMD should report a violation at line 3, but doesn't. This is a false-negative.
The text was updated successfully, but these errors were encountered: