Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Formatter - Feature Request
Formatter - Feature Request [message #1069193] Mon, 15 July 2013 11:38 Go to next message
Tony Herstell is currently offline Tony HerstellFriend
Messages: 2
Registered: July 2013
Junior Member
Hi Guys,

From my old Ada days we always force the code through the formatter before checking it in.

I still enforce this "good habit" myself... well the formatter needs a fixup... for Java anyhow.

If you use it you will see what I mean!!!!


This is what I suggest it does to REALLY rock:

All below in alphabetic order unless specified

AND... if possible... all below in folding areas unless specified

Static logging stuff at the top. e.g.

private final Logger logger = Logger.getLogger(GroupingManagementActionController.class.getName()); 

Scan for the word log?

Next "contextual" stuff like:
@Inject 
private Conversation conversation; 

@PersistenceContext(type = PersistenceContextType.EXTENDED) 
private EntityManager em; 


Next "contextual" Event stuff like:

// Events 
@Inject 
@GroupingCreateEvent 
private Event<Grouping> createEvent; 


The other @injects...

@Inject 
GroupingManagementActionController groupingManagementActionController; 


Next "leading" (Cruffy) stuff like ID and Version for Entities

@XmlAttribute 
@XmlID 
@XmlJavaTypeAdapter(IdAdapter.class) 
@Id 
@GeneratedValue 
private Long id; 

@NotNull 
@Version 
@Column(name = "version4OptLock") 
private long optlock; 


Next the "simple" private members

@XmlElement(name = "nots") 
@Column(name = "notes", length = 1000) 
@Length(max = 1000) 
private String notes; 

Next the Lists/Sets ...


1..*

@XmlElement(name = "tasks") 
@OneToMany(fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }, mappedBy = "grouping") 
private Set<GroupingTask> tasks; 


*..*

@NotNull 
@ManyToMany(fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH }) 
private Set<OrganisationRole> organisationRoles; 


*..1 (generally backlinks)

@XmlElement(name = "parent_organisation") 
@XmlIDREF 
@NotNull 
@ManyToOne(fetch = FetchType.EAGER) 
// -> DO NOT ADD IN AS BREAKS CREATE!// , cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH } 
private Organisation parentOrganisation; 


Next Constructors

Next @Overridden methods from parent classes

Next methods with names like init, create etc. (that logically would come first)

Next the putters/getters that match the members by public/private

Next other putters/getter for non members by public/private

Next the public methods (followed by any truly private methods they (or their neighbours) completely "own")

Next the private methods (followed by any truly other private methods they (or their neighbours) completely "own")

Finally methods life @Destroy, cancel, done or similar.

I am sure you can think of more!

Cheers.
Re: Formatter - Feature Request [message #1069336 is a reply to message #1069193] Mon, 15 July 2013 17:32 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 2341
Registered: July 2009
Senior Member
Feature requests belong in Bugzilla with a Severity of Enhancement. This all reads like enhanced member sorting rather than formatting, though.

https://bugs.eclipse.org/bugs/enter_bug.cgi


---
Nitin Dahyabhai
Eclipse WTP, IBM
Re: Formatter - Feature Request [message #1069415 is a reply to message #1069336] Mon, 15 July 2013 21:01 Go to previous message
Tony Herstell is currently offline Tony HerstellFriend
Messages: 2
Registered: July 2013
Junior Member
https://bugs.eclipse.org/bugs/show_bug.cgi?id=413009
Previous Topic:Changing Access Modifier with shortcut?
Next Topic:EPIC Perl Debugging: An internal error occurred during: "child count update"
Goto Forum:
  


Current Time: Thu Dec 18 22:32:46 GMT 2014

Powered by FUDForum. Page generated in 0.13586 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software