Files
openide/java/java-impl/resources/inspectionDescriptions/StringConcatenationInsideStringBufferAppend.html
Leonid Shalupov 40795fe787 IJI-2422: community/java: move resources under resources root
GitOrigin-RevId: 8b2b63fc6db476ca0c2cfe5cadd84db6c4236d0f
2025-02-05 04:43:28 +00:00

22 lines
792 B
HTML

<html>
<body>
Reports <code>String</code> concatenation used as the argument to <code>StringBuffer.append()</code>,
<code>StringBuilder.append()</code> or <code>Appendable.append()</code>.
<p>
Such calls may profitably be turned into chained append calls on the existing <code>StringBuffer/Builder/Appendable</code>
saving the cost of an extra <code>StringBuffer/Builder</code> allocation.
This inspection ignores compile-time evaluated <code>String</code> concatenations, in which case the conversion would only
worsen performance.
</p>
<p><b>Example:</b></p>
<pre><code>
void bar(StringBuilder builder, String name) {
builder.append("Hello," + name); //warning
builder.append("Hello," + "world"); //no warning
}
</code></pre>
<!-- tooltip end -->
<p>
</body>
</html>