In Eclipse, the default is "Member Sort Order" (under "Settings - Java - Appearance - Member Sort Order"):
- Types
- Static fields
- Static Initializers
- Static methods
- Fields
- Initializers
- Constructors
- Methods
But Java Conventions Java Code> says the order should be:
- Class (static) variables
- Instance variables
- Constructors
- Methods
So, Oracle does not distinguish between static and non-static methods in ordering. Because of this, I get a Checkstyle error:
Defining an instance variable in the wrong order.
So I'm wondering if I need to reorder in Eclipse or disable Checkstyle validation. Relying on disabling Checkstyle validation, everyone who joins the project should not change their Eclipse settings, but it seems wrong to ignore the formal conventions.
What are people's views and are there other ways around this?
source share