On Jan 20, 2010, at 1:41 AM, Emmanuel Lcharny wrote:
Ashish a écrit :
We can simply catch it and do whatever we want with it.
In this case, I think the constructor should be throwing an
IOException.
Anyone mind if I remove the places where we removed the checked
exceptions?
I am afraid, we have already freezed the API, so not sure if we
should do this.
But you can remove the crap inside the method, and throw one single
runtime exception with a decent message. The bst would be to throw a
RuntimeIoException, as this constructor does not throws anything.
Yes, since we don't want to change the API we should still throw a
RuntimeException.
Btw, I'd like to know your opinion about constructor throwing a
checked exception : do you consider this as a bad smell?
I think constructors throwing a checked exception is fine.
Regards,
Alan