mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
AnnotationAwareOrderComparator is able to sort Class objects as well
Issue: SPR-10152
This commit is contained in:
+2
-1
@@ -50,7 +50,8 @@ public class AnnotationAwareOrderComparator extends OrderComparator {
|
||||
return ((Ordered) obj).getOrder();
|
||||
}
|
||||
if (obj != null) {
|
||||
Order order = obj.getClass().getAnnotation(Order.class);
|
||||
Class<?> clazz = (obj instanceof Class ? (Class) obj : obj.getClass());
|
||||
Order order = clazz.getAnnotation(Order.class);
|
||||
if (order != null) {
|
||||
return order.value();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user