Skip to content

Commit 95af079

Browse files
committed
Document unidirectional @AliasFor attribute mapping support
See gh-23834
1 parent 005d201 commit 95af079

File tree

1 file changed

+6
-2
lines changed
  • spring-core/src/main/java/org/springframework/core/annotation

1 file changed

+6
-2
lines changed

spring-core/src/main/java/org/springframework/core/annotation/AliasFor.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,13 @@
5757
* <ul>
5858
* <li><strong>Explicit aliases within an annotation</strong>:
5959
* <ol>
60-
* <li>Each attribute that makes up an aliased pair must be annotated with
60+
* <li>Each attribute that makes up an aliased pair should be annotated with
6161
* {@code @AliasFor}, and either {@link #attribute} or {@link #value} must
62-
* reference the <em>other</em> attribute in the pair.</li>
62+
* reference the <em>other</em> attribute in the pair. Since Spring Framework
63+
* 5.2.1 it is technically possible to annotate only one of the attributes in an
64+
* aliased pair; however, it is recommended to annotate both attributes in an
65+
* aliased pair for better documentation as well as compatibility with previous
66+
* versions of the Spring Framework.</li>
6367
* <li>Aliased attributes must declare the same return type.</li>
6468
* <li>Aliased attributes must declare a default value.</li>
6569
* <li>Aliased attributes must declare the same default value.</li>

0 commit comments

Comments
 (0)