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

Bug 100446

Summary: [move member type] bad results on move inner class to separate file [refactoring]
Product: [Eclipse Project] JDT Reporter: Maxime Daniel <maxime_daniel>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard: stalebug

Description Maxime Daniel CLA 2005-06-16 13:22:21 EDT
Build id: N20050616-0010

Follow up on https://bugs.eclipse.org/bugs/show_bug.cgi?id=99600.

Now that we have no exception left, the results of the refactoring action seem
perfectible.

-- using default package
take source:
public class Test {
	public class C1 {}
	public class C2 {
		class C3 {
			int foo(C1 c) { return 0; }
		}
		public void foo(C1 c, int i) {
			new C3().foo(c);
		}
	}
}
and refactor on C2, action Move Member Type to New File, field name left blank.
C2 starts with:
import Test.C1;
import Test.C2.C3;
both yielding errors

-- using a non default package
same scenario on:
package p;

public class Test {
	public class C1 {}
	public class C2 {
		class C3 {
			int foo(C1 c) { return 0; }
		}
		public void foo(C1 c, int i) {
			new C3().foo(c);
		}
	}
}
gives a C2.java file which starts with:
/**
 * 
 */
package p;

import p.Test.C1;
import p.Test.C2.C3;

last line is not correct.

I have not checked all combinations, but adding a field does not help (which
would have been a bit surprising anyway?)
Comment 1 Markus Keller CLA 2006-10-26 06:44:13 EDT
See also bug 45131.
Comment 2 Eclipse Genie CLA 2019-09-29 15:18:37 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.

If you have further information on the current state of the bug, please add it. 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.