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:
@@ -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", "m³"));
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user