Back to Intellij Community

UnnecessaryTemporaryOnConversionToString

java/java-impl/resources/inspectionDescriptions/UnnecessaryTemporaryOnConversionToString.html

2025.3-rc-2239 B
Original Source

Reports unnecessary creation of temporary objects when converting from a primitive type to String.

Example:

String foo = new Integer(3).toString();

After the quick-fix is applied:

String foo = Integer.toString(3);