Closed desruisseaux closed 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.
Changes in this merge request:
javax.inject
andjakarta.inject
to coexist on the classpath. Before this commit, if both were present on the classpath, then the code checked onlyjavax.inject
annotations and Jakarta was ignored.javax.inject
annotations are deprecated in favour ofjakarta.inject
. See for example OpenRewrite.@Named
annotation in JUnit test, for testing the code path that check annotation values.if (name != null)
check: after the addition of Jakarta annotations, a pair of{ … }
should have been added for applying the condition to both JSR and Jakarta annotations. Before this commit, the condition applied only to JSR annotations because of missing{ … }
. The bug was there: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 byServiceLoader.Provider
(new in Java 9).This change is