Closed
Description
Synthesized annotations that contain arrays and/or strings do not generate the same toString()
value as the non-synthesized version.
The non-synthesized annotation's toString()
method returns a string which is a code equivalent version of that annotation meaning that you can take the result of the toString()
, copy and paste it into code, and have it compile. This is very convenient when writing a code generation library since it allows you to copy annotations.
This does not work with synthesized annotations though as the way the array gets serialized in toString()
doesn't match.
Actual Annotation:
@Bean("testValue")
Non-Synthesized Annotation toString()
:
@org.springframework.context.annotation.Bean(value = {"testValue"})
Synthesized Annotation toString()
:
@org.springframework.context.annotation.Bean(value = [testValue])