[java] UseEqualsToCompareStrings should consider return type #3843
Labels
a:false-negative
PMD doesn't flag a problematic piece of code
in:type-resolution
Affects the type resolution code
Milestone
Affects PMD Version:6.42.0
Rule:UseEqualsToCompareStrings
Please provide the rule name and a link to the rule documentation:
https://pmd.github.io/latest/pmd_rules_java_errorprone.html#useequalstocomparestrings
Description:
Hi, I found a false negative about the rule UseEqualsToCompareStrings. Please review the following code example. PMD should have reported a warning at line 5 because the string x is compared with another string, but it doesn't. Hence, I think it is a false negative.
Code Sample demonstrating the issue:
Expected outcome:
PMD should report a violation at line 5, but doesn't. This is a false-negative.
Running PMD through: [Maven]
The text was updated successfully, but these errors were encountered: