You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rg...@apache.org on 2012/11/05 02:20:29 UTC

svn commit: r1405687 - in /logging/log4j/log4j2/trunk: core/src/main/java/org/apache/logging/log4j/core/selector/ClassLoaderContextSelector.java src/changes/changes.xml

Author: rgoers
Date: Mon Nov  5 01:20:29 2012
New Revision: 1405687

URL: http://svn.apache.org/viewvc?rev=1405687&view=rev
Log:
LOG4J2-108 - Protect against NPE in ClassLoaderContextSelector if the SecurityManager can't locate the classw

Modified:
    logging/log4j/log4j2/trunk/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/core/src/main/java/org/apache/logging/log4j/core/selector/ClassLoaderContextSelector.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/selector/ClassLoaderContextSelector.java?rev=1405687&r1=1405686&r2=1405687&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/selector/ClassLoaderContextSelector.java (original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/selector/ClassLoaderContextSelector.java Mon Nov  5 01:20:29 2012
@@ -99,7 +99,9 @@ public class ClassLoaderContextSelector 
 
             if (securityManager != null) {
                 Class clazz = securityManager.getCaller(fqcn);
-                return locateContext(clazz.getClassLoader(), null);
+                if (clazz != null) {
+                    return locateContext(clazz.getClassLoader(), null);
+                }
             }
 
             Throwable t = new Throwable();

Modified: logging/log4j/log4j2/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/changes/changes.xml?rev=1405687&r1=1405686&r2=1405687&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/src/changes/changes.xml (original)
+++ logging/log4j/log4j2/trunk/src/changes/changes.xml Mon Nov  5 01:20:29 2012
@@ -23,6 +23,10 @@
 
   <body>
     <release version="2.0-beta3" date="TBD" description= "Bug fixes and enhancements">
+      <action issue="LOG4J2-108" dev="rgoers" type="fix">
+        Fix NullPointerException in ClassLoaderContextSelector when no class is returned from
+        the SecurityManager.
+      </action>
       <action issue="LOG4J2-105" dev="rgoers" type="update">
         Add ability to customize the names of the Levels in the LevelPatternConverter.
       </action>