Author: carnold
Date: Sun Oct 11 02:36:57 2009
New Revision: 824000

URL: http://svn.apache.org/viewvc?rev=824000&view=rev
Log:
Big 47547: NPE in Category.removeAllAppenders

Modified:
    logging/log4j/trunk/src/changes/changes.xml
    logging/log4j/trunk/src/main/java/org/apache/log4j/Category.java

Modified: logging/log4j/trunk/src/changes/changes.xml
URL: 
http://svn.apache.org/viewvc/logging/log4j/trunk/src/changes/changes.xml?rev=824000&r1=823999&r2=824000&view=diff
==============================================================================
--- logging/log4j/trunk/src/changes/changes.xml (original)
+++ logging/log4j/trunk/src/changes/changes.xml Sun Oct 11 02:36:57 2009
@@ -86,6 +86,7 @@
        <action action="fix" issue="46539">The QuietWriter class does not live 
up to its published contract.</action>
        <action action="add" issue="46983">More Debug output for log4j 
auto-configure requested.</action>
        <action action="add" issue="47107">Add MDC.clear().</action>
+       <action action="fix" issue="47547">NullPointerException when calling 
Category.removeAllAppenders().</action>
     </release>
 
   

Modified: logging/log4j/trunk/src/main/java/org/apache/log4j/Category.java
URL: 
http://svn.apache.org/viewvc/logging/log4j/trunk/src/main/java/org/apache/log4j/Category.java?rev=824000&r1=823999&r2=824000&view=diff
==============================================================================
--- logging/log4j/trunk/src/main/java/org/apache/log4j/Category.java (original)
+++ logging/log4j/trunk/src/main/java/org/apache/log4j/Category.java Sun Oct 11 
02:36:57 2009
@@ -885,7 +885,7 @@
   void removeAllAppenders() {
     if(aai != null) {
       Vector appenders = new Vector();
-      for (Enumeration iter = aai.getAllAppenders(); iter.hasMoreElements();) {
+      for (Enumeration iter = aai.getAllAppenders(); iter != null && 
iter.hasMoreElements();) {
           appenders.add(iter.nextElement());
       }
       aai.removeAllAppenders();



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to