directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Knecht <fel...@apache.org>
Subject Re: How strict must we check in util methods
Date Fri, 04 Jun 2010 09:45:27 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/04/10 11:36, Kiran Ayyagari wrote:
> 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

Hehe ... Sounds like the answer of a politician :-)

> 
> thanks Felix
> 
> Kiran Ayyagari
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwIyzcACgkQ2lZVCB08qHG6dwCfQLkHMgKNTWMpGN/hhtcJFs63
i3kAn0LzOKCH+aWo60OQWLbvLUX6SbdL
=nWpg
-----END PGP SIGNATURE-----

Mime
View raw message