mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-07 15:35:40 +07:00
GitOrigin-RevId: 8b2b63fc6db476ca0c2cfe5cadd84db6c4236d0f
24 lines
885 B
HTML
24 lines
885 B
HTML
<html>
|
|
<body>
|
|
Reports redundant calls to unmodifiable collection wrappers from the
|
|
<code>Collections</code> class.
|
|
<p>If the argument that is passed to an unmodifiable
|
|
collection wrapper is already immutable, such a wrapping becomes redundant.</p>
|
|
<p>Example:</p>
|
|
<pre><code>
|
|
List<String> x = Collections.unmodifiableList(Collections.singletonList("abc"));
|
|
</code></pre>
|
|
<p>After the quick-fix is applied:</p>
|
|
<pre><code>
|
|
List<String> x = Collections.singletonList("abc");
|
|
</code></pre>
|
|
<p>In order to detect the methods that return unmodifiable collections, the
|
|
inspection uses the <code>org.jetbrains.annotations.Unmodifiable</code>
|
|
and <code>org.jetbrains.annotations.UnmodifiableView</code> annotations.
|
|
Use them to extend the inspection to your own unmodifiable collection
|
|
wrappers.</p>
|
|
<!-- tooltip end -->
|
|
<p><small>New in 2020.3</small></p>
|
|
</body>
|
|
</html>
|