[java] AvoidLiteralsInIfCondition false positive and negative for String literals when ignoreExpressions=true #4514
Labels
a:false-negative
PMD doesn't flag a problematic piece of code
a:false-positive
PMD flags a piece of code that is not problematic
Milestone
Affects PMD Version: 6.x
Rule: AvoidLiteralsInIfCondition
Description:
String literals are reported for deeper expressions when the property
ignoreExpressions
is true (that's the default value).Note: This is fixed already with PMD 7.0.0-rc1.
Found via #3123 .
Code Sample demonstrating the issue:
Expected outcome:
PMD reports a violation at lines 8+9, but that's wrong. That's a false positive.
PMD doesn't report a violation at line 4, but that's wrong. That's a false negative.
The text was updated successfully, but these errors were encountered: