Repository: logging-log4j2
Updated Branches:
  refs/heads/master 2b1cf11e9 -> 60bcf168d


[LOG4J2-1599]

NPE in
org.apache.logging.log4j.message.ParameterFormatter.formatMessage3(StringBuilder,
char[], int, Object[], int, int[]).

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/60bcf168
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/60bcf168
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/60bcf168

Branch: refs/heads/master
Commit: 60bcf168d45eb930e84d3eee9d3ed11d2f2da2ef
Parents: 2b1cf11
Author: Gary Gregory <ggreg...@apache.org>
Authored: Tue Sep 20 11:09:03 2016 -0700
Committer: Gary Gregory <ggreg...@apache.org>
Committed: Tue Sep 20 11:09:03 2016 -0700

----------------------------------------------------------------------
 .../org/apache/logging/log4j/message/ParameterFormatter.java    | 5 ++++-
 src/changes/changes.xml                                         | 3 +++
 2 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/60bcf168/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterFormatter.java
----------------------------------------------------------------------
diff --git 
a/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterFormatter.java
 
b/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterFormatter.java
index 4a2bb65..79c447a 100644
--- 
a/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterFormatter.java
+++ 
b/log4j-api/src/main/java/org/apache/logging/log4j/message/ParameterFormatter.java
@@ -200,7 +200,10 @@ final class ParameterFormatter {
      */
     static void formatMessage3(final StringBuilder buffer, final char[] 
messagePattern, final int patternLength,
             final Object[] arguments, final int argCount, final int[] indices) 
{
-        if (messagePattern == null || arguments == null || argCount == 0) {
+        if (messagePattern == null) {
+            return;
+        }
+        if (arguments == null || argCount == 0) {
             buffer.append(messagePattern);
             return;
         }

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/60bcf168/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index b111523..b2fcc30 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -156,6 +156,9 @@
       <action issue="LOG4J2-1573" dev="ggregory" type="fix" due-to="Steffen 
Offermann">
         Layout is no longer optional.
       </action>
+      <action issue="LOG4J2-1599" dev="ggregory" type="fix">
+        NPE in 
org.apache.logging.log4j.message.ParameterFormatter.formatMessage3(StringBuilder,
 char[], int, Object[], int, int[]).
+      </action>
       <action issue="LOG4J2-1578" dev="ggregory" type="add">
         RoutingAppender can be configured with scripts. Add Script in a Routes 
element.
       </action>

Reply via email to