Hey all check out this commit:
Note the commentary. This is a special case where the NamingException really cannot happen unless there is some drastic catastrophy with the jars containing bootstrap schema classes and their loaders. So in this case we can wrap it.
Check out the commment and let me know what you think.
Hmmm I see. What about making the method that has this constructor just throw the exception? If the server cannot be constructed properly it should be something that should interrupt what ever is trying to start it up no?
Another thing is that we may not need to throw this exception. I have a feeling it will never really be thrown since the bootstrap schemas are always packaged and will always load. This is afterall what is now happing in the constructor which requires this new exception. So I guess we can wrap it in an IllegalStateException since if it bombs something is messed up with the packaging.
AlexOn Jan 3, 2008 5:02 PM, Emmanuel Lecharny <email@example.com > wrote:Alex Karasulu wrote:It's not bad by essence. It just palin hurts when you have to create new
> Why is it bad to have a checked exception in the throws clause of a
instances in thousands places in the code :
ServerEntry entry = null;
entry = new DefaultServerEntry( <params> );
catch ( WhateverCheckedException wce )
LOG.error ( "Why the HELL do I have to catch errors when creating a
new object everywhere ???" );
instead of :
ServerEntry entry = new DefaultServerentry( <params> ); // I _know_ what
I'm doing !!! params *are* valid, for G*d sake !
IMHO, of course :)
> cordialement, regards,
> Emmanuel Lécharny
> www.iktek.com < http://www.iktek.com>
> directory.apache.org <http://directory.apache.org>