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
When you have a method chain call and at the end the toString() call. And there is a local method with the same name as the method call, then this rule is confused. If the local method returns a String, then this rule is triggered.
The rule searches always for local method declarations, but that's wrong - at least for method chains.
Affects PMD Version: 6.43.0
Rule: StringToString
Description:
When you have a method chain call and at the end the
toString()
call. And there is a local method with the same name as the method call, then this rule is confused. If the local method returns a String, then this rule is triggered.The rule searches always for local method declarations, but that's wrong - at least for method chains.
Code Sample demonstrating the issue:
B::getC
returns a Character,StringToString_FP::getC
returns a String.At line 5,
B::getC
is called.Expected outcome:
PMD reports a violation at line 5, but that's wrong. That's a false positive.
The text was updated successfully, but these errors were encountered: