Improve inspection description example

GitOrigin-RevId: f03b4d9082aecc9fe87f1a1e3a9ec8389d57808b
This commit is contained in:
Bas Leijdekkers
2022-07-20 18:53:15 +00:00
committed by intellij-monorepo-bot
parent a719a82ae4
commit 0260b4b4d5
@@ -1,12 +1,16 @@
<html>
<body>
Reports redundant calls to unmodifiable collection wrappers within the
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>
Collections.unmodifiableList(Collections.singletonList("abc"));
List&lt;String&gt; x = Collections.unmodifiableList(Collections.singletonList("abc"));
</code></pre>
<p>After the quick-fix is applied:</p>
<pre><code>
List&lt;String&gt; 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>