From c6aad8f2c0dbaa92775b3df28913a598bf3e02c6 Mon Sep 17 00:00:00 2001 From: Stephan Richter Date: Fri, 12 Apr 2024 21:49:11 +0200 Subject: [PATCH] [network] Fix NumberFormatException for ping when locale has comma as decimal separator (#16636) * fixing bug: LatencyParser fails to parse ping times on systems with comma (,) set as decimal separator Signed-off-by: Stephan Richter Signed-off-by: Ciprian Pascu --- .../openhab/binding/network/internal/utils/LatencyParser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/utils/LatencyParser.java b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/utils/LatencyParser.java index 416d455edfd..bb3bffec5da 100644 --- a/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/utils/LatencyParser.java +++ b/bundles/org.openhab.binding.network/src/main/java/org/openhab/binding/network/internal/utils/LatencyParser.java @@ -55,7 +55,7 @@ public class LatencyParser { Matcher m = LATENCY_PATTERN.matcher(inputLine); if (m.find() && m.groupCount() == 1) { - return millisToDuration(Double.parseDouble(m.group(1))); + return millisToDuration(Double.parseDouble(m.group(1).replace(",", "."))); } logger.debug("Did not find a latency value");