Implementations of this interface serve as resolvers for bridge methods. For the Java compiler, a method
signature does not include any information on a method's return type. However, within Java byte code, a
distinction is made such that the Java compiler needs to include bridge methods where the method with the more
specific return type is called from the method with the less specific return type when a method is
overridden to return a more specific value. This resolution is important when auxiliary types are called since
an accessor required for
Foo#qux
on some type
Bar
with an overriden method
qux
that was
defined with a more specific return type would call the bridge method internally and not the intended method.
This can be problematic if the following chain is the result of an instrumentation:
- A
super
method accessor is registered for Foo#qux
for some auxiliary type Baz
.
- The accessor is a bridging method which calls
Bar#qux
with the more specific return type.
- The method
Bar#qux
is intercepted by an instrumentation.
- Within the instrumented implementation, the auxiliary type
Baz
is used to invoke Foo#qux
.
- The
super
method invocation hits the bridge which delegates to the intercepted implementation what
results in endless recursion.