Skip to content

Commit

Permalink
126: Should static ServiceProvider methods be final?
Browse files Browse the repository at this point in the history
  • Loading branch information
keilw committed Oct 7, 2018
1 parent 8673a45 commit 5415695
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
16 changes: 8 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -753,9 +753,9 @@
<profiles>
<!-- Individual JARs -->
<profile>
<id>core-jar</id>
<!-- This profile builds only the core (root level) elements into a separate
-core.jar file -->
<id>base-jar</id>
<!-- This profile builds only the base (root level) elements into a separate
-base.jar file -->
<activation>
<activeByDefault>false</activeByDefault>
</activation>
Expand All @@ -766,12 +766,12 @@
<version>${maven.jar.version}</version>
<executions>
<execution>
<id>core-jar</id>
<id>base-jar</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>core</classifier>
<classifier>base</classifier>
<excludes>
<exclude>javax/measure/format/**</exclude>
<exclude>javax/measure/quantity/**</exclude>
Expand Down Expand Up @@ -870,7 +870,7 @@
<!-- Profile JARs -->
<profile>
<id>format-profile</id>
<!-- This profile builds the Format Profile (core+format) into a separate
<!-- This profile builds the Format Profile (base+format) into a separate
jar file -->
<activation>
<activeByDefault>false</activeByDefault>
Expand Down Expand Up @@ -902,7 +902,7 @@

<profile>
<id>spi-profile</id>
<!-- This profile builds the SPI Profile (core+format+spi) into a separate
<!-- This profile builds the SPI Profile (base+format+spi) into a separate
jar file -->
<activation>
<activeByDefault>false</activeByDefault>
Expand All @@ -914,7 +914,7 @@
<version>${maven.jar.version}</version>
<executions>
<execution>
<id>core-jar</id>
<id>base-jar</id>
<goals>
<goal>jar</goal>
</goals>
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/javax/measure/spi/ServiceProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public int getPriority() {
* @return the service to obtain a {@link UnitFormat}, or {@code null}.
* @deprecated Use {@link #getFormatService()}. This method will be removed in a future version, it is here for backward compatibility only.
*/
@Deprecated
@Deprecated(forRemoval=true)
public abstract UnitFormatService getUnitFormatService();

/**
Expand Down Expand Up @@ -153,8 +153,8 @@ public static final List<ServiceProvider> available() {

/**
* Returns the {@link ServiceProvider} with the specified name.
* The name must match at least one entry provider in the list of available service providers.
* Implementors are encouraged to use a unique enough name, e.g. the class name or other distinct attributes.
* The name must match at least one {@link #toString()} value of a provider in the list of available service providers.<br>
* Implementors are encouraged to override {@link #toString()} and use a unique enough name, e.g. the class name or other distinct attributes.
* Should multiple service providers nevertheless use the same name, the one with the highest {@link #getPriority() priority} wins.
*
* @param name
Expand All @@ -164,6 +164,7 @@ public static final List<ServiceProvider> available() {
* if available service providers do not contain a provider with the specified name
* @throws NullPointerException
* if {@code name} is null
* @see #toString()
* @since 2.0
*/
public static ServiceProvider of(String name) {
Expand Down

0 comments on commit 5415695

Please sign in to comment.