Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Unsafe invocation of .value() on annotations in SynthesizedMergedAnnotationInvocationHandler prevents backwards-compatible additions to @annotation interfaces #24029
I have a scenario where I am extending an annotation API from
Here, old libraries compiled with the old annotation are still supported as the change is binary compatible. It is only that I as a framework author need to handle the case of an invocation of value() throwing an
I believe allowing this is crucial to evolution of annotations without forcing all implementors to re-compile.
Issue in Spring Core
Here, I believe the implementation should not expected values to be complete. I am not even sure as to why
This pre-loading values only really happens for early validation of value mismatches in the case of aliased attributes or Map-populated attributes. Since even those cases should be fine with late validation on actual attribute invocation, I've dropped that pre-loading iteration completely.
Please give the upcoming
Thanks @jhoeller for the prompt and excellent resolution. Unfortunately I am unable to fully verify my scenario as it is a complex OSGi app and I am depending on the ASF's ServiceMix team to translate spring releases into OSGi bundles. I'll re-test with the next release and will use a workaround for the time being.