Minor update in FallThroughCheck xdoc and javadoc

This commit is contained in:
Vladislav Lisetskiy 2015-06-19 00:42:31 +03:00 committed by Roman Ivanov
parent 11ff590ba5
commit 697c5ff378
2 changed files with 12 additions and 6 deletions

View File

@ -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 <b>contains</b> Java code -
* but lacks a break, return, throw or continue statement.
*
* <p>
@ -38,13 +38,17 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes;
* </p>
* <p>
* 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.
* </p>
* <pre>
* case 3:
* x = 2;
* // fallthru
* case 4:
* case 5:
* case 6:
* break;
* </pre>
* <p>
* The recognized relief comment can be configured with the property

View File

@ -2197,7 +2197,7 @@ if (&quot;something&quot;.equals(x))
<p>
Checks for fall-through in <code>switch</code>
statements. Finds locations where a <code>case</code>
contains Java code but lacks a <code>break</code>, <code>return</code>,
<b>contains</b> Java code but lacks a <code>break</code>, <code>return</code>,
<code>throw</code> or <code>continue</code>
statement.
</p>
@ -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;
}