Illegal State Exception

A Java Exception thrown by a method that has been invoked at an illegal or inappropriate time. It extends RuntimeException, which means it does not need to be caught.

In many cases, code that is throwing NullPointerException should be argument-checking and throwing this, with a decent explanatory message.

See: IllegalArgumentException

View edit of November 12, 2014 or FindPage with title or text search