logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r1381236 - in /logging/log4j/log4j2/trunk: jcl-bridge/src/main/java/org/apache/logging/log4j/jcl/LogFactoryImpl.java src/changes/changes.xml
Date Wed, 05 Sep 2012 16:26:21 GMT
Author: rgoers
Date: Wed Sep  5 16:26:20 2012
New Revision: 1381236

URL: http://svn.apache.org/viewvc?rev=1381236&view=rev
Log:
Fix LOG4J2-78 - Fix NPE in LogFactoryImpl.setAttribute in Commons Logging bridge

Modified:
    logging/log4j/log4j2/trunk/jcl-bridge/src/main/java/org/apache/logging/log4j/jcl/LogFactoryImpl.java
    logging/log4j/log4j2/trunk/src/changes/changes.xml

Modified: logging/log4j/log4j2/trunk/jcl-bridge/src/main/java/org/apache/logging/log4j/jcl/LogFactoryImpl.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/jcl-bridge/src/main/java/org/apache/logging/log4j/jcl/LogFactoryImpl.java?rev=1381236&r1=1381235&r2=1381236&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/jcl-bridge/src/main/java/org/apache/logging/log4j/jcl/LogFactoryImpl.java
(original)
+++ logging/log4j/log4j2/trunk/jcl-bridge/src/main/java/org/apache/logging/log4j/jcl/LogFactoryImpl.java
Wed Sep  5 16:26:20 2012
@@ -96,7 +96,11 @@ public class LogFactoryImpl extends LogF
 
     @Override
     public void setAttribute(String name, Object value) {
-        attributes.put(name, value);
+        if (value != null) {
+            attributes.put(name, value);
+        } else {
+            removeAttribute(name);
+        }
     }
 
     /**

Modified: logging/log4j/log4j2/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/changes/changes.xml?rev=1381236&r1=1381235&r2=1381236&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/src/changes/changes.xml (original)
+++ logging/log4j/log4j2/trunk/src/changes/changes.xml Wed Sep  5 16:26:20 2012
@@ -23,6 +23,10 @@
 
   <body>
     <release version="2.0-alpha3" date="TBD" description="">
+      <action issue="LOG4J2-78" dev="rgoers" type="fix">
+        LogFactoryImpl.setAttribute in the Commons Logging bridge got a NullPointerException
when passed a null value.
+        It will now remove the attribute.
+      </action>
       <action issue="LOG4J2-77" dev="rgoers" type="fix">
         RoutingAppender was calling the stop method for each of its referenced Appenders
and was calling
         the stop method of the default Appender a second time. It will now only call the
stop method of



Mime
View raw message