Bug 439969 - [move method] incorrect reference to members of anonymous class declaration
Summary: [move method] incorrect reference to members of anonymous class declaration
Status: CLOSED DUPLICATE of bug 432845
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.4   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-20 23:31 EDT by Jongwook Kim CLA
Modified: 2014-07-21 19:36 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jongwook Kim CLA 2014-07-20 23:31:11 EDT
When a method of anonymous class declaration is moved, references to the member 
of the anonymous class are incorrectly updated. See below:

-----------
BEFORE
-----------
public class A {
	public void m() {		
		new B() {
			public int i;
			public void n(C c) {       // TO BE MOVED
				i++;
			}
		};
	}
}

public class B {
}

public class C {
}

----------
AFTER
----------
public class A {
	public void m() {		
		new B() {
			public int i;
		};
	}
}

public class B {
	
}

public class C {
	public void n(B arg) {
		arg.i++;               // ERROR
	}
}
Comment 1 Martin Mathew CLA 2014-07-21 19:36:46 EDT
This case should also be handled when working on bug 432845.

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