Skip to content

Commit dda4dfb

Browse files
committed
Clarify semantics of the PriorityOrdered interface
This commit clarifies the semantics of the PriorityOrdered interface with respect to sorting sets of objects containing both PriorityOrdered and plain Ordered objects. Closes gh-23187
1 parent 29dcd19 commit dda4dfb

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

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

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2015 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.
@@ -18,14 +18,19 @@
1818

1919
/**
2020
* Extension of the {@link Ordered} interface, expressing a <em>priority</em>
21-
* ordering: order values expressed by {@code PriorityOrdered} objects
22-
* always apply before same order values expressed by <em>plain</em>
23-
* {@link Ordered} objects.
21+
* ordering: {@code PriorityOrdered} objects are always applied before
22+
* <em>plain</em> {@link Ordered} objects regardless of their order values.
2423
*
25-
* <p>This is primarily a special-purpose interface, used for objects where
26-
* it is particularly important to recognize <em>prioritized</em> objects
27-
* first, without even obtaining the remaining objects. A typical example:
28-
* prioritized post-processors in a Spring
24+
* <p>When sorting a set of {@code Ordered} objects, {@code PriorityOrdered}
25+
* objects and <em>plain</em> {@code Ordered} objects are effectively treated as
26+
* two separate subsets, with the set of {@code PriorityOrdered} objects preceding
27+
* the set of <em>plain</em> {@code Ordered} objects and with relative
28+
* ordering applied within those subsets.
29+
*
30+
* <p>This is primarily a special-purpose interface, used within the framework
31+
* itself for objects where it is particularly important to recognize
32+
* <em>prioritized</em> objects first, potentially without even obtaining the
33+
* remaining objects. A typical example: prioritized post-processors in a Spring
2934
* {@link org.springframework.context.ApplicationContext}.
3035
*
3136
* <p>Note: {@code PriorityOrdered} post-processor beans are initialized in
@@ -34,10 +39,10 @@
3439
* beans which do not require eager initialization for type matching.
3540
*
3641
* @author Juergen Hoeller
42+
* @author Sam Brannen
3743
* @since 2.5
3844
* @see org.springframework.beans.factory.config.PropertyOverrideConfigurer
3945
* @see org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
4046
*/
4147
public interface PriorityOrdered extends Ordered {
42-
4348
}

0 commit comments

Comments
 (0)