Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 339993 - [move method] Move method also moves/copies the @Override
Summary: [move method] Move method also moves/copies the @Override
Status: CLOSED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-15 06:29 EDT by Didier Loiseau CLA
Modified: 2019-12-31 12:32 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Didier Loiseau CLA 2011-03-15 06:29:23 EDT
Build Identifier: 20100617-1415

When moving a method that overrides/implements another one (asking to keep the original method as a delegate to the new one), the @Override remains on the new method.

Reproducible: Always

Steps to Reproduce:
1. Create a class with the below code
2. Trigger "Move..." refactoring on someMethod
3. Choose to move the method to someField and "Keep the original method as a delegate to the moved method"
4. The resulting code does not compile because the new method has the @Override annotation.

public class MoveMethodWithOverride implements MyInterface {
	OtherClass someField;

	@Override
	public void someMethod() {
		
	}

}

interface MyInterface {
	void someMethod();
}

class OtherClass {
	
}
Comment 1 Eclipse Genie CLA 2019-12-31 12:32:31 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.

If you have further information on the current state of the bug, please add it. 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.