Skip to content

Commit 4357749

Browse files
committed
Document that OrderComparator honors PriorityOrdered
Prior to this commit, it was not clear that OrderComparator sorts PriorityOrdered objects with higher priority than plain Ordered objects.
1 parent e3b3481 commit 4357749

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

spring-core/src/main/java/org/springframework/core/OrderComparator.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -27,6 +27,10 @@
2727
* {@link Comparator} implementation for {@link Ordered} objects, sorting
2828
* by order value ascending, respectively by priority descending.
2929
*
30+
* <h3>{@code PriorityOrdered} Objects</h3>
31+
* <p>{@link PriorityOrdered} objects will be sorted with higher priority than
32+
* <em>plain</em> {@code Ordered} objects.
33+
*
3034
* <h3>Same Order Objects</h3>
3135
* <p>Objects that have the same order value will be sorted with arbitrary
3236
* ordering with respect to other objects with the same order value.
@@ -41,6 +45,7 @@
4145
* @author Sam Brannen
4246
* @since 07.04.2003
4347
* @see Ordered
48+
* @see PriorityOrdered
4449
* @see org.springframework.core.annotation.AnnotationAwareOrderComparator
4550
* @see java.util.List#sort(java.util.Comparator)
4651
* @see java.util.Arrays#sort(Object[], java.util.Comparator)

0 commit comments

Comments
 (0)