Skip to content

AspectJ execution pointcut does not detect methods in superinterface anymore [SPR-16723] #21264

Closed
@spring-projects-issues

Description

@spring-projects-issues

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:

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: regressionA bug that is also a regression

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions