[ 
https://issues.apache.org/jira/browse/CXF-1083?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12531494
 ] 

Freeman Fang commented on CXF-1083:
-----------------------------------

Benson, 

you are right, we also need do the same thing when name is not null, something 
like
try {
    if (name == null) {
          return (Logger) cns.newInstance(loggerName, 
BundleUtils.getBundleName(cls)); 
    } else {
          return (Logger) cns.newInstance(loggerName, 
BundleUtils.getBundleName(cls, name)); 
    }
} catch (InvocationTargetException ite) { 
    if (ite.getTargetException() instanceof MissingResourceException) { 
           return (Logger) cns.newInstance(loggerName, null); 
    } else { 
           throw ite; 
   } 

} 


> LogUtils is missing some MissingResourceException handling
> ----------------------------------------------------------
>
>                 Key: CXF-1083
>                 URL: https://issues.apache.org/jira/browse/CXF-1083
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.2
>            Reporter: benson margulies
>            Assignee: Daniel Kulp
>            Priority: Blocker
>
> In LogUtils.createLogger, there is no handling for MissingResourceException 
> when there is a custom logger class.
> The Log4jClass, delegating to the Abstract class, gets just the same 
> collection of missing resource exceptions as the default case. So it blows up.
> The code in createLogger only fails to handle if the name is non-null. If the 
> name is null, it has a try block. Looks to me as if the == null test is 
> backwards.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to