Files
openide/java/java-impl/resources/inspectionDescriptions/CollectionsMustHaveInitialCapacity.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
800 B
HTML

<html>
<body>
Reports attempts to instantiate a new <code>Collection</code> object without specifying
an initial capacity.
<p>
If no initial capacity is specified, a default capacity is used, which will rarely be optimal. Failing
to specify initial capacities for collections may result in performance issues if space needs to be reallocated and
memory copied when the initial capacity is exceeded.
This inspection checks allocations of classes listed in the inspection's settings.
</p>
<p><b>Example:</b></p>
<pre><code>
new HashMap&lt;String, String&gt;();
</code></pre>
<!-- tooltip end -->
<p>Use the following options to configure the inspection:</p>
<ul>
<li>List collection classes that should be checked.</li>
<li>Whether to ignore field initializers.</li>
</ul>
</body>
</html>