@@ -956,21 +956,14 @@ public void postProcess(AnnotatedElement element, Annotation annotation, Annotat
956
956
957
957
for (Method attributeMethod : AnnotationUtils .getAttributeMethods (annotation .annotationType ())) {
958
958
String attributeName = attributeMethod .getName ();
959
- List < String > aliases = AnnotationUtils .getAliasedAttributeNames (attributeMethod , targetAnnotationType );
959
+ String attributeOverrideName = AnnotationUtils .getAttributeOverrideName (attributeMethod , targetAnnotationType );
960
960
961
961
// Explicit annotation attribute override declared via @AliasFor
962
- if (!aliases .isEmpty ()) {
963
- if (aliases .size () != 1 ) {
964
- throw new IllegalStateException (String .format (
965
- "Alias list for annotation attribute [%s] must contain at most one element: %s" ,
966
- attributeMethod , aliases ));
967
- }
968
- String aliasedAttributeName = aliases .get (0 );
969
- if (attributes .containsKey (aliasedAttributeName )) {
970
- overrideAttribute (element , annotation , attributes , attributeName , aliasedAttributeName );
962
+ if (attributeOverrideName != null ) {
963
+ if (attributes .containsKey (attributeOverrideName )) {
964
+ overrideAttribute (element , annotation , attributes , attributeName , attributeOverrideName );
971
965
}
972
966
}
973
-
974
967
// Implicit annotation attribute override based on convention
975
968
else if (!AnnotationUtils .VALUE .equals (attributeName ) && attributes .containsKey (attributeName )) {
976
969
overrideAttribute (element , annotation , attributes , attributeName , attributeName );
0 commit comments