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

Bug 153022

Summary: [generate constructor] Generated default constructor from superclass is different when using Class wizard and Source menu
Product: [Eclipse Project] JDT Reporter: Philippe Ombredanne <pombredanne>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: kenny
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug

Description Philippe Ombredanne CLA 2006-08-07 20:04:41 EDT
Say I want to create a class using the class wizard.
If I check the box "Constructor from super class in the new class wizard the generated code for the default constructor will be:
	public Test() {
		// TODO Auto-generated constructor stub
	}
Now if instead I use the Source menu (or context menu) option: generate constructors from super class the generated code for the default constructor will be:
	public Test() {
		super();
		// TODO Auto-generated constructor stub
	}

In the later case, it does invoke explicitely the super() constructor which IMHO is correct.
In the former case it does not.
Comment 1 Martin Aeschlimann CLA 2006-08-09 09:51:37 EDT
The 'Generate constructors from Superclass' wizard has a checkbox for that: 'Omit call to default constructor'.
For the new type wizard we didn't want to add this option (to not flood the UI with checkboxes) and defined the default behaviour to not call 'super()'.

I wouldn't mind to remove the checkbox in the 'Generate constructors from Superclass' wizard and to always use the defualt behaviour (no call to super()). Or we change the default to checked. After the first usage of the wizard the setting is remembered.
Comment 2 Eclipse Genie CLA 2020-04-15 11:39:16 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.