In Eclipse, the default "Members Sort Order" (in Preferences - Java - Appearance - Members Sort Order) is:
But Oracle's Java Code Conventions say the order should be:
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?
"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."
I would suggest changing Eclipse to conform to the rules that YOU want to use. Preferably using Oracles if that what you want. I usually generate my Eclipse project files using Maven (so all code formatting is created automatically for new users). I know CXF uses something similar, take a look at their POMs for inspiration.
Following on from the accepted answer by Peter Svensson, these Checkstyle errors can be resolved by using the following Member Sort Order in Eclipse:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With