Closed
Description
Tiberiu Tofan opened SPR-16723 and commented
After upgrading from Spring Boot 2.0.0.M7 (Sprig AOP 5.0.2) to Spring Boot 2.0.1.RELEASE (Spring AOP 5.0.5) the following advice doesn't work anymore:
@Around("execution(* org.springframework.data.mongodb.repository.MongoRepository.deleteById(..)) && args(id)")
It looks like the pointcut ignores methods that are declared only in a super interface. If I actually override the methods in my MongoRepository, the advice is applied.
A workaround for this is to use the interface where the method is actually declared as a execution pointcut, and specify the target separately:
@Around("target(org.springframework.data.mongodb.repository.MongoRepository) && execution(* org.springframework.data.repository.CrudRepository.deleteById(*)) && args(id)")
Affects: 5.0.5
Issue Links:
- Comprehensively cache annotated methods for interfaces and superclasses [SPR-16675] #21216 Comprehensively cache annotated methods for interfaces and superclasses
- Mixed use BeanNameAutoProxyCreator and AnnotationAwareAspectJAutoProxyCreator to proxy same bean [SPR-16677] #21218 Mixed use BeanNameAutoProxyCreator and AnnotationAwareAspectJAutoProxyCreator to proxy same bean
- Unnecessary proxying with MethodMapTransactionAttributeSource [SPR-16733] #21274 Unnecessary proxying with MethodMapTransactionAttributeSource
- AopUtils.getMostSpecificMethod should expose dynamic proxy class methods [SPR-16757] #21298 AopUtils.getMostSpecificMethod should expose dynamic proxy class methods
- AspectJ annotation pointcuts fail to evaluate against interface-based proxies [SPR-16803] #21343 AspectJ annotation pointcuts fail to evaluate against interface-based proxies
- Spring 5.x DataSource proxying does not work with Oracle UCP on JDK 9+ [SPR-17003] #21541 Spring 5.x DataSource proxying does not work with Oracle UCP on JDK 9+