Since Checkstyle 3.0
public
protected
private
abstract
default
static
sealed
non-sealed
final
transient
volatile
synchronized
native
strictfp
In additional, modifiers are checked to ensure all annotations are declared before all other modifiers.
Rationale: Code is easier to read if everybody follows a standard.
ATTENTION: We skip type annotations from validation.
To configure the check:
<module name="Checker"> <module name="TreeWalker"> <module name="ModifierOrder"/> </module> </module>
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.modifier