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
AnnotationUtils fails to retrieve attribute values from non-public annotations [SPR-11104] #15730
The getValue() methods in AnnotationUtils currently fail to retrieve the value of the desired annotation attribute if the annotation itself is not public (i.e., package private). In contrast, the getDefaultValue() methods work fine since they invoke Method#getDefaultValue(). Thus the problem lies with the fact that AnnotationUtils.getValue(Annotation, String) attempts to invoke the method, swallowing the exception on failure and silently returning null.
Deliverables
Update AnnotationUtils.getValue(Annotation, String) so that it uses reflection to make the desired annotation attribute method accessible before invoking it to retrieve the value.
Support non-public anno. attr. values in AnnoUtils
Prior to this commit, the getValue(Annotation, String) method in
AnnotationUtils failed to retrieve the value of the desired annotation
attribute if the annotation itself was not public -- for example if the
annotation was declared as package private.
This commit addresses this issue by ensuring that getValue(Annotation,
String) uses reflection to make the desired annotation attribute method
accessible before attempting to invoke it to retrieve the value.
Activity
spring-projects-issues commentedon Nov 20, 2013
Sam Brannen commented
Resolved as discussed in the comments for GitHub commit b830d73: