Class DefaultComesLastCheck

  • All Implemented Interfaces:
    Configurable, Contextualizable

    public class DefaultComesLastCheck
    extends AbstractCheck

    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