Affects PMD Version: 6.x
Rule: UselessOperationOnImmutable
Description:
This is already fixed with PMD 7.0.0-rc1.
Found via #3123
Code Sample demonstrating the issue:
public class TestCase {
public void method1(String s) {
s.trim();
}
public void method2() {
String.valueOf(0);
}
public void method3() {
String.valueOf(0).trim();
}
}
Expected outcome:
PMD should report a violation at lines 3,6,9 but doesn't. This is a false-negative.
Affects PMD Version: 6.x
Rule: UselessOperationOnImmutable
Description:
This is already fixed with PMD 7.0.0-rc1.
Found via #3123
Code Sample demonstrating the issue:
Expected outcome:
PMD should report a violation at lines 3,6,9 but doesn't. This is a false-negative.