Checkstyle check for whitespaces at method begin

Viewed 190

I have a problem with checktyle. How can I configure it for checking cases like in attached pic? I want to check for all whitespaces in methods beginning only, other whitespaces shoudnt be touched. example

1 Answers

You might look at checkstyle rules. Probably EmptyLineSeparator is what you are looking for:

Since Checkstyle 5.8

Checks for empty line separators after header, package, all import declarations, fields, constructors, methods, nested classes, static initializers and instance initializers.

ATTENTION: empty line separator is required between AST siblings, not after line where token is found.

Related