Upgrade Units of Measurement dependencies (#2319)

Upgrades UoM dependencies to:

* javax.measure 2.1.2
* si-units 2.0.1
* indriya 2.1.2

An openHAB OSGi-ified si-units bundle is used as runtime dependency, because the latest si-units release is still missing proper OSGi manifest headers.

Notable changes:

* Quantity not longer implements an `equals` method, so the unit tests had to be adjusted. This should have any impact outside of the unit tests though since the rest of openHAB should be using QuantityType instead.
* RationalConverter is not package private, so instances of it much be created through the MultiplyConverter static functions.
* Quantities.getQuantity can no longer parse values without units like `100`. A workaround has been implemented.
* The unicode greek `mu` letter is now returned for unit prefixes instead of the unicode `micro` character. These characters are visually identical but the unit tests had to be adjusted. The new library seems to parse both types just fine.

Also-by: Connor Petty <mistercpp2000+gitsignoff@gmail.com>
Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
Wouter Born
2021-05-10 20:54:25 +02:00
committed by GitHub
parent 527f2c3565
commit 91307993ad
47 changed files with 575 additions and 352 deletions
@@ -25,9 +25,14 @@
<bundle dependency="true">mvn:org.apache.commons/commons-lang3/3.12.0</bundle>
<!-- Measurement -->
<bundle dependency="true">mvn:javax.measure/unit-api/1.0</bundle>
<bundle dependency="true">mvn:tec.uom/uom-se/1.0.10</bundle>
<bundle dependency="true">mvn:tec.uom.lib/uom-lib-common/1.0.3</bundle>
<bundle dependency="true">mvn:jakarta.annotation/jakarta.annotation-api/2.0.0</bundle>
<bundle dependency="true">mvn:jakarta.inject/jakarta.inject-api/2.0.0</bundle>
<bundle dependency="true">mvn:javax.measure/unit-api/2.1.2</bundle>
<!-- The si.uom:si-units manifest has no Export-Package entry. As workaround this OSGi-ify bundle is used. -->
<bundle dependency="true">mvn:org.openhab.osgiify/si.uom.si-units/2.0.1</bundle>
<bundle dependency="true">mvn:si.uom/si-quantity/2.0.1</bundle>
<bundle dependency="true">mvn:tech.units/indriya/2.1.2</bundle>
<bundle dependency="true">mvn:tech.uom.lib/uom-lib-common/2.1</bundle>
<!-- TODO: Unbundled libraries -->
<bundle dependency="true">mvn:com.thoughtworks.xstream/xstream/1.4.15</bundle>