Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 215161

Summary: [generate constructor] Generate constructor using fields should respect field order
Product: [Eclipse Project] JDT Reporter: Willian Mitsuda <wmitsuda>
Component: UIAssignee: Markus Keller <markus.kell.r>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: cho, daniel_megert, Konstantin.Scheglov, martinae, p35t173nc3
Version: 3.4Flags: daniel_megert: review+
Target Milestone: 3.4.1   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Fix none

Description Willian Mitsuda CLA 2008-01-13 18:49:14 EST
The "generate constructor using fields" generates a constructor where the parameters and the field assignment are sorted alphabetically.

It should respect the order the fields are declared, like the "generate getters and setters".
Comment 1 Dani Megert CLA 2008-01-14 05:56:46 EST
You can choose the order in the dialog, but I agree that the default ordering should be the one taken 
Comment 2 Willian Mitsuda CLA 2008-01-14 11:21:32 EST
It is curious that I only noted the up/down buttons now, after your comment.
Comment 3 Martin Aeschlimann CLA 2008-05-23 07:11:33 EDT
*** Bug 232733 has been marked as a duplicate of this bug. ***
Comment 4 Christian Holm CLA 2008-06-04 05:27:38 EDT
As additional info this is a regression from 3.3, so this should be fixed.

I remember that this regression has occured before in a beta release of another version (I think it was 3.0 or 3.1). Maybe a regression test should be made for this. 
Comment 5 Dani Megert CLA 2008-07-14 04:33:19 EDT
We should fix this for 3.4.1. People also complained on the newsgroup about this. In addition, the current code lists the field in an undefined order. Bug is in
GenerateNewConstructorUsingFieldsAction.run(IType, IField[], boolean).

Targeting for 3.4.1 but might be deferred to 3.5 if fix is non-trivial.
Comment 6 Markus Keller CLA 2008-07-21 12:22:20 EDT
Created attachment 107964 [details]
Fix

Released to HEAD.
Comment 7 Dani Megert CLA 2008-08-04 10:14:00 EDT
Committed to R3_4_maintenance.
Comment 8 Dani Megert CLA 2008-08-06 09:13:20 EDT
Verified in build input for M20080808-0800.