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

Bug 542990

Summary: [refactoring] Pull up refactoring doesn't allow pulling up to an abstract method declaration
Product: [Eclipse Project] JDT Reporter: Bill Wake <william.wake>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 4.10   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X   
Whiteboard: stalebug

Description Bill Wake CLA 2018-12-21 10:09:14 EST
When applying Pull Up on a method, if you select the action to pull it up as abstract, it pulls up the whole method (as if you'd used the "pull up" action) rather than just the abstract declaration. 

To reproduce:
Parent.java:
public class Parent {}

Child.java:
public class Child extends Parent {
	public void speak() {
		System.out.println("Hello");
	}
}

* Right-click on "speak", then select Refactor > Pull Up... 
* In the dialog, click on the "pull up" action and change it to "declare abstract in destination"
* Click Finish

What you get:
public class Parent {
	public void speak() {
		System.out.println("Hello");
	}
}

public class Child extends Parent {
}

What I expected (as earlier versions did):
public abstract class Parent {
	public abstract void speak();
}

public class Child extends Parent {
	public void speak() {
		System.out.println("Hello");
	}
}
Comment 1 Eclipse Genie CLA 2020-12-11 19:18:24 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.

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.
Comment 2 Bill Wake CLA 2021-01-22 19:15:35 EST
Works in Eclipse 2020-12 (4.18.0)