com.puppycrawl.tools.checkstyle.meta.checks.coding.FallThroughCheck.xml Maven / Gradle / Ivy
<?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 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 all on one line, and 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>