Bug 279541 - [pull up] Broken Pull Up Method Behavior
Summary: [pull up] Broken Pull Up Method Behavior
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2009-06-08 20:02 EDT by Joshua Kerievsky CLA
Modified: 2009-06-10 03:54 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joshua Kerievsky CLA 2009-06-08 20:02:11 EDT
Build ID: I20090528-2000

Steps To Reproduce:
1. Class A, subclass B.  Try to pull up an "abstract" declaration of a method from B to A.  
2. Result is that it pulls up entire method from B to A, when it should leave B method intact, and just show an abstract version of method in A.  This was working fine until Eclipse 3.4.2 busted it.  


More information:
To me, this is a LARGE bug.  It needs to be fixed before the final release of Galileo!!
Comment 1 Olivier Thomann CLA 2009-06-08 21:07:59 EDT
Move to JDT/UI
Comment 2 Dani Megert CLA 2009-06-09 03:40:09 EDT
From your comment 0 it is not clear whether A and/or B are abstract. Also, is your method in B abstract? Please provide a concrete example.
Comment 3 Joshua Kerievsky CLA 2009-06-09 07:46:43 EDT
public class ClassA {

}

public class ClassB extends ClassA {
	
	public void MyMethod() {
		// this is a method to pull up
	}
	
	protected void PullUpMethodAsAbstractInClassA() {
		// when pulled up, this should become abstract in ClassA and remain here in ClassB.
	}

}

When performing a Pull Up of a method from ClassB to ClassA, one can set the Action to say "declare abstract in destination."  That means that the method will REMAIN on the subclass, ClassB, and you'll see an abstract declaration of the method on ClassA.   If you try that on the above code in Eclipse 3.4.2. or higher, it is broken!   It pulls up the entire method to ClassA and doesn't declare anything as abstract.  In other words, the "declare as abstract in destination" feature in the Pull Up refactoring is totally and utterly broken in 3.4.2 and the very very latest Galileo.  This MUST be fixed. 
Comment 4 Markus Keller CLA 2009-06-09 08:16:29 EDT
(In reply to comment #3)
That works for me exactly as you expected (in 3.4.2 and with http://download.eclipse.org/eclipse/downloads/drops/I20090605-1444/download.php?dropFile=eclipse-SDK-I20090605-1444-win32.zip ).

Does it work for you in a new workspace or with a new install? 
Comment 5 Joshua Kerievsky CLA 2009-06-09 09:49:40 EDT
Odd. I just got Galileo RC3 and it worked (on WinXP).   But yesterday I got RC2 on  OSX and it did not work!   I'm confused.  I've also seen this fail on Eclipse 3.4.2.  I will have to do some more experiments.  Thanks for your help so far.  
Comment 6 Dani Megert CLA 2009-06-10 03:54:48 EDT
Works for me using 3.4.2 and 3.5 RC4. Please reopen if you can provide steps.