mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
26 lines
822 B
HTML
26 lines
822 B
HTML
<html>
|
|
<body>
|
|
Reports usages of <code>StringBuffer</code>, <code>StringBuilder</code>, or <code>StringJoiner</code>
|
|
which can be replaced with a single <code>String</code> concatenation.
|
|
<p>Using <code>String</code> concatenation
|
|
makes the code shorter and simpler.</p>
|
|
<p>
|
|
This inspection only reports when the suggested replacement does not result in significant
|
|
performance drawback on modern JVMs. In many cases, <code>String</code> concatenation may perform better.
|
|
</p>
|
|
<p><b>Example:</b></p>
|
|
<pre><code>
|
|
StringBuilder result = new StringBuilder();
|
|
result.append("i = ");
|
|
result.append(i);
|
|
result.append(";");
|
|
return result.toString();
|
|
</code></pre>
|
|
<p>After the quick-fix is applied:</p>
|
|
<pre><code>
|
|
String result = "i = " + i + ";";
|
|
return result;
|
|
</code></pre>
|
|
<!-- tooltip end -->
|
|
</body>
|
|
</html> |