
resources.report.rules.pmd.UselessStringValueOf.html Maven / Gradle / Ivy
UselessStringValueOf
UselessStringValueOf
No need to call String.valueOf to append to a string; just use the valueOf() argument directly.
This rule is defined by the following Java class:
net.sourceforge.pmd.rules.strings.UselessStringValueOf
Example:
public String convert(int i) {
String s;
s = "a" + String.valueOf(i); // Bad
s = "a" + i; // Better
return s;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy