logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 47547] New: NullPointerException when calling Category.removeAllAppenders()
Date Mon, 20 Jul 2009 07:00:35 GMT

           Summary: NullPointerException when calling
           Product: Log4j
           Version: 1.2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: PatchAvailable
          Severity: normal
          Priority: P2
         Component: Appender
        AssignedTo: log4j-dev@logging.apache.org
        ReportedBy: Michael.Zamir@gmail.com
                CC: Michael.Zamir@gmail.com

The Category.removeAllAppenders() fails, sometime, because of a wrong for-loop
condition, and it throws a NullPointerException

The first for-loop in the Category.removeAllAppenders() looks as following:

for (Enumeration iter = aai.getAllAppenders(); iter.hasMoreElements();) {

But in one of my scenario (BTW I can't understand why it happened only to me),
I got a null 'iter' variable, since the aai.getAllAppenders() may return

So the right for-loop should be:

for (Enumeration iter = aai.getAllAppenders(); iter != null &&
iter.hasMoreElements();) {


Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org

View raw message