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

EditText of this page (last edited June 13, 2007) or FindPage with title or text search