We have lots of code in the implementations of Model subystems which does
things along the lines of:

    if (element instanceof ModelElement) {
        return ((ModelElement) element).getName();
    } else {
        throw new IllegalArgumentException("bad argument type");
    }

this can be abbreviated as:

        return ((ModelElement) element).getName();

except for the requirement introduced by some of our Junit tests that bad
parameters must cause an IllegalArgumentException.

Do we really care whether this throws an IllegalArgumentException vs a
ClassCastException or NullPointerException?  This seems to me to be a lot of
boilerplate code which isn't adding any value and I'd like to relax the
tests to accept other exception types.

Are there any objections to this?

Tom

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

Reply via email to