You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AnnotationReadingVisitorUtils.getMergedAnnotationAttributes() mutates the map argument [SPR-11710] #16332
I'd actually already noticed it and fixed it in my solution for #16272 (see branch #16272 branch in my personal GitHub repository (direct link to commit)).
This is the corresponding change ("copy" being the key word):
// To start with, we populate the results with a copy of all attribute
// values from the target annotation.
AnnotationAttributes results = new AnnotationAttributes(attributesList.get(0));
This will go in once #16272 has been reviewed and merged into master, but we'll leave this issue open for the time being to ensure that it does not get overlooked.
Don't mutate annotation metadata when merging attrs
Prior to this commit, invoking the getMergedAnnotationAttributes()
method in AnnotationReadingVisitorUtils resulted in mutation of the
internal state of the ASM-based annotation metadata supplied to the
method.
This commit fixes this issue by making a copy of the original
AnnotationAttributes for the target annotation before merging attribute
values from the meta-annotation hierarchy.
This commit also introduces a slight performance improvement by
avoiding duplicate processing of the attributes of the target
annotation.
Activity
spring-projects-issues commentedon Apr 19, 2014
Sam Brannen commented
Thanks for reporting this!
I'd actually already noticed it and fixed it in my solution for #16272 (see branch #16272 branch in my personal GitHub repository (direct link to commit)).
This is the corresponding change ("copy" being the key word):
This will go in once #16272 has been reviewed and merged into
master, but we'll leave this issue open for the time being to ensure that it does not get overlooked.Cheers,
Sam
spring-projects-issues commentedon Apr 21, 2014
Sam Brannen commented
Fixed as described in the comments for GitHub commit e1720d8 (4.1) and GitHub commit 82c32db (4.0.4):