classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] Patch: replace NullPointerException with ClassCastExcep


From: Anthony Green
Subject: Re: [cp-patches] Patch: replace NullPointerException with ClassCastException
Date: Sun, 18 Sep 2005 07:15:06 -0700

On Sun, 2005-09-18 at 12:13 +0200, Mark Wielaard wrote:
> > The way I read it is if both conditions fail then our library is busted
> > and we should throw a runtime exception, and not the expected
> > NoSuchAlgorithmException.  That would just mask a problem.
> 
> Our library or the given Provider. 

Our library.

> I would still throw the
> NoSuchAlgorithmException either with a chained exception cause or an
> appropriate message. But I don't feel too strongly about it. The
> NullPointerException was the worst thing we could throw since that
> doesn't really give the user any information what went wrong.

Even NullPointerException is preferable to NoSuchAlgorithmException.
User applications will be written to expect NoSuchAlgorithmException so
nobody will ever know that our library is broken.  

AG






reply via email to

[Prev in Thread] Current Thread [Next in Thread]