rspec/rules/S1153/java/rule.adoc

39 lines
711 B
Plaintext

Appending ``++String.valueOf()++`` to a ``++String++`` decreases the code readability.
The argument passed to ``++String.valueOf()++`` should be directly appended instead.
== Noncompliant Code Example
----
public void display(int i){
System.out.println("Output is " + String.valueOf(i)); // Noncompliant
}
----
== Compliant Solution
----
public void display(int i){
System.out.println("Output is " + i); // Compliant
}
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
'''
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]