mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-05 23:46:49 +07:00
GitOrigin-RevId: 8b2b63fc6db476ca0c2cfe5cadd84db6c4236d0f
35 lines
773 B
HTML
35 lines
773 B
HTML
<html>
|
|
<body>
|
|
Reports enhanced <code>switch</code> statements and expressions. Suggests replacing them with regular <code>switch</code>
|
|
statements.
|
|
<p><b>Example:</b></p>
|
|
<pre><code>
|
|
boolean even = switch (condition) {
|
|
case 1, 3, 5, 7, 9 -> false;
|
|
default -> true;
|
|
};
|
|
</code></pre>
|
|
<p>After the quick-fix is applied:</p>
|
|
<pre><code>
|
|
boolean even;
|
|
switch (condition) {
|
|
case 1:
|
|
case 3:
|
|
case 5:
|
|
case 7:
|
|
case 9:
|
|
even = false;
|
|
break;
|
|
default:
|
|
even = true;
|
|
break;
|
|
}
|
|
</code></pre>
|
|
<!-- tooltip end -->
|
|
<p>
|
|
<i>Enhanced</i> <code>switch</code> appeared in Java 14.
|
|
This inspection can help to downgrade for backward compatibility with earlier Java versions.
|
|
</p>
|
|
<p><small>New in 2019.1</small></p>
|
|
</body>
|
|
</html> |