Apply "instanceof pattern matching" (#29710)

This commit is contained in:
diguage 2022-12-18 19:46:15 +08:00 committed by GitHub
parent d4623a393b
commit 511dab1ade
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -65,11 +65,11 @@ public class DefaultAdvisorChainFactory implements AdvisorChainFactory, Serializ
if (config.isPreFiltered() || pointcutAdvisor.getPointcut().getClassFilter().matches(actualClass)) {
MethodMatcher mm = pointcutAdvisor.getPointcut().getMethodMatcher();
boolean match;
if (mm instanceof IntroductionAwareMethodMatcher) {
if (mm instanceof IntroductionAwareMethodMatcher iamm) {
if (hasIntroductions == null) {
hasIntroductions = hasMatchingIntroductions(advisors, actualClass);
}
match = ((IntroductionAwareMethodMatcher) mm).matches(method, actualClass, hasIntroductions);
match = iamm.matches(method, actualClass, hasIntroductions);
}
else {
match = mm.matches(method, actualClass);