[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 <s.richter@srsoftware.de>
Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
This commit is contained in:
Stephan Richter 2024-04-12 21:49:11 +02:00 committed by Ciprian Pascu
parent 92548c5a9f
commit c6aad8f2c0

View File

@ -55,7 +55,7 @@ public class LatencyParser {
Matcher m = LATENCY_PATTERN.matcher(inputLine); Matcher m = LATENCY_PATTERN.matcher(inputLine);
if (m.find() && m.groupCount() == 1) { 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"); logger.debug("Did not find a latency value");