Describe the bug
When annotating a method that causes a synthetic method to be created (for example when overriding Spring Datas ListCrudRepository#findAllById which in turn overrides CrudRepository#findAllById) both the original and the synthetic method will contain this annotation when checking at runtime. This leads to a AnnotationConfigurationException being thrown when trying to call the overridden method although the annotation is only present once in the source code
To Reproduce
Check out https://github.com/f-cramer/spring-security-synthetic-methods an call http://localhost:8080/books with username admin and password abc123.
Expected behavior
Synthetic methods should be ignored when validating the uniqueness of security annotations
Describe the bug
When annotating a method that causes a synthetic method to be created (for example when overriding Spring Datas
ListCrudRepository#findAllByIdwhich in turn overridesCrudRepository#findAllById) both the original and the synthetic method will contain this annotation when checking at runtime. This leads to aAnnotationConfigurationExceptionbeing thrown when trying to call the overridden method although the annotation is only present once in the source codeTo Reproduce
Check out https://github.com/f-cramer/spring-security-synthetic-methods an call
http://localhost:8080/bookswith usernameadminand passwordabc123.Expected behavior
Synthetic methods should be ignored when validating the uniqueness of security annotations