From 45a922704736beb7160bf7fdca5bd236caf9212d Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Fri, 20 Nov 2020 12:39:28 +0100 Subject: [PATCH] Remove TODO from AbstractAspectJAdvice Despite the code duplication, we will not delegate to AopUtils.invokeJoinpointUsingReflection() from AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(). The rationale is that the exception message in invokeAdviceMethodWithGivenArgs() provides additional context via the pointcut expression, and we would lose that additional context if we simply delegate to AopUtils.invokeJoinpointUsingReflection(). We could introduce an overloaded variant of invokeJoinpointUsingReflection() that accepts an additional argument to provide the additional context for the exception message, but we don't think that would be the best solution for this particular use case. In light of that, we are simply removing the TODO. Closes gh-26126 --- .../org/springframework/aop/aspectj/AbstractAspectJAdvice.java | 1 - 1 file changed, 1 deletion(-) diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/AbstractAspectJAdvice.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/AbstractAspectJAdvice.java index ab118f59a51..8ef1bf148a1 100644 --- a/spring-aop/src/main/java/org/springframework/aop/aspectj/AbstractAspectJAdvice.java +++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/AbstractAspectJAdvice.java @@ -631,7 +631,6 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence } try { ReflectionUtils.makeAccessible(this.aspectJAdviceMethod); - // TODO AopUtils.invokeJoinpointUsingReflection return this.aspectJAdviceMethod.invoke(this.aspectInstanceFactory.getAspectInstance(), actualArgs); } catch (IllegalArgumentException ex) {