Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ IDEA find method overrides

Assuming I have method init() in some MyBaseClass.

Is there a way to quickly find overrides of this method in subclasses?

Sure, I can find throughout a project @Override void init, but maybe there is a smarter way?

like image 809
Goltsev Eugene Avatar asked Jun 29 '17 09:06

Goltsev Eugene


People also ask

How can I see override methods in IntelliJ?

On the Code menu, click Override methods Ctrl+O . Alternatively, you can right-click anywhere in the class file, then click Generate Alt+Insert , and select Override methods. Select the methods to override (hold the Shift or Ctrl key to perform a multiple select).

How do you tell if a method is overridden?

getMethod("myMethod"). getDeclaringClass(); If the class that's returned is your own, then it's not overridden; if it's something else, that subclass has overridden it.

How do I search specific methods in IntelliJ?

From the main menu, select Edit | Find | Find in Files Ctrl+Shift+F . In the search field, type your search string. Alternatively, in the editor, highlight the string you want to find and press Ctrl+Shift+F . IntelliJ IDEA places the highlighted string into the search field.

How do you select a method to override?

quick command search : ctrl + shift + A Type constructor to override all of them quickly :D.


1 Answers

Please use Navigate | Implementations.

like image 172
CrazyCoder Avatar answered Oct 16 '22 06:10

CrazyCoder