Throw the exception type which is actually advertised in the function
declaration and JavaDoc:
- I've searched the whole project for a catch for the old type
IllegalArgumentException, we don't catch that anywhere. So its safe to
change the function to throw what is advertised
- Notice that the second throw is NOT changed by this commit because it
will be removed in the following commit anyway.