1. /*
  2. * @(#)IllegalStateException.java 1.15 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.lang;
  8. /**
  9. * Signals that a method has been invoked at an illegal or
  10. * inappropriate time. In other words, the Java environment or
  11. * Java application is not in an appropriate state for the requested
  12. * operation.
  13. *
  14. * @author Jonni Kanerva
  15. * @version 1.15, 12/19/03
  16. * @since JDK1.1
  17. */
  18. public
  19. class IllegalStateException extends RuntimeException {
  20. /**
  21. * Constructs an IllegalStateException with no detail message.
  22. * A detail message is a String that describes this particular exception.
  23. */
  24. public IllegalStateException() {
  25. super();
  26. }
  27. /**
  28. * Constructs an IllegalStateException with the specified detail
  29. * message. A detail message is a String that describes this particular
  30. * exception.
  31. *
  32. * @param s the String that contains a detailed message
  33. */
  34. public IllegalStateException(String s) {
  35. super(s);
  36. }
  37. /**
  38. * Constructs a new exception with the specified detail message and
  39. * cause.
  40. *
  41. * <p>Note that the detail message associated with <code>cause</code> is
  42. * <i>not</i> automatically incorporated in this exception's detail
  43. * message.
  44. *
  45. * @param message the detail message (which is saved for later retrieval
  46. * by the {@link Throwable#getMessage()} method).
  47. * @param cause the cause (which is saved for later retrieval by the
  48. * {@link Throwable#getCause()} method). (A <tt>null</tt> value
  49. * is permitted, and indicates that the cause is nonexistent or
  50. * unknown.)
  51. * @since 1.5
  52. */
  53. public IllegalStateException(String message, Throwable cause) {
  54. super(message, cause);
  55. }
  56. /**
  57. * Constructs a new exception with the specified cause and a detail
  58. * message of <tt>(cause==null ? null : cause.toString())</tt> (which
  59. * typically contains the class and detail message of <tt>cause</tt>).
  60. * This constructor is useful for exceptions that are little more than
  61. * wrappers for other throwables (for example, {@link
  62. * java.security.PrivilegedActionException}).
  63. *
  64. * @param cause the cause (which is saved for later retrieval by the
  65. * {@link Throwable#getCause()} method). (A <tt>null</tt> value is
  66. * permitted, and indicates that the cause is nonexistent or
  67. * unknown.)
  68. * @since 1.5
  69. */
  70. public IllegalStateException(Throwable cause) {
  71. super(cause);
  72. }
  73. static final long serialVersionUID = -1848914673093119416L;
  74. }