com.puppycrawl.tools.checkstyle.checks.coding

Class DefaultComesLastCheck

public class DefaultComesLastCheck extends Check

Check that the default is after all the cases in a switch statement.

Rationale: Java allows default anywhere within the switch statement. But if it comes after the last case then it is more readable.

An example of how to configure the check is:

 <module name="DefaultComesLast"/>
 

Author: o_sukhodolsky

Constructor Summary
DefaultComesLastCheck()
Creates new instance of the check.
Method Summary
int[]getAcceptableTokens()
{@inheritDoc}
int[]getDefaultTokens()
{@inheritDoc}
voidvisitToken(DetailAST aAST)
{@inheritDoc}

Constructor Detail

DefaultComesLastCheck

public DefaultComesLastCheck()
Creates new instance of the check.

Method Detail

getAcceptableTokens

public int[] getAcceptableTokens()
{@inheritDoc}

getDefaultTokens

public int[] getDefaultTokens()
{@inheritDoc}

visitToken

public void visitToken(DetailAST aAST)
{@inheritDoc}