Community
Participate
Working Groups
This is a feature request, not a bug. When doing "Open Declaration" on a method in java code, I often do not want to go to the interface or class declaring the method, but rather to some specific subclass overriding it. Would it be possible to add some kind of prompt that lists the existing overrides in known classes and give me a selection of which one I want to open (including the declaring class, of course). Alternatively a separate shortcut "open declaration with prompt" if the default behavior should be preserved. If that would be too much work to implement, it would be nice with some kind of warning saying "this method is overridden in one or more subclasses", which would at least help me a bit. As it is now, I've spent quite a bit of time trying to understand some code in the top-level class, when it has been overridden so that it is never executed which I sometimes forget to check until I enter the debugger. This has some similarities to the feature request 385310 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=385310) but that one is more advanced and requires context-awareness, which this one does not.
Did you try Ctrl+Click on a method? This allows to go to the declaration or the implementation. There's also Navigate > Open Implementation. Both will directly go to the implementation if there's only one, or show a popup with all possible implementations.
Hi Dani, thanks, the Navigate->open Implementation does what I needed. I can't believe I've never noticed that one (Ctrl-click doen't seem to do what I wanted though, but the above is sufficient). I'm closing this report (setting it to "invalid"), sorry for the noise.