You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by bu...@apache.org on 2009/07/20 09:00:35 UTC
DO NOT REPLY [Bug 47547] New: NullPointerException when calling
Category.removeAllAppenders()
https://issues.apache.org/bugzilla/show_bug.cgi?id=47547
Summary: NullPointerException when calling
Category.removeAllAppenders()
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();) {
appenders.add(iter.nextElement());
}
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
'null'.
So the right for-loop should be:
for (Enumeration iter = aai.getAllAppenders(); iter != null &&
iter.hasMoreElements();) {
appenders.add(iter.nextElement());
}
Michael.
--
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
DO NOT REPLY [Bug 47547] NullPointerException when calling
Category.removeAllAppenders()
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47547
Curt Arnold <ca...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #1 from Curt Arnold <ca...@apache.org> 2009-10-10 19:39:37 UTC ---
Fix committed in rev 824000.
There were several checks for getAllAppenders() returning null, just not in
removeAllAppenders.
--
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