From ac2996b86a351fcfecde1aeab0d036f3e91de37d Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Tue, 27 Apr 2010 11:47:16 +0000 Subject: [PATCH] Additional fix for #310603: append extra params at the end of the format string, but skip them if they're null. git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@1574 7e9141cc-0065-0410-87d8-b60c137991c4 --- .../main/java/org/eclipse/jetty/util/log/JavaUtilLog.java | 7 +++++-- .../main/java/org/eclipse/jetty/util/log/StdErrLog.java | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/log/JavaUtilLog.java b/jetty-util/src/main/java/org/eclipse/jetty/util/log/JavaUtilLog.java index 9a460d8395c..464ed52d1df 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/log/JavaUtilLog.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/log/JavaUtilLog.java @@ -126,8 +126,11 @@ public class JavaUtilLog implements Logger if (bracesIndex < 0) { builder.append(msg.substring(start)); - builder.append(" "); - builder.append(String.valueOf(arg)); + if (arg != null) + { + builder.append(" "); + builder.append(arg); + } start = msg.length(); } else diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/log/StdErrLog.java b/jetty-util/src/main/java/org/eclipse/jetty/util/log/StdErrLog.java index ef901dcbee4..7608dd91641 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/log/StdErrLog.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/log/StdErrLog.java @@ -197,8 +197,11 @@ public class StdErrLog implements Logger if (bracesIndex < 0) { escape(builder, msg.substring(start)); - builder.append(" "); - builder.append(String.valueOf(arg)); + if (arg != null) + { + builder.append(" "); + builder.append(arg); + } start = msg.length(); } else