I am trying to customize coding conventions for eclipse. I want to set conventions in such a way that the public members should come first,followed by protected,default and finally private. How do i do it using eclipse. I tried setting it using preferences->formatter->code-style. But I could not find anything like setting the sequence of appearance of public protected and private members. Compile time errors should be displayed in case of violation. Is there a way to do it in in eclipse or with the help of any plugin?
Asked
Active
Viewed 82 times
3
-
http://stackoverflow.com/questions/854232/sorting-methods-in-eclipse – Kenneth Clark Sep 22 '14 at 05:31
-
2Think twice before being too strict on coding conventions. There are always situations where it makes perfect sense not to follow them. While it may be useful for inexperienced programmers, the more senior programmers may easily feel too be domineered. – Henry Sep 22 '14 at 06:02
1 Answers
2
Compile time errors should be displayed in case of violation.
You cannot display compilation errors.
The only errors that you can set in Eclipse preferences are listed in the Documentation
To customize the coding conventions for Eclipse:
Open "Source" -> "Sort Members"
Select "Member sort order" from the dialog box.
Set the sort order you want based on the visibility of members (public, private, protected, default)
Reference post:

Community
- 1
- 1

Infinite Recursion
- 6,511
- 28
- 39
- 51