Skip to content

Commit 511dab1

Browse files
authored
Apply "instanceof pattern matching" (#29710)
1 parent d4623a3 commit 511dab1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-aop/src/main/java/org/springframework/aop/framework/DefaultAdvisorChainFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ public List<Object> getInterceptorsAndDynamicInterceptionAdvice(
6565
if (config.isPreFiltered() || pointcutAdvisor.getPointcut().getClassFilter().matches(actualClass)) {
6666
MethodMatcher mm = pointcutAdvisor.getPointcut().getMethodMatcher();
6767
boolean match;
68-
if (mm instanceof IntroductionAwareMethodMatcher) {
68+
if (mm instanceof IntroductionAwareMethodMatcher iamm) {
6969
if (hasIntroductions == null) {
7070
hasIntroductions = hasMatchingIntroductions(advisors, actualClass);
7171
}
72-
match = ((IntroductionAwareMethodMatcher) mm).matches(method, actualClass, hasIntroductions);
72+
match = iamm.matches(method, actualClass, hasIntroductions);
7373
}
7474
else {
7575
match = mm.matches(method, actualClass);

0 commit comments

Comments
 (0)