Find all anonymous classes throughout my project in IntelliJ

Viewed 320

Is there a way for IntelliJ to locate all the places in my code that define an anonymous class?

I am asking just about finding, not changing. I am not asking about converting to lambdas, lambdas are irrelevant here.

1 Answers

Yep. You can use the Structural Search feature.

Edit -> Find -> Search Structurally…

There is already a default template for "Anonymous Classes".

  • Click Existing Templates
  • Under Java -> Class-based choose anonymous classes
  • Click OK
  • Tweak the search options (if you need) and click Find

enter image description here

enter image description here

Related