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
DispatcherServlet.initHandlerMappings(…) uses OrderComparator.sort(…) instead of AnnotationAwareOrderComparator.sort(…) which misses out HandlerMappings that use @Order instead of implementing Ordered.
Probably an oversight that stems from the times when @Order didn't even exists. Might be worth grepping the framework sources for other uses of OrderComparator as I think AnnotationAwareOrderComparator should be used everywhere OrderComparator is used nowadays.
It's not really an oversight: For traditional Java strategies such as HandlerMapping, we kept using OrderComparator since it fits with the interface model there. Only for annotation-based components, we started delegating to AnnotationAwareOrderComparator.
That said, for 4.2, we are already considering wider use of AnnotationAwareOrderComparator, see e.g. #17018. I suppose we'll cover this for DispatcherServlet's strategies as well then.
Oliver Drotbohm opened SPR-12806 and commented
DispatcherServlet.initHandlerMappings(…)
usesOrderComparator.sort(…)
instead ofAnnotationAwareOrderComparator.sort(…)
which misses outHandlerMappings
that use@Order
instead of implementingOrdered
.Probably an oversight that stems from the times when
@Order
didn't even exists. Might be worth grepping the framework sources for other uses ofOrderComparator
as I thinkAnnotationAwareOrderComparator
should be used everywhereOrderComparator
is used nowadays.Affects: 4.0.9, 4.1.5
Issue Links:
@Order
on ApplicationListeners@Order
vs@Priority
vs@DependsOn
Referenced from: commits 13659d6
The text was updated successfully, but these errors were encountered: