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

18 lines
602 B
HTML

<html>
<body>
Reports attempts to instantiate a new <code>StringBuffer</code> or
<code>StringBuilder</code> object without specifying its initial capacity.
<p>
If no initial capacity is specified, a default capacity is used, which will rarely be optimal.
Failing to specify the initial capacity for <code>StringBuffer</code> may result
in performance issues if space needs to be reallocated and memory copied
when the initial capacity is exceeded.
</p>
<p>Example:</p>
<pre><code>
// Capacity is not specified
var sb = new StringBuilder();
</code></pre>
<!-- tooltip end -->
</body>
</html>