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

Bug 149091

Summary: [reorg] Dragging a method node should invoke move refactoring
Product: [Eclipse Project] JDT Reporter: Missing name Mising name <wuntoy>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: minor    
Priority: P3 CC: martinae
Version: 3.2   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug

Description Missing name Mising name CLA 2006-06-28 18:35:53 EDT
Suppose the following code:

class X{
	public static void a() {System.out.println("a()";}
	public static void b() {a();}
}
class Y{}

Selecting the method node in, for instance, the Outline view and choosing Refactor/Move on X.b() with Y as the target type correctly yields:

class X{
	public static void a() {System.out.println("a()";}
}
class Y{
	public static void b() {X.a();}
}

However, dragging the X.b() method node onto the Y type node will simply move the text, so Y.b() attempts to call Y.a() in the expression "a()".  Since this method does not exist the code is broken.

Dragging a method node onto a type node should invoke the existing refactoring where it makes sense to do so, since the Outline, Package Explorer and other affected views convey the Java model and not the text structure.
Comment 1 Martin Aeschlimann CLA 2006-06-29 10:38:07 EDT
Tobias, what's our rational here?
Comment 2 Tobias Widmer CLA 2006-06-29 10:43:44 EDT
Since b is a static method, the move action automatically forwards to the move static members refactoring.
DND however only makes use of the Reorg Infrastructure, which correctly recognizes this as textual move.

We could extend DND to perform the forwarding like the move action. That should be easy.
Comment 3 Eclipse Genie CLA 2020-02-04 07:40:02 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.