spring-framework icon indicating copy to clipboard operation
spring-framework copied to clipboard

Discover annotations on interface methods for AspectJ annotation pointcuts

Open mikelhamer opened this issue 1 week ago • 0 comments

This is a work in progress attempt to implement #22311 . This is my first time contributing, and I did my best to copy the style of existing tests.

I have a passing test which asserts annotation pointcuts work on interfaces methods when using the FQN of the annotation class such as @annotation(test.annotation.transaction.Tx) and a failing currently disabled test that asserts pointcuts work when using annotation shortcut arguments such as @annotation(tx).

I ran into a wall trying to figure out how to get that latter test passing, so I put a TODO in the implementation and disabled the test. I figured it would be more productive to just create the PR as is and ask for guidance / suggestions on how to proceed from the amazing community.

I am very open to any feedback or how to improve the existing implementation. Would love to keep working on this!

As an aside, I'm also thinking this should ultimately be put behind a property and be disabled by default since it might break existing projects. I could imagine a possibility where a pointcut on an interface wasn't triggering prior to this, but then if someone upgrades to a version that implements this it could start triggering causing unexpected behaviour. Thoughts?

mikelhamer avatar Dec 02 '25 04:12 mikelhamer