| Summary: | Pull Up Method Refactoring does not remove the method from its origin class | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Melina Mongiovi <melmongiovi> |
| Component: | UI | Assignee: | 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 | ||
This is the desired behaviour. See description of bug 30826. (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. (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. 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. |
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(); }