mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
0ec03a8dd6
SynthesizedAnnotation was originally introduced as a convenience for easily detecting if an annotation had been synthesized by Spring via a simple `if (myAnnotation instanceof SynthesizedAnnotation)` check. However, the introduction of SynthesizedAnnotation in the JDK dynamic proxy for a synthesized annotation results in a separate proxy class for each annotation synthesized by Spring, and this causes issues with GraalVM native images since users and framework developers must always ensure that the additional proxy classes are registered. This commit completely removes the use of SynthesizedAnnotation in synthesized annotation proxies. This change allows the proxy class for an annotation to be reused for a synthesized annotation of the same annotation type. Consequently: - Extra proxy classes are not generated on the JVM or in a native image. - Extra proxy classes are not required to be registered for a native image. Closes gh-29041