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

Bug 152838

Summary: [move method] "Move method" results in improper cast
Product: [Eclipse Project] JDT Reporter: David Saff <david>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug

Description David Saff CLA 2006-08-04 08:18:11 EDT
In 3.2.  In the following code:

public class MoveMethod {
	public static class MoveHere {
		
	}
	
	public void foo(MoveHere mh) {
		
	}
	
	public void bar() {
		Object o = new MoveHere();
		foo((MoveHere)o);
	}
}

Use "Move Method" to move foo to MoveHere.  This results in a compile error in bar.
Comment 1 Martin Aeschlimann CLA 2006-08-07 04:02:20 EDT
The result is
        public void bar() {
                Object o = new MoveHere();
                (MoveHere)o.foo();
        }
(missing brackets on cast)
Comment 2 Eclipse Genie CLA 2020-02-07 08:18:12 EST
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. As such, we're closing this bug.

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