Quantcast
Viewing all articles
Browse latest Browse all 44

IntelliJ IDEA find usages of overriding method without finding sibling methods

I have a parent class P with subclasses A and B.

I would like to find all usages of a method f of A.

So either p.f() or a.f() but not b.f(), because an instance B b cannot call A.f.

I know I can find

  • Calls directly to A.f. This misses:

    P p = new A();p.f();
  • Calls to P.f and any override. This has too many false positives.

I know there are always going to be false positives using only compile-time information, but there could be fewer.


Viewing all articles
Browse latest Browse all 44

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>