In Java, is there a semantic difference between using "Illegal" (as in IllegalArgumentException
) versus "Invalid" (as in javax.activity.InvalidActivityException
)?
During the course of an assignment it became useful to write a subclass of IllegalArgumentException
to represent a series of input characters that cannot be tokenized, and I'm wondering whether convention says to use InvalidTokenException
or IllegalTokenException
.
The only difference I can find so far is that java.lang
seems to prefer "Illegal" while javax.*
prefers "Invalid". However, there is also java.security.InvalidParameterException
which is a subclass of IllegalArgumentException
.