On 9/6/05, James Carman <[EMAIL PROTECTED]> wrote:

> Do you think we need to go through the trouble of throwing an
> IllegalArgumentException if it's not a well-formed class name (starts with
> character, blah blah blah)?  Or, can we just let it throw a
> ClassNotFoundException after doing as much as we can with the string that's
> passed in (i.e. transforming it into the proper format)?

I usually prefer to use different exceptions for different causes,
because makes handling them a lot easier.
Ie. a NullPointerException is perfectly fine if the supplied type spec
is null. Likewise a IllegalArgumentException seems fine if the type
spec is not a valid type declaration (ie. only brackets, different
number of opening and closing brackets, etc.). If it is syntactically
correct, then a ClassNotFoundException seems fine though.

Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to