Since Checkstyle 5.2
To configure the check:
<module name="Checker"> <module name="TreeWalker"> <module name="InnerTypeLast"/> </module> </module>
Example:
class Test1 { private String s; class InnerTest1 {} public void test() {} // violation } class Test2 { static {}; class InnerTest1 {} public Test2() {} // violation } class Example1 { private String s; public void test() {} class InnerTest1 {} }
All messages can be customized if the default message doesn't suit you. Please see the documentation to learn how to.
com.puppycrawl.tools.checkstyle.checks.design