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
Description:
Hi, I found a false negative about the rule StringBufferInstantiationWithChar, please read the following minimized code example. In line 3, builder is initialized by a character, but ch could converted into an integer. Hence, I think this is a false negative, and maybe we should analyze variable type about this rule.
Code Sample demonstrating the issue:
publicvoidfoo() {
charch = 'c';
StringBuilderbuilder = newStringBuilder(ch); // should report a warning in this line
}
Expected outcome:A warning
PMD should report a violation at line 3, but doesn't. This is a false-negative.
Running PMD through:[Maven]
The text was updated successfully, but these errors were encountered:
jsotuyod
changed the title
A false negative about the rule StringBufferInstantiationWithChar
[java] A false negative about the rule StringBufferInstantiationWithChar
Mar 23, 2024
Affects PMD Version:
6.47.0+
7.0.0
Rule:StringBufferInstantiationWithChar
Please provide the rule name and a link to the rule documentation:
https://pmd.github.io/latest/pmd_rules_java_errorprone.html#stringbufferinstantiationwithchar
Description:
Hi, I found a false negative about the rule StringBufferInstantiationWithChar, please read the following minimized code example. In line 3,
builder
is initialized by a character, butch
could converted into an integer. Hence, I think this is a false negative, and maybe we should analyze variable type about this rule.Code Sample demonstrating the issue:
Expected outcome:A warning
PMD should report a violation at line 3, but doesn't. This is a false-negative.
Running PMD through: [Maven]
The text was updated successfully, but these errors were encountered: