diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/FallThroughCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/FallThroughCheck.java index 49052ab2a..d15e07dfa 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/FallThroughCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/FallThroughCheck.java @@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; /** * Checks for fall through in switch statements - * Finds locations where a case contains Java code - + * Finds locations where a case contains Java code - * but lacks a break, return, throw or continue statement. * *

@@ -38,13 +38,17 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; *

*

* The following fragment of code will NOT trigger the check, - * because of the comment "fallthru". + * because of the comment "fallthru" and absence of any Java code + * in case 5. *

*
  * case 3:
  *     x = 2;
  *     // fallthru
  * case 4:
+ * case 5:
+ * case 6:
+ *     break;
  * 
*

* The recognized relief comment can be configured with the property diff --git a/src/xdocs/config_coding.xml b/src/xdocs/config_coding.xml index e5e01d957..cb2b90ed0 100644 --- a/src/xdocs/config_coding.xml +++ b/src/xdocs/config_coding.xml @@ -2197,7 +2197,7 @@ if ("something".equals(x))

Checks for fall-through in switch statements. Finds locations where a case - contains Java code but lacks a break, return, + contains Java code but lacks a break, return, throw or continue statement.

@@ -2219,13 +2219,15 @@ case 0: case 1: i++; // falls through -case 2: { +case 2: +case 3: +case 4: { i++; } // fallthrough -case 3: +case 5: i++; -/* fallthru */case 4: +/* fallthru */case 6: i++ break; }