From e4d67fc8fb467cc48050d29c990c9d21ada44213 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Fri, 29 Nov 2024 18:43:58 +0100 Subject: [PATCH] Fix off-by-one error in exception decoration code This was failing only in dev mode when using printf-style logging. Fixes https://github.com/smallrye/smallrye-graphql/issues/2230 (cherry picked from commit 64f0108a59c6bf5129068cb0944c88deb204d96f) --- .../io/quarkus/deployment/logging/LoggingResourceProcessor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/deployment/src/main/java/io/quarkus/deployment/logging/LoggingResourceProcessor.java b/core/deployment/src/main/java/io/quarkus/deployment/logging/LoggingResourceProcessor.java index 8507399dea96c..b51be9c405304 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/logging/LoggingResourceProcessor.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/logging/LoggingResourceProcessor.java @@ -449,7 +449,7 @@ public void accept(LogRecord logRecord, Consumer logRecordConsumer) { Object[] np = p != null ? Arrays.copyOf(p, p.length + 1) : new Object[1]; np[np.length - 1] = decoratedString; elr.setParameters(np); - elr.setMessage(elr.getMessage() + "\n\n%" + (np.length - 1) + "$s", + elr.setMessage(elr.getMessage() + "\n\n%" + np.length + "$s", ExtLogRecord.FormatStyle.PRINTF); } case NO_FORMAT -> {