KT.UNNECESSARY_TEMPORARY_INSTANTIATION
Temporary objects when converting primitive types to String
Avoid temporary objects when converting primitive types to String. This has a performance penalty when compared to using primitive types directly. To solve this issue, remove the wrapping type.
Noncompliant Code
Copy
val i = Integer(1).toString() // temporary Integer instantiation just for the conversion
Compliant Code
Copy
val i = Integer.toString(1)