Phil Webb opened SPR-16213 and commented
It wasn't immediately obvious to me that @Order can be used on @Bean methods to change the order of Collection<BeanType> injection.
Some dedicated section of the reference documentation explaining @Order and the difference between @DependsOn could be useful. It might also be worth adding a note to the Javadoc (although technically @Order is in core so it shouldn't know about context concerns).
Here's an example stack overflow question with someone else asking the question and a slightly misleading answer:
https://stackoverflow.com/questions/36187063/instantiate-beans-in-order-in-spring
Issue Links:
Referenced from: commits 84699c8, 1d060ec
Backported to: 4.3.13
Phil Webb opened SPR-16213 and commented
It wasn't immediately obvious to me that
@Ordercan be used on@Beanmethods to change the order ofCollection<BeanType>injection.Some dedicated section of the reference documentation explaining
@Orderand the difference between@DependsOncould be useful. It might also be worth adding a note to the Javadoc (although technically@Orderis in core so it shouldn't know about context concerns).Here's an example stack overflow question with someone else asking the question and a slightly misleading answer:
https://stackoverflow.com/questions/36187063/instantiate-beans-in-order-in-spring
Issue Links:
@Ordershould get detected in case of proxyTargetClass=false as well@Orderannotations not consistently honored within DispatcherServlet and other parts of the framework@javax.annotation.Priority as alternative to@Primary@Orderat the@Beanmethod levelReferenced from: commits 84699c8, 1d060ec
Backported to: 4.3.13