All Downloads are FREE. Search and download functionalities are using the official Maven repository.

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>&lt;p&gt;
 Checks for fall-through in {@code switch} statements.
 Finds locations where a {@code case} &lt;b&gt;contains&lt;/b&gt; Java code but lacks a
 {@code break}, {@code return}, {@code throw} or {@code continue} statement.
 &lt;/p&gt;
 &lt;p&gt;
 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).
 &lt;/p&gt;
 &lt;p&gt;
 Note: The check assumes that there is no unreachable code in the {@code case}.
 &lt;/p&gt;</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>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy