I have an interface which is now empty, and extends another interface. I'd like to remove the empty interface and use the base interface, and am trying to find the correct refactoring in IntelliJ.
I've tried "remove middleman" but got "cannot perform the refactoring. The caret should be positioned at the name of the field to be refactored".
If you need to undo your refactoring, press Ctrl+Z .
Extracting an interface allows isolating only common interfaces, not common code. In other words, if classes contain Duplicate Code, extracting the interface won't help you to deduplicate.
I think what you want to do is the "inline" refactor on the unwanted interface, e.g.
If
class Thing implements ThingA
and
interface ThingA extends ThingB
To get rid of ThingA
you do and inline (ctrl + alt + n) when the caret is on ThingA
, you end up with:
class Thing implements ThingB
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With