Tighten (IntroductionAware)MethodMatcher contract

Provides a non-null guarantee for MethodMatcher's targetClass argument and strict separation between IntroductionAwareMethodMatcher and regular MethodMatcher, enabling DefaultAdvisorChainFactory to defer its IntroductionAdvisor determination until encountering an actual IntroductionAwareMethodMatcher (even behind union/intersection).

Issue: SPR-17068
This commit is contained in:
Juergen Hoeller
2018-07-20 00:17:31 +02:00
parent 867b3d233d
commit 252f52ab07
22 changed files with 170 additions and 103 deletions

View File

@@ -34,7 +34,7 @@ import org.springframework.util.ObjectUtils;
public abstract class JCacheOperationSourcePointcut extends StaticMethodMatcherPointcut implements Serializable {
@Override
public boolean matches(Method method, @Nullable Class<?> targetClass) {
public boolean matches(Method method, Class<?> targetClass) {
JCacheOperationSource cas = getCacheOperationSource();
return (cas != null && cas.getCacheOperation(method, targetClass) != null);
}