Upgrade Units of Measurement dependencies (#10583)

* Fix code/tests for upgrade
* Resolve runbundles
* Update Checkstyle ruleset for changed packages

Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
Wouter Born
2021-05-11 08:31:03 +02:00
committed by GitHub
parent 0fd9c4c1f8
commit c3a6aa5814
24 changed files with 178 additions and 91 deletions

View File

@@ -124,7 +124,15 @@ class CosemQuantity<Q extends @Nullable Quantity<Q>> extends CosemValueDescripto
*/
private String prepare(String cosemValue) {
Matcher matcher = COSEM_VALUE_WITH_UNIT_PATTERN.matcher(cosemValue.replace("m3", ""));
if (!matcher.find()) {
return cosemValue;
}
return matcher.find() ? matcher.group(1) + ' ' + matcher.group(2) : cosemValue;
try {
Integer.parseInt(matcher.group(2));
return cosemValue;
} catch (NumberFormatException e) {
return matcher.group(1) + ' ' + matcher.group(2);
}
}
}