[logback-dev] [JIRA] Resolved: (LBCLASSIC-49) LoggerContext.getLogger(final String name) doesn't check if name is null

Ceki Gulcu (JIRA) noreply-jira at qos.ch
Thu Oct 30 20:45:21 CET 2008


     [ http://jira.qos.ch/browse/LBCLASSIC-49?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ceki Gulcu resolved LBCLASSIC-49.
---------------------------------

    Fix Version/s: 0.9.12
       Resolution: Fixed

The getLogger() method in LoggerContext class will now throw an IllegalArgumentException when invoked with a null argument.

I think that is the best logback-classic can do, since a null name argument is illegal. LoggerContext.getLogger(null) has to return something but can't... 

> LoggerContext.getLogger(final String name) doesn't check if name is null
> ------------------------------------------------------------------------
>
>                 Key: LBCLASSIC-49
>                 URL: http://jira.qos.ch/browse/LBCLASSIC-49
>             Project: logback-classic
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: unspecified
>         Environment: Operating System: All
> Platform: All
>            Reporter: Oliver Lietz
>            Assignee: Logback dev list
>             Fix For: 0.9.12
>
>
> hence loggerCache.get(name) could fail (NPE) in line 117:
> java.lang.NullPointerException
> 	at java.util.Hashtable.get(Hashtable.java:336)
> 	at ch.qos.logback.classic.LoggerContext.getLogger(LoggerContext.java:117)
> 	at ch.qos.logback.classic.LoggerContext.getLogger(LoggerContext.java:44)
> 	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:88)
> 	at org.apache.sling.osgi.log.LogSupport.getLogger(LogSupport.java:322)
> 	at org.apache.sling.osgi.log.LogSupport.logOut(LogSupport.java:333)
> 	at org.apache.sling.osgi.log.LogSupport.fireLogEvent(LogSupport.java:167)
> 	at org.apache.sling.osgi.log.LogSupport.bundleChanged(LogSupport.java:216)
> 	at org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:690)
> 	at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:619)
> 	at org.apache.felix.framework.util.EventDispatcher.run(EventDispatcher.java:816)
> 	at org.apache.felix.framework.util.EventDispatcher.access$000(EventDispatcher.java:42)
> 	at org.apache.felix.framework.util.EventDispatcher$1.run(EventDispatcher.java:94)
> 	at java.lang.Thread.run(Thread.java:613)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the logback-dev mailing list