When using Eclipse’s “Extract Interface” refactoring, it will declare the methods public abstract by default. Why? public modifier on an interface is completely redundant and abstract also seems meaningless on an interface declaration.
When using Eclipse’s Extract Interface refactoring, it will declare the methods public abstract by
Share
These keywords are indeed redundant. I personally wouldn’t use them in this context, but I can see why someone might prefer to include them.
The JLS explicitly discourages this practice:
In my version of Eclipse (Juno SR1), there are two options in the Extract Interface dialog:
public;abstract.If you untick them, Eclipse should no longer include the two keywords when you extract an interface.
There is a pending Eclipse bug report to clean up the redundant modifies.