APIdia Launch Partner
Top Description Fields Constructors
java.lang

public Class IllegalStateException

extends RuntimeException
Class Inheritance
Known Direct Subclasses
java.util.FormatterClosedException, java.nio.InvalidMarkException, java.nio.channels.AcceptPendingException, java.nio.channels.AlreadyBoundException, java.nio.channels.AlreadyConnectedException, java.nio.channels.CancelledKeyException, java.nio.channels.ClosedSelectorException, java.nio.channels.ConnectionPendingException, java.nio.channels.IllegalBlockingModeException, java.nio.channels.NoConnectionPendingException, java.nio.channels.NonReadableChannelException, java.nio.channels.NonWritableChannelException, java.nio.channels.NotYetBoundException, java.nio.channels.NotYetConnectedException, java.nio.channels.OverlappingFileLockException, java.nio.channels.ReadPendingException, java.nio.channels.ShutdownChannelGroupException, java.nio.channels.WritePendingException, java.nio.file.ClosedDirectoryStreamException, java.nio.file.ClosedFileSystemException, java.nio.file.ClosedWatchServiceException, java.util.concurrent.CancellationException, jdk.internal.loader.AbstractClassLoaderValue.Memoizer.RecursiveInvocationException

Signals that a method has been invoked at an illegal or inappropriate time. In other words, the Java environment or Java application is not in an appropriate state for the requested operation.
Author
Jonni Kanerva
Since
1.1

Field Summary

Modifier and TypeField and Description
pack-priv static final long

Constructor Summary

AccessConstructor and Description
public
IllegalStateException()

Constructs an IllegalStateException with no detail message.

public
IllegalStateException(String
the String that contains a detailed message
s
)

Constructs an IllegalStateException with the specified detail message.

public
IllegalStateException(String
the detail message (which is saved for later retrieval by the Throwable#getMessage() method).
message
,
Throwable
the cause (which is saved for later retrieval by the Throwable#getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
cause
)

Constructs a new exception with the specified detail message and cause.

public
IllegalStateException(Throwable
the cause (which is saved for later retrieval by the Throwable#getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
cause
)

Constructs a new exception with the specified cause and a detail message of (cause==null ?

Field Detail

serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Hides java.lang.RuntimeException.serialVersionUID.

Annotations
@Serial

Constructor Detail

IllegalStateExceptionback to summary
public IllegalStateException()

Constructs an IllegalStateException with no detail message. A detail message is a String that describes this particular exception.

IllegalStateExceptionback to summary
public IllegalStateException(String s)

Constructs an IllegalStateException with the specified detail message. A detail message is a String that describes this particular exception.

Parameters
s:String

the String that contains a detailed message

IllegalStateExceptionback to summary
public IllegalStateException(String message, Throwable cause)

Constructs a new exception with the specified detail message and cause.

Note that the detail message associated with cause is not automatically incorporated in this exception's detail message.

Parameters
message:String

the detail message (which is saved for later retrieval by the Throwable#getMessage() method).

cause:Throwable

the cause (which is saved for later retrieval by the Throwable#getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)

Since
1.5
IllegalStateExceptionback to summary
public IllegalStateException(Throwable cause)

Constructs a new exception with the specified cause and a detail message of (cause==null ? null : cause.toString()) (which typically contains the class and detail message of cause). This constructor is useful for exceptions that are little more than wrappers for other throwables (for example, java.security.PrivilegedActionException).

Parameters
cause:Throwable

the cause (which is saved for later retrieval by the Throwable#getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)

Since
1.5