Current documentation states:
(AnnotationAwareOrderComparator)
This implementation retrieves an
@javax.annotation.Priority
value, allowing for additional semantics over the regular@Order
annotation: typically, selecting one object over another in case of multiple matches but only one object to be returned.
java.util.Comparator
implementation that checks Spring'sorg.springframework.core.Ordered
interface as well as the@Order
annotation and thejavax.annotation.Priority
annotation
(Ordered)
Since Spring 4.1, the standard
javax.annotation.Priority
annotation can be used as a drop-in replacement for this annotation.
(related commits are https://github.com/spring-projects/spring-framework/commit/1ff3af6da37896e229e54fc8592673918f9203f4#diff-0ae6f1c11a501e20ca54f02b5287234555640da5f5b23863bd7b92756a3b4f4fR35 & https://github.com/spring-projects/spring-framework/commit/c6d29f1a314c600c6b2d1cdfc3a21ba66523b037#diff-7647ef528e5ffcfdb8ce8b88d189a906a1e7b46778323bc92cb9783a4991d5abR1225 by @jhoeller & @sbrannen
Implementation seems to agree with that, using those terms in tandem, e.g.:
protected Integer getPriority(Object beanInstance) {
Comparator<Object> comparator = getDependencyComparator();
if (comparator instanceof OrderComparator orderComparator) {
return orderComparator.getPriority(beanInstance);
}
return null;
}
etc.
However, @snicoll clearly states in https://github.com/spring-projects/spring-framework/issues/31544 that they are "separate concepts" because "That's just an internal detail of how this is implemented", and that "[value of] LOWEST_PRECEDENCE is a concept of @Order and has nothing to do with JakartaEE's priority."
https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/annotation/Order.html#value() clearly uses the term "drop-in replacement", i.e.
The
value
is optional and represents an order value as defined in theOrdered
interface. Lower values have higher priority. The default value isOrdered.LOWEST_PRECEDENCE
, indicating lowest priority (losing to any other specified order value). (...) Since Spring 4.1, the standard Priority annotation can be used as a drop-in replacement for this annotation in ordering scenarios.
A "drop-in replacement" by definition is when a "component [can be replaced] with another one without any other code or configuration changes being required and resulting in no negative impacts.", which implies that the value
are also intended to be both functionally and semantically compatible between the two, at least as per this doc.
Comment From: snicoll
The issue you've raised has been locked for a reason and you're being obnoxious. Creating a separate issue is really not a good way to make any progress into something we deem to be resolved.