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 2003/04/09 21:39:42 UTC
DO NOT REPLY [Bug 18875] New: -
Priority.DEBUG == Level.DEBUG is false
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18875>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18875
Priority.DEBUG == Level.DEBUG is false
Summary: Priority.DEBUG == Level.DEBUG is false
Product: Log4j
Version: 1.2
Platform: All
URL: http://marc.theaimsgroup.com/?t=104989472900001&r=1&w=2
OS/Version: Other
Status: NEW
Severity: Normal
Priority: Other
Component: Other
AssignedTo: log4j-dev@jakarta.apache.org
ReportedBy: ceki@apache.org
CC: djohnson@desknetinc.com
The Level.equals method is omitted by design. Levels are designed to be
flyweights such that there can only be one instance of each level at any time.
In the existing code for various convoluted reasons this is not the case
because (Priority.DEBUG == Level.DEBUG) is false. Hiding this bug with an
equals method will not fix it.
Solution: Remove the static fields Priority.DEBUG through Priority.FATAL.
Moreover, the Priority.getAllPossiblePriorities is broken because it does not
take into consideration custom levels. A better approach would have been to
allow custom levels to be registered with some registry (perhaps a utility
class) and let class respond to requests of type getAllPossibleLevels().
Problem first observed by David S. Johnson.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-dev-help@jakarta.apache.org