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

Bug 145629

Summary: [introduce parameter] should offer enclosing method of anonymous class
Product: [Eclipse Project] JDT Reporter: Channing Walton <channingwalton>
Component: UIAssignee: Markus Keller <markus.kell.r>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: nikolaymetchev
Version: 3.2   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug

Description Channing Walton CLA 2006-06-06 16:35:05 EDT
Consider:

public void foo() {
	Thing thing = new Thing() {
		public void bar() {
			int x = 1 + x;
		}
	};
}

I would like to be able to select 'x', and 'Introduce Parameter'. Currently, the refactoting suggests modifying bar(), but I would like the choice to add the parameter to the enclosing method foo().
Comment 1 Channing Walton CLA 2006-06-07 08:37:38 EDT
oops, that example is wrong. Here it is again:

public void foo() {
        Thing thing = new Thing() {
                public void bar() {
                        int y = 1 + x;
                }
        };
}
Comment 2 Markus Keller CLA 2006-06-09 11:47:32 EDT
*** Bug 47547 has been marked as a duplicate of this bug. ***
Comment 3 Eclipse Genie CLA 2018-09-28 06:16:08 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.