AnnotationUtils fails to synthesize nested maps into annotations [SPR-13338] #17923
Closed
1 task done
Labels
Milestone
Sam Brannen opened SPR-13338 and commented
Status Quo
The Javadoc for the
synthesizeAnnotation(Map<String, Object>, Class<A>, AnnotatedElement)
method inAnnotationUtils
states the following:Note that the Javadoc says that key-value pairs must be present, but it does not say that there are any limitations on the types of values that are permitted. The Javadoc also explicitly states that
AnnotationAttributes
is an ideal candidate for synthesis.However, if the map of annotation attributes was created manually (with nested maps instead of annotations) or with one of the
getAnnotationAttributes(..)
variants withnestedAnnotationsAsMap
set totrue
, an exception is thrown during synthesis since a map or array or maps is not compatible with an annotation or array of annotations, respectively.Deliverables
Affects: 4.2 GA
Referenced from: commits f17173f
The text was updated successfully, but these errors were encountered: