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

Bug 473651

Summary: [pull up] "Create necessary methods stubs..." not enabled while pulling up method to abstract class
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 CC: noopur_gupta
Version: 3.8.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug

Description Melina Mongiovi CLA 2015-07-27 08:32:08 EDT
Applying the pull up method refactoring in the B.m method implements the C.m method. 
I agree that without doing that, the resulting program may not compile. But I suggest the user can choose if he wants to apply the transformation by creating the new method returning a default value or to not apply the transformation. Then, I suggest to include a dialog box to let the user make that decision.

Before Refactoring:

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

Resulting Program:

public abstract class A {
	public abstract int m(); 
}
abstract class B extends A {}
class C extends A {
	public int m() {
		return 0;
	}
}
Comment 1 Noopur Gupta CLA 2015-08-05 07:34:19 EDT
We already have the check box for this in Pull Up refactoring wizard: "Create necessary methods stubs in non-abstract subtypes of the destination type".

It should be enabled for the given example.
Comment 2 Eclipse Genie CLA 2020-04-26 14:26:09 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. 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.