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

20 lines
603 B
HTML

<html>
<body>
Reports arrays of enum constants that can be replaced with a call to <code>EnumType.values()</code>.
<p>Usually, when updating such an enum, you have to update the array as well. However, if you use <code>EnumType.values()</code>
instead, no modifications are required.</p>
<p>Example:</p>
<pre><code>
enum States {
NOT_RUN, IN_PROGRESS, FINISHED;
}
handleStates(new States[] {NOT_RUN, IN_PROGRESS, FINISHED});
</code></pre>
<p>After the quick-fix is applied:</p>
<pre><code>
handleStates(States.values());
</code></pre>
<p><small>New in 2019.1</small></p>
</body>
</html>