1. /*
  2. * @(#)IllegalArgumentException.java 1.23 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. * Thrown to indicate that a method has been passed an illegal or
  10. * inappropriate argument.
  11. *
  12. * @author unascribed
  13. * @version 1.23, 12/19/03
  14. * @see java.lang.Thread#setPriority(int)
  15. * @since JDK1.0
  16. */
  17. public
  18. class IllegalArgumentException extends RuntimeException {
  19. /**
  20. * Constructs an <code>IllegalArgumentException</code> with no
  21. * detail message.
  22. */
  23. public IllegalArgumentException() {
  24. super();
  25. }
  26. /**
  27. * Constructs an <code>IllegalArgumentException</code> with the
  28. * specified detail message.
  29. *
  30. * @param s the detail message.
  31. */
  32. public IllegalArgumentException(String s) {
  33. super(s);
  34. }
  35. /**
  36. * Constructs a new exception with the specified detail message and
  37. * cause.
  38. *
  39. * <p>Note that the detail message associated with <code>cause</code> is
  40. * <i>not</i> automatically incorporated in this exception's detail
  41. * message.
  42. *
  43. * @param message the detail message (which is saved for later retrieval
  44. * by the {@link Throwable#getMessage()} method).
  45. * @param cause the cause (which is saved for later retrieval by the
  46. * {@link Throwable#getCause()} method). (A <tt>null</tt> value
  47. * is permitted, and indicates that the cause is nonexistent or
  48. * unknown.)
  49. * @since 1.5
  50. */
  51. public IllegalArgumentException(String message, Throwable cause) {
  52. super(message, cause);
  53. }
  54. /**
  55. * Constructs a new exception with the specified cause and a detail
  56. * message of <tt>(cause==null ? null : cause.toString())</tt> (which
  57. * typically contains the class and detail message of <tt>cause</tt>).
  58. * This constructor is useful for exceptions that are little more than
  59. * wrappers for other throwables (for example, {@link
  60. * java.security.PrivilegedActionException}).
  61. *
  62. * @param cause the cause (which is saved for later retrieval by the
  63. * {@link Throwable#getCause()} method). (A <tt>null</tt> value is
  64. * permitted, and indicates that the cause is nonexistent or
  65. * unknown.)
  66. * @since 1.5
  67. */
  68. public IllegalArgumentException(Throwable cause) {
  69. super(cause);
  70. }
  71. private static final long serialVersionUID = -5365630128856068164L;
  72. }