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

Bug 473653

Summary: Pull Up Method Refactoring does not remove the method from its origin 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: P5 CC: noopur_gupta
Version: 4.6   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug

Description Melina Mongiovi CLA 2015-07-27 08:43:25 EDT
Applying the pull up method refactoring in the B.m method does not remove it from class B. This refactoring aims to remove a method from its origin class and creates it in a super class.

Before Refactoring:

public interface  A { }
 abstract class B implements A {
	 public abstract int m();
}


Resulting Program:

public interface  A {
	int m(); 
}
 abstract class B implements A {
	 @Override
	public abstract int m();
}
Comment 1 Noopur Gupta CLA 2015-08-05 06:58:53 EDT
This is the desired behaviour. See description of bug 30826.
Comment 2 Melina Mongiovi CLA 2015-08-17 19:57:11 EDT
(In reply to Noopur Gupta from comment #1)
> This is the desired behaviour. See description of bug 30826.

Thank you for your reply. But I saw bug 30826 and it is specific to static methods and fields. This bug is specific to abstract classes and methods. Class B is an abstract class, so the method could be pulled up to interface A without altering the program behavior or resulting in compilation error.
Comment 3 Noopur Gupta CLA 2015-08-18 08:12:31 EDT
(In reply to Melina Mongiovi from comment #2)
> (In reply to Noopur Gupta from comment #1)
> > This is the desired behaviour. See description of bug 30826.
> 
> Thank you for your reply. But I saw bug 30826 and it is specific to static
> methods and fields. This bug is specific to abstract classes and methods.
> Class B is an abstract class, so the method could be pulled up to interface
> A without altering the program behavior or resulting in compilation error.

The summary of bug 30826 mentions static methods but the discussion includes instance methods also. See its duplicate bug 89352 comment #9.

I was also referring to bug 30826 comment #3 which is a similar case as yours.

Since the method being pulled up here is an abstract method, it can be removed from the subtype.
Comment 4 Eclipse Genie CLA 2020-02-09 17:08:44 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.