All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.java.rules.squid.S1158.html Maven / Gradle / Ivy

There is a newer version: 8.6.0.37351
Show newest version

Creating temporary primitive wrapper objects only for String conversion or the use of the compareTo method is inefficient.

Instead, the static toString() or compareTo method of the primitive wrapper class should be used.

Noncompliant Code Example

new Integer(myInteger).toString();  // Noncompliant

Compliant Solution

Integer.toString(myInteger);        // Compliant




© 2015 - 2025 Weber Informatics LLC | Privacy Policy