unitsofmeasurement / unit-api

Units of Measurement API
http://unitsofmeasurement.github.io/unit-api/
Other
180 stars 42 forks source link

Refactor the handling of JSR-330, JSR-250 and Jakarta annotations in `ServiceProvider` #242

Closed desruisseaux closed 1 year ago

desruisseaux commented 1 year ago

Changes in this merge request:

https://github.com/unitsofmeasurement/unit-api/blob/b5ca1576b7df480d7692ea26bbfd9c332945b5c0/src/main/java/javax/measure/spi/ServiceProvider.java#L183

After above changes are applied, the second commit specializes the Java 9 implementation for taking advantage of Java 9 capability to defer the initialization of ServiceProvider implementations. The deferred initialization is handled by ServiceLoader.Provider (new in Java 9).


This change is Reviewable

desruisseaux commented 1 year ago

Fixed one of the two "Codacy" complains (about field declarations on separated lines). The second complain (about reassigning parameters) should be ignored. Following Codacy advice would just make the code more complicated for no good reason. I think that I do not have the authorization to bypass Codacy myself.