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

Bug 476293

Summary: Pull Up Method Refactoring implements a new method in the program
Product: [Eclipse Project] JDT Reporter: Melina Mongiovi <melmongiovi>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 4.6   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard: stalebug

Description Melina Mongiovi CLA 2015-09-01 07:41:21 EDT
By applying a pull up method refactoring to move B.m to class A, it makes class A abstract (this bug I have already reported https://bugs.eclipse.org/bugs/show_bug.cgi?id=476256) and implements a new method in class C.
I know that without implementing method C.m, the resulting program does not compile. However, we do not know if the user wants to such implementation (probably not) and sometimes he is not aware of it, because it is not a local transformation.
I think the better decision is reporting a warning message to alloy the user choosing between make class C abstract or give up the transformation. If he wants to implement C.m, he does it manually and after that, applies the transformation.

Before Refactoring:

public class A {}
abstract class B extends A {
    public abstract int m(int a);
}
class C extends A {}

Resulting Program:

public abstract class A {
     public abstract int m(int a); 
}
abstract class B extends A {}
class C extends A {
	public int m(int a) {
		return 0;
	}
}
Comment 1 Eclipse Genie CLA 2018-12-21 15:07:56 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.