mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
22 lines
792 B
HTML
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> |