Skip to content

Commit

Permalink
Reduce creation of composite interfaces to actual method references i…
Browse files Browse the repository at this point in the history
…n current pointcut

Closes gh-29519
  • Loading branch information
jhoeller committed Jan 9, 2023
1 parent 11df955 commit 88cac6a
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -422,7 +422,8 @@ private void bindParameters(ProxyMethodInvocation invocation, JoinPointMatch jpm

private ShadowMatch getTargetShadowMatch(Method method, Class<?> targetClass) {
Method targetMethod = AopUtils.getMostSpecificMethod(method, targetClass);
if (targetMethod.getDeclaringClass().isInterface()) {
if (targetMethod.getDeclaringClass().isInterface() && targetMethod.getDeclaringClass() != targetClass &&
obtainPointcutExpression().getPointcutExpression().contains("." + targetMethod.getName() + "(")) {
// Try to build the most specific interface possible for inherited methods to be
// considered for sub-interface matches as well, in particular for proxy classes.
// Note: AspectJ is only going to take Method.getDeclaringClass() into account.
Expand Down

0 comments on commit 88cac6a

Please sign in to comment.