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 204346

Summary: Calls to super lost on "Move Inner to Outer Level..."
Product: java Reporter: rptmaestro <rptmaestro>
Component: SourceAssignee: Jan Lahoda <jlahoda>
Status: RESOLVED DUPLICATE    
Severity: normal CC: mmirilovic
Priority: P2 Keywords: REGRESSION
Version: 7.0.1   
Hardware: PC   
OS: Windows 7 x64   
Issue Type: DEFECT Exception Reporter:

Description rptmaestro 2011-10-28 00:52:41 UTC
When refactoring an inner class that has calls to a superclass constructor, the call is lost when the class is moved to the outer level.

My steps to reproduce:
1. From the "New Project..." wizard, create a new Maven "Java Application" project. Accept all the defaults.
2. Add the following inner class definition to App.java (notice the call to super):

	private static final class MyHashMap<K, V> extends HashMap<K, V> {

		public MyHashMap(int initialCapacity, float loadFactor) {
			super(initialCapacity, loadFactor);
		}
	}

3. Select the inner class "MyHashMap" and choose "Move Inner to Outer Level..." from the refactoring menu. Accept the defaults and click "Refactor".

4. Notice how the refactored class in MyHashMap.java is now missing the call to super.

	final class MyHashMap<K, V> extends HashMap<K, V> {

		public MyHashMap(int initialCapacity, float loadFactor) {
		}
	}
Comment 1 Jan Becicka 2011-10-31 10:25:59 UTC
It is lost somewhere in source generator
Comment 2 Jan Lahoda 2011-11-02 15:50:42 UTC
Already reported as bug #197097. Thanks for the report anyway.

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