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