Looks its an error. Only successfully initialized handlers should be added
to the list. For the ones that failed we have to log the error and continue
initializing the rest.

On Sat, Feb 28, 2015 at 11:17 PM, Nuwandi Wickramasinghe <[email protected]>
wrote:

> Hi,
>
> Is there any particular reason for hiding some exceptions
> in OAuthServerConfiguration class? For an example,
>
> *    public List<ClientAuthenticationHandler>
> getSupportedClientAuthHandlers() {*
> *        if (supportedClientAuthHandlers == null) {*
> *            synchronized (this) {*
> *                if (supportedClientAuthHandlers == null) {*
> *                    supportedClientAuthHandlers = new
> ArrayList<ClientAuthenticationHandler>();*
> *                    for (String entry :
> supportedClientAuthHandlerClassNames) {*
> *                        ClientAuthenticationHandler
> clientAuthenticationHandler = null;*
> *                        try {*
> *                            clientAuthenticationHandler =
> (ClientAuthenticationHandler) Class.forName(entry).newInstance();*
> *                            clientAuthenticationHandler.init();*
> *                        } catch (InstantiationException e) {*
> *                            log.error("Error instantiating " + entry);*
> *                        } catch (IllegalAccessException e) {*
> *                            log.error("Illegal access to " + entry);*
> *                        } catch (ClassNotFoundException e) {*
> *                            log.error("Cannot find class: " + entry);*
> *                        } catch (IdentityOAuth2Exception e) {*
> *                            log.error("Error while initializing " +
> entry);*
> *                        }*
> *
> supportedClientAuthHandlers.add(clientAuthenticationHandler);*
> *                    }*
> *                }*
> *            }*
> *        }*
> *        return supportedClientAuthHandlers;*
> *    }*
>
>
>
> Returned *supportedClientAuthHandlers *has a potential of
> a NullPointerException in run time.
>
> --
>
> Best Regards,
>
> Nuwandi Wickramasinghe
>
> Software Engineer
>
> WSO2 Inc.
>
> Web : http://wso2.com
>
> Mobile : 0719214873
>



-- 
Thanks & Regards,

*Johann Dilantha Nallathamby*
Associate Technical Lead & Product Lead of WSO2 Identity Server
Integration Technologies Team
WSO2, Inc.
lean.enterprise.middleware

Mobile - *+94777776950*
Blog - *http://nallaa.wordpress.com <http://nallaa.wordpress.com>*
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to