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

Bug 103287

Summary: Pull up and Push down refactoring loses the javadoc
Product: [Eclipse Project] JDT Reporter: Dan Campers <campers>
Component: UIAssignee: Tobias Widmer <tobias_widmer>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=326832
Whiteboard:

Description Dan Campers CLA 2005-07-11 01:07:17 EDT
When doing a pull down or push up refactoring, the refactored method is missing 
its javadoc. 

I have checked 'Move' and 'Move Member Type to New File' and they move the 
javadoc across ok.
Comment 1 Frederic Fusier CLA 2005-07-11 06:39:49 EDT
Sounds to be a JDT/UI issue as Move actions works properly...
Comment 2 Dirk Baeumer CLA 2005-07-11 09:44:38 EDT
Dan, I tested it with the following case:

public class X {
}

class Sub extends X {

	/**
	 * Comment for foo
	 * @param l
	 */
	void foo(List l) {
	}
}


and the javadoc is correctly moved as well.

Can you provide additional steps to reproduce the problem ?
Comment 3 Tobias Widmer CLA 2005-07-11 09:51:12 EDT
Please ensure that Javadoc processing is enabled on the Javadoc preference page
Comment 4 Dan Campers CLA 2005-07-12 03:26:29 EDT
Enabling javadoc processing in the preferences fixes the problem for Pull Up 
and Push Down.

What got me is that when javadoc processing is *not* selected, the Move and 
Move Member Type To New File refactorings do copy the javadoc across, but the 
Push/Pull don't.

Perhaps Push/Pull should also always copy the javadoc across, rather that 
delete it, even when javadoc processing is not selected? If you dont want the 
javadoc validations, you probably still don't want your javadocs to disappear 
when you refactor!

Dan
Comment 5 Tobias Widmer CLA 2006-01-11 12:37:05 EST
The problem is that Move and Move Member Type do not copy AST nodes, but rather entire source ranges. This is not possible for pull up and push down, since the source itself must be modified.
Since disabling javadoc validation is not necessary in practice to get warning-free code, closing as works for me.