Minor update in FallThroughCheck xdoc and javadoc
This commit is contained in:
parent
11ff590ba5
commit
697c5ff378
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -2197,7 +2197,7 @@ if ("something".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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue