Files
openide/java/java-impl/resources/inspectionDescriptions/EnumSwitchStatementWhichMissesCases.html
2025-02-05 04:43:28 +00:00

37 lines
752 B
HTML

<html>
<body>
Reports <code>switch</code> statements over enumerated types that are not exhaustive.
<p><b>Example:</b></p>
<pre><code>
<b>enum</b> AlphaBetaGamma {
A, B, C;
<b>void</b> x(AlphaBetaGamma e) {
<b>switch</b> (e) {
}
}
}
</code></pre>
<p>After the quick-fix is applied:</p>
<pre><code>
<b>enum</b> AlphaBetaGamma {
A, B, C;
<b>void</b> x(AlphaBetaGamma e) {
<b>switch</b> (e) {
<b>case</b> A -> {}
<b>case</b> B -> {}
<b>case</b> C -> {}
}
}
}
</code></pre>
<!-- tooltip end -->
<p>
Use the <b>Ignore switch statements with a default branch </b> option to ignore <code>switch</code>
statements that have a <code>default</code> branch.
<p>
</body>
</html>