directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kiran Ayyagari <kayyag...@apache.org>
Subject Re: How strict must we check in util methods
Date Fri, 04 Jun 2010 09:36:26 GMT
On Fri, Jun 4, 2010 at 12:28 PM, Felix Knecht <felix@otego.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Do we leave it up to third party developers to take care that only
> correct values are passed or do we have to take care that otherwise an
> exception is thrown? To give an example from shared AttributUtils:
> We never check if the object to clone is a String, we just presume that
> any other developer using this class respects the convention given by
> javadoc. Can we do so or should an exception be thrown in such cases?

think it is ok to assume the other value as string, IMHO a throws
clause makes the caller
code cluttered with try/catch blocks (assuming that we are throwing a
checked exception)

P.S:- hmm not sure if throwing a IllegalArgumentException is the right
idea here, but is a good choice

thanks Felix

Kiran Ayyagari

Mime
View raw message