Feature idea: Introduce method annotated @Override from class to implemented interface

Hi, I'd like to share an idea to improve the editor - as I've found myself a few times "wanting such feature".
Consider the following code:

public interface MyInterface {/*...*/}

public class MyClass implements MyInterface {
    /*...*/
    @Override
    public void someMethod() {/**/}
}


IDEA could provide an intention to add this method to the implemented interface, which would spare me the switching to the Interface to add it - this might be useful while coding an some DAO's or an view/presenter pair in GWT - where we exactly know that this interface is ok to be changed as we see it fit as there is only one place that it is used, and we are controlling it (it's not "public API").

Although I do perfectly understand that this may somehow be a little contradictionary with the idea of interfaces - it's supposed to be an API, and not changing, but in real life such feature may speed up development a little - and it's the programmers responsibility to use a tool responsible, not the tool to save him from such obvious errors.

Please respond with up (or down) thumbs, I'd like to know if you find such feature useful or useless. If some people like it, we may open an ticket and maybe it could get through - it doesn't seem like much effort is needed to add this (?).

PS: Such feature has been discussed some time ago as i see here: http://devnet.jetbrains.net/message/4055#4055 so maybe it's worth opening an ticket?

--
My best regards to the *great* IDEA Team,
Konrad Malawski

3 comments
Comment actions Permalink

I think the "Pull Up" refactoring does exactly what you're looking for.

0
Comment actions Permalink

How could I have missed that?! Yes, it's exactly what I need - thanks a lot for the tip :-)

0
Comment actions Permalink

yes

but it would be great if underlined_red  "@Override" suggests quick fix
this quick fix will do exactly same as pull up

oh, i found existing issue: http://youtrack.jetbrains.net/issue/IDEA-55720

0

Please sign in to leave a comment.