Discover annotations on interface methods for AspectJ annotation pointcuts #35943
+87
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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?