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
Comment From: jzheaux
Good catch, @f-cramer. Are you able to provide a PR against the 5.8.x branch that includes a test to address the issue?