harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paulex Yang <paulex.y...@gmail.com>
Subject Re: [classlib] bug-to-bug compatibility: SecureRandom
Date Mon, 13 Mar 2006 09:08:05 GMT
Mikhail

I think current Harmony code is fine in this case. Because it is 
reasonable to consider null as another exceptional case and to 
differentiate it with the case of non-existing algorithm.

Mikhail Loenko wrote:
> Hello,
>
> one more issue for discussion/approval.
>
> class: java.security.SecureRandom
> method: public static SecureRandom getInstance(String algorithm)
>
> According to spec, it throws:
> NoSuchAlgorithmException - if the RNG algorithm is not available in
> the caller's environment.
>
> RI throws NullPointerException if algorithm==null (seems like they don't do
> any check)
>
> Harmony currently makes explicit check:
>         if (algorithm == null) {
>             throw new NullPointerException("Algorithm is null");
>         }
>
> Thoughts?
>
> Thanks,
> Mikhail Loenko
> Intel Middleware Products Division
>
>   


-- 
Paulex Yang
China Software Development Lab
IBM



Mime
View raw message