I need to analyze the call hierarchy of methods in a Java Spring Boot application.
IntelliJ IDEA gets confused when I have:
- a interface
I
declaringI.foo()
- an abstract class
A
with implementation ofI.foo()
- several concrete classes
B
,C
etc extendingA
andB
overridesA.foo()
I'd like to get the call hierarchy of B.foo()
however I get also all callers of C.foo()
.
If that matters, the classes are autowired similar to the following:
@Component
public class Caller1 {
@Autowired B b;
public void bar(){ b.foo()}
}
@Component
public class Caller2 {
@Autowired C c;
public void bar(){ c.foo()}
}
public interface I {
void foo();
}
public abstract class A implements I {
void foo(){..}
}
@Component
public B extends A {
@Override
void foo() {..}
}
@Component
public C extends A {
..
}
In IntelliJ IDEA, the call hierarchy of B.foo()
includes both Caller1.bar()
and Caller2.bar()
. But I only want callers of B.foo()
such as Caller1.bar()
.