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
Copy file name to clipboardExpand all lines: src/main/java/javax/measure/spi/ServiceProvider.java
+9-7Lines changed: 9 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -56,7 +56,7 @@
56
56
* All the methods in this class are safe to use by multiple concurrent threads.
57
57
* </p>
58
58
*
59
-
* @version 2.1, November 16, 2020
59
+
* @version 2.2, November 16, 2020
60
60
* @author Werner Keil
61
61
* @author Martin Desruisseaux
62
62
* @since 1.0
@@ -106,9 +106,9 @@ protected ServiceProvider() {
106
106
* Allows to define a priority for a registered {@code ServiceProvider} instance.
107
107
* When multiple providers are registered in the system, the provider with the highest priority value is taken.
108
108
*
109
-
* <p>If the {@value #PRIORITY_ANNOTATION} annotation (from JSR-250) is present on the {@code ServiceProvider}
110
-
* implementation class, then that annotation is taken and this {@code getPriority()} method is ignored.
111
-
* Otherwise – if the {@code Priority} annotation is absent – this method is used as a fallback.</p>
109
+
* <p>If the {@value #PRIORITY_ANNOTATION} annotation (from JSR-250) or {@value #JAKARTA_PRIORITY_ANNOTATION} annotation (from Jakarta Annotations) is present on the {@code ServiceProvider}
110
+
* implementation class, then that annotation (first if both were present) is taken and this {@code getPriority()} method is ignored.
111
+
* Otherwise – if a {@code Priority} annotation is absent – this method is used as a fallback.</p>
112
112
*
113
113
* @return the provider's priority (default is 0).
114
114
*/
@@ -242,8 +242,8 @@ public boolean test(ServiceProvider provider) {
242
242
243
243
/**
244
244
* Returns the priority of the given service provider.
245
-
* This method looks for the {@value #PRIORITY_ANNOTATION} annotation,
246
-
* and if none are found fallbacks on {@link ServiceProvider#getPriority()}.
245
+
* This method looks for the {@value #PRIORITY_ANNOTATION} annotation or {@value #JAKARTA_PRIORITY_ANNOTATION},
246
+
* and if none are found falls back on {@link ServiceProvider#getPriority()}.
247
247
*/
248
248
privateintpriority(ServiceProviderprovider) {
249
249
if (priorityGetter != null) {
@@ -269,7 +269,9 @@ private int priority(ServiceProvider provider) {
0 commit comments