Charbel
Charbel

Reputation: 14687

eclipse refactoring - pull up method to interface

How can I change the default behaviour of eclipse so that it does not prepend the methods it pulls up to an interface with "public abstract"

example, I have a class A that implements interface IA. Suppose I added a method void a() to A, and I right click on that method, and select "Refactor->Pull Up", and than make sure void a () is selected and I choose the interface IA, and click ok, a method called public abstract void a(); gets created in IA, I want to get rid of the public abstract bit.

Is there a way to do that?

Thank You

Upvotes: 10

Views: 4732

Answers (1)

Didier L
Didier L

Reputation: 20579

I was just looking at the same thing to see if it had changed and I found your question. In fact this is Eclipse Bug 71627. However there is a simple work around: instead of using Refactor->Pull Up, use Quick fix (Ctrl+1)->Create 'method()' in super interface X.

It also has the advantage that it leads you directly to the new method declaration, so that you can directly write the javadoc, change parameter names etc.

Upvotes: 10

Related Questions