From a562dfdd1a2d158a1af7f653af79eedabfb4b665 Mon Sep 17 00:00:00 2001 From: bmalinowsky Date: Wed, 1 May 2024 16:50:25 +0200 Subject: [PATCH] When using a formatted string, additional exception argument is ignored --- src/io/calimero/tools/BaosClient.java | 3 ++- src/io/calimero/tools/DeviceInfo.java | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/io/calimero/tools/BaosClient.java b/src/io/calimero/tools/BaosClient.java index 8e4e520..3e20118 100644 --- a/src/io/calimero/tools/BaosClient.java +++ b/src/io/calimero/tools/BaosClient.java @@ -47,6 +47,7 @@ import java.net.InetSocketAddress; import java.nio.ByteBuffer; import java.nio.charset.Charset; +import java.text.MessageFormat; import java.time.Duration; import java.time.Instant; import java.time.LocalDate; @@ -565,7 +566,7 @@ private void runRepl() throws IOException, InterruptedException { out(e.getMessage()); } catch (KNXException | RuntimeException e) { - out.log(ERROR, "[{0}]", line, e); + out.log(ERROR, MessageFormat.format("[{0}]", line), e); } } } diff --git a/src/io/calimero/tools/DeviceInfo.java b/src/io/calimero/tools/DeviceInfo.java index 6f449cb..2781f1b 100755 --- a/src/io/calimero/tools/DeviceInfo.java +++ b/src/io/calimero/tools/DeviceInfo.java @@ -48,6 +48,7 @@ import java.net.UnknownHostException; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -887,7 +888,7 @@ private void readActualPeiType() throws InterruptedException putResult(CommonParameter.ActualPeiType, toPeiTypeString(peitype), peitype); } catch (final KNXException e) { - out.log(ERROR, "reading actual PEI type (A/D converter channel {0}, repeat {1})", channel, repeat, e); + out.log(ERROR, MessageFormat.format("reading actual PEI type (A/D converter channel {0}, repeat {1})", channel, repeat), e); } } @@ -1275,7 +1276,7 @@ private void read(final Parameter p, final Callable c) throws KNXLinkClo out.log(WARNING, "reading {0}: {1}", p, e.getMessage()); } catch (final Exception e) { - out.log(ERROR, "error reading {0}", p, e); + out.log(ERROR, "error reading " + p, e); } }