In Eclipse, the default "Members Sort Order" (in Preferences - Java - Appearance - Members Sort Order) is:
- Types
- Static Fields
- Static Initializers
- Static Methods
- Fields
- Initializers
- Constructors
- Methods
But Oracle's Java Code Conventions say the order should be:
- Class (static) variables
- Instance variables
- Constructors
- Methods
So Oracle don't distinguish between static and non-static methods in the ordering. I'm getting a Checkstyle error because of this:
Instance variable definition in wrong order.
So I'm wondering whether to modify the order in Eclipse or disable the Checkstyle check. Leaning towards disabling the Checkstyle check so everyone who joins the project doesn't have to modify their Eclipse settings but it seems a bit wrong to be ignoring the official conventions.
What are people's views and is there any other way round this?