logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpo...@apache.org
Subject svn commit: r1552996 - in /logging/log4j/log4j2/trunk: log4j-core/src/main/java/org/apache/logging/log4j/core/selector/ClassLoaderContextSelector.java src/changes/changes.xml
Date Sun, 22 Dec 2013 14:13:47 GMT
Author: rpopma
Date: Sun Dec 22 14:13:47 2013
New Revision: 1552996

URL: http://svn.apache.org/r1552996
Log:
Fix for LOG4J2-477: NPE in ClassLoaderContextSelector

Modified:
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/selector/ClassLoaderContextSelector.java
    logging/log4j/log4j2/trunk/src/changes/changes.xml

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/selector/ClassLoaderContextSelector.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/selector/ClassLoaderContextSelector.java?rev=1552996&r1=1552995&r2=1552996&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/selector/ClassLoaderContextSelector.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/selector/ClassLoaderContextSelector.java
Sun Dec 22 14:13:47 2013
@@ -179,7 +179,8 @@ public class ClassLoaderContextSelector 
     }
 
     private LoggerContext locateContext(final ClassLoader loader, final URI configLocation)
{
-        final String name = loader.toString();
+        // LOG4J2-477: class loader may be null
+        final String name = loader != null ? loader.toString() : ClassLoader.getSystemClassLoader().toString();
         AtomicReference<WeakReference<LoggerContext>> ref = CONTEXT_MAP.get(name);
         if (ref == null) {
             if (configLocation == null) {

Modified: logging/log4j/log4j2/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/changes/changes.xml?rev=1552996&r1=1552995&r2=1552996&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/src/changes/changes.xml (original)
+++ logging/log4j/log4j2/trunk/src/changes/changes.xml Sun Dec 22 14:13:47 2013
@@ -21,6 +21,9 @@
   </properties>
   <body>
     <release version="2.0-RC1" date="2013-MM-DD" description="Bug fixes and enhancements">
+      <action issue="LOG4J2-477" dev="rpopma" type="fix" due-to="Tal Liron">
+        NPE in ClassLoaderContextSelector.
+      </action>
       <action issue="LOG4J2-454" dev="rpopma" type="fix" due-to="Robin Zhang Tao">
         TimeBasedTriggeringPolicy should use event time millis.
       </action>



Mime
View raw message