-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
/
FallThroughCheck.xml
42 lines (42 loc) · 1.83 KB
/
FallThroughCheck.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?xml version="1.0" encoding="UTF-8"?>
<checkstyle-metadata>
<module>
<check fully-qualified-name="com.puppycrawl.tools.checkstyle.checks.coding.FallThroughCheck"
name="FallThrough"
parent="com.puppycrawl.tools.checkstyle.TreeWalker">
<description><p>
Checks for fall-through in {@code switch} statements.
Finds locations where a {@code case} <b>contains</b> Java code but lacks a
{@code break}, {@code return}, {@code yield}, {@code throw} or {@code continue} statement.
</p>
<p>
The check honors special comments to suppress the warning.
By default, the texts
"fallthru", "fall thru", "fall-thru",
"fallthrough", "fall through", "fall-through"
"fallsthrough", "falls through", "falls-through" (case-sensitive).
The comment containing these words must be on the last non-empty line
before the {@code case} triggering the warning or on the same line before
the {@code case}(ugly, but possible).
</p>
<p>
Note: The check assumes that there is no unreachable code in the {@code case}.
</p></description>
<properties>
<property default-value="false" name="checkLastCaseGroup" type="boolean">
<description>Control whether the last case group must be checked.</description>
</property>
<property default-value="falls?[ -]?thr(u|ough)"
name="reliefPattern"
type="java.util.regex.Pattern">
<description>Define the RegExp to match the relief comment that suppresses
the warning about a fall through.</description>
</property>
</properties>
<message-keys>
<message-key key="fall.through"/>
<message-key key="fall.through.last"/>
</message-keys>
</check>
</module>
</checkstyle-metadata>