Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 232733 - [generate constructor] Source -> generate Constructors / getters / setters sorts fields alphabetically
Summary: [generate constructor] Source -> generate Constructors / getters / setters so...
Status: RESOLVED DUPLICATE of bug 215161
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-19 05:01 EDT by p35t173nc3 CLA
Modified: 2008-05-23 07:11 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description p35t173nc3 CLA 2008-05-19 05:01:19 EDT
Build ID: I20080502-0100

Steps To Reproduce:
right click, source -> generate constructor using fields

More information:
This is probably not so much a bug but a new annoying feature. Previously generating constructors or get(/set)ers generated everything in the order of field declaration. Now it sorts it, which can be quite annoying if you know the logical flow of the fields. Esp. when you have a lot of fields. Can there be an option on the field selection window to generate in declaration order vs alphabetical? maybe even add some other sort options I dunno!

Thanks
Comment 1 Martin Aeschlimann CLA 2008-05-21 09:29:29 EDT
Source -> generate constructor using fields:
You can define the order of the constructor arguments with 'Up' 'Down' in the dialog

Getter/Setter always sorts in the order of the field. I just tried that.

Reopen if that isn't good enough.
Comment 2 p35t173nc3 CLA 2008-05-21 10:43:04 EDT
First I must appologise for not first checking the get(set)ers. 

With regards to contructers however; When you have 20 or more fields it becomes extremely tedious to use the (up, down) to order them. A simple checkbox on the 'Generate Consturctor using Fields' panel or an additional 'unsorted' version on the Source sub-menu would really make life a lot easier (when instantiating the class anyway.) 

I hope you will reconsider, but I won't hold it against you if you don't :)

Regards
Daniel Young
Comment 3 Martin Aeschlimann CLA 2008-05-23 07:11:33 EDT

*** This bug has been marked as a duplicate of bug 215161 ***