MethodMatcher historically accepts a null target class despite usually being invoked with a non-null class (the method's declaring class if no explicit target class given) by DefaultAdvisorChainFactory. Tightening this towards a non-null guarantee, also using the same fallback in ReflectiveMethodInvocation's dispatch to a dynamic MethodMatcher, simplifies some matcher implementations and provides a clearer experience overall.
IntroductionAwareMethodMatcher requires some explicit IntroductionAdvisor checks across the advisor chain which are worth avoiding if no such method matcher is applicable to begin with. For this to work, MethodMatchers.union/intersect needs to differentiate between regular and introduction-aware method matchers, providing dedicated aggregate types for each. DefaultAdvisorChainFactory may then lazily determine introductions only when encountering an actual IntroductionAwareMethodMatcher.
Juergen Hoeller opened SPR-17068 and commented
MethodMatcher
historically accepts anull
target class despite usually being invoked with a non-null class (the method's declaring class if no explicit target class given) byDefaultAdvisorChainFactory
. Tightening this towards a non-null guarantee, also using the same fallback inReflectiveMethodInvocation
's dispatch to a dynamicMethodMatcher
, simplifies some matcher implementations and provides a clearer experience overall.IntroductionAwareMethodMatcher
requires some explicitIntroductionAdvisor
checks across the advisor chain which are worth avoiding if no such method matcher is applicable to begin with. For this to work,MethodMatchers.union/intersect
needs to differentiate between regular and introduction-aware method matchers, providing dedicated aggregate types for each.DefaultAdvisorChainFactory
may then lazily determine introductions only when encountering an actualIntroductionAwareMethodMatcher
.Affects: 5.0.8
Referenced from: commits 252f52a
The text was updated successfully, but these errors were encountered: