[java] StringInstantiation: false negative when using method result #3848
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:StringInstantiation
Please provide the rule name and a link to the rule documentation:
https://pmd.github.io/latest/pmd_rules_java_performance.html#stringinstantiation
Description:
Hi, I found a false negative about the rule StringInstantiation. Please read the following code example. PMD should have reported a warning at line 5 because this line create a String object by
new
. Hence, I think this is a false negative. Thanks for your kind consideration.Code Sample demonstrating the issue:
Expected outcome:Warning
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: