This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 248185 - Allow customization of order of pararmeters to constructor
Summary: Allow customization of order of pararmeters to constructor
Status: NEW
Alias: None
Product: editor
Classification: Unclassified
Component: Completion & Templates (show other bugs)
Version: 8.1
Hardware: PC Windows 8 x64
: P3 normal (vote)
Assignee: Dusan Balek
Depends on:
Reported: 2014-10-25 13:00 UTC by akobberup
Modified: 2014-10-25 13:00 UTC (History)
0 users

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description akobberup 2014-10-25 13:00:10 UTC
Currently if you use the "Create constructor" hint, and chooses to invoke a super constructor and also set some fields in the class you are in, the order of the arguments will be the ones for the extending class first, then the ones for the super class last.

Example scenario:

class SClass {
  int id;
  public SClass(int id){ = id;}

class EClass extends SClass {
  String name;

If i select to use the super constructor, and set the displayname in the generated constructor, it will look like this:

  public EClass(String name, int id){
    super(id); = name;

This generally conflicts with my internal direction of importantness - as the id defined on the superclass imo is "more important" than the name. Also if i have multiple implementations, it is nice that the first element in the constructor is always the id.
I would like it to be like this:

  public EClass(int id, String name){
    super(id); = name;

I know it seems like a small thing, but i have just so many times that i generate the constructor, and then have to rearrange the parameters manually - which kind of deflates the coolness of the "generate constructor" for me.