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 - Calls to super lost on "Move Inner to Outer Level..."
Summary: Calls to super lost on "Move Inner to Outer Level..."
Status: RESOLVED DUPLICATE of bug 197097
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 7.0.1
Hardware: PC Windows 7 x64
: P2 normal (vote)
Assignee: Jan Lahoda
URL:
Keywords: REGRESSION
Depends on:
Blocks:
 
Reported: 2011-10-28 00:52 UTC by rptmaestro
Modified: 2011-11-02 15:50 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***