Project: JDT
Bug 39896 pull up method error when superclass already contains method called by pulled method [refactoring]
Reported: 2003-07-10 16:43:50 | Status: resolved fixed

I am working out mechanics for a refactoring to the Factory Method for my book on Refactoring to Patterns. I ran into a bug while doing this. I want to pull up a method in a subclass to a superclass. The subclass method needs acess to a field and makes calls to two methods in the subclass. I pull up the field - no problem. I then need abstract versions of the 2 called methods to be pulled up to the superclass. I have to do that manually and I do. Now I should be all set to pull up the original subclass method, since the superclass has everything it needs to be a home to the subclass method. When I try to do this, Eclipse warns me that the pulled method doesn't have acess to one of the methods it needs to call. Yet that method already exists as an abstract method in the superclass. The refactoring tool lets me procees, despite the warnings and everything works fine. The bug is that I got warnings. There should be no warnings as I'm doing something harmless and correct. I can send a code example if it helps.

Files changed in fix:
org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/HierarchyRefactoring.java