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

Bug 182155

Summary: [convert local] Class not compilable after refactoring
Product: [Eclipse Project] JDT Reporter: Alexandre FAU <fau.alexandre>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 3.3   
Target Milestone: ---   
Hardware: PC   
OS: Windows NT   
Whiteboard: stalebug

Description Alexandre FAU CLA 2007-04-12 11:47:14 EDT
Build ID: M20060629-1905

Steps To Reproduce:
public class ManyInner {

	static public class IC1 {
		IC1.Item _first;
		IC1.Item _last;

		static class Item {
			int _var;

			IC1.Item _next;

			Item(int var, IC1.Item next) {
				_var = var;
				_next = next;
			}
		}

		public class IC2 {
			IC1.Item _savedFirst;

			IC1.Item _savedLast;

			IC2(IC1.Item first, IC1.Item last) {
				_savedFirst = first;
				_savedLast = last;
			}

			public void restore(final ManyInner solver) {
				_first = _savedFirst;
				_last = _savedLast;
			}
		}

		public void add() {
			new IC2(_first, _last);
		}
	}
}

Try to refactor IC2 using "Convert Member toTopLevel" the resulting class is not compilable.
The constructor reference to IC2 is not updated.

Note that if in IC1 you remove all "IC1.Item" and you replace it by "Item" the refactoring works.
As fas I a know the problem is in "ConstructorReferenceFinder".

More information:
Comment 1 Alexandre FAU CLA 2007-04-12 11:53:37 EDT
In fact the refactoring works if you replace IC2.Item by Item in the constructor.
Comment 2 Eclipse Genie CLA 2019-09-30 12:00:00 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.