On Fri, Jun 4, 2010 at 12:28 PM, Felix Knecht <[email protected]> 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
