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

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

actually, when should catach InvocationTargetException  but not 
MissingResourceException here, since all exception in relect would be wrapped 
as InvocationTargetException  

so the code here
if (name == null) {
                    try {
                        return (Logger) cns.newInstance(loggerName, 
BundleUtils.getBundleName(cls));
                    } catch (InvocationTargetException ite) {
                        if (ite.getTargetException() instanceof 
MissingResourceException) {
                            return (Logger) cns.newInstance(loggerName, null);
                        } else {
                            throw ite;
                        }
                    } 
                } else {
                    return (Logger) cns.newInstance(loggerName, 
BundleUtils.getBundleName(cls, name));
                }
IMHO, is correct

> 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