emul/src/main/java/java/lang/IllegalArgumentException.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Fri, 28 Sep 2012 17:59:03 +0200
branchemul
changeset 49 0a115f1c6f3c
permissions -rw-r--r--
Bringing in core Java classes as of OpenJDK tag jdk7-b147
jaroslav@49
     1
/*
jaroslav@49
     2
 * Copyright (c) 1994, 2003, Oracle and/or its affiliates. All rights reserved.
jaroslav@49
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
jaroslav@49
     4
 *
jaroslav@49
     5
 * This code is free software; you can redistribute it and/or modify it
jaroslav@49
     6
 * under the terms of the GNU General Public License version 2 only, as
jaroslav@49
     7
 * published by the Free Software Foundation.  Oracle designates this
jaroslav@49
     8
 * particular file as subject to the "Classpath" exception as provided
jaroslav@49
     9
 * by Oracle in the LICENSE file that accompanied this code.
jaroslav@49
    10
 *
jaroslav@49
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
jaroslav@49
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
jaroslav@49
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
jaroslav@49
    14
 * version 2 for more details (a copy is included in the LICENSE file that
jaroslav@49
    15
 * accompanied this code).
jaroslav@49
    16
 *
jaroslav@49
    17
 * You should have received a copy of the GNU General Public License version
jaroslav@49
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
jaroslav@49
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
jaroslav@49
    20
 *
jaroslav@49
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
jaroslav@49
    22
 * or visit www.oracle.com if you need additional information or have any
jaroslav@49
    23
 * questions.
jaroslav@49
    24
 */
jaroslav@49
    25
jaroslav@49
    26
package java.lang;
jaroslav@49
    27
jaroslav@49
    28
/**
jaroslav@49
    29
 * Thrown to indicate that a method has been passed an illegal or
jaroslav@49
    30
 * inappropriate argument.
jaroslav@49
    31
 *
jaroslav@49
    32
 * @author  unascribed
jaroslav@49
    33
 * @see     java.lang.Thread#setPriority(int)
jaroslav@49
    34
 * @since   JDK1.0
jaroslav@49
    35
 */
jaroslav@49
    36
public
jaroslav@49
    37
class IllegalArgumentException extends RuntimeException {
jaroslav@49
    38
    /**
jaroslav@49
    39
     * Constructs an <code>IllegalArgumentException</code> with no
jaroslav@49
    40
     * detail message.
jaroslav@49
    41
     */
jaroslav@49
    42
    public IllegalArgumentException() {
jaroslav@49
    43
        super();
jaroslav@49
    44
    }
jaroslav@49
    45
jaroslav@49
    46
    /**
jaroslav@49
    47
     * Constructs an <code>IllegalArgumentException</code> with the
jaroslav@49
    48
     * specified detail message.
jaroslav@49
    49
     *
jaroslav@49
    50
     * @param   s   the detail message.
jaroslav@49
    51
     */
jaroslav@49
    52
    public IllegalArgumentException(String s) {
jaroslav@49
    53
        super(s);
jaroslav@49
    54
    }
jaroslav@49
    55
jaroslav@49
    56
    /**
jaroslav@49
    57
     * Constructs a new exception with the specified detail message and
jaroslav@49
    58
     * cause.
jaroslav@49
    59
     *
jaroslav@49
    60
     * <p>Note that the detail message associated with <code>cause</code> is
jaroslav@49
    61
     * <i>not</i> automatically incorporated in this exception's detail
jaroslav@49
    62
     * message.
jaroslav@49
    63
     *
jaroslav@49
    64
     * @param  message the detail message (which is saved for later retrieval
jaroslav@49
    65
     *         by the {@link Throwable#getMessage()} method).
jaroslav@49
    66
     * @param  cause the cause (which is saved for later retrieval by the
jaroslav@49
    67
     *         {@link Throwable#getCause()} method).  (A <tt>null</tt> value
jaroslav@49
    68
     *         is permitted, and indicates that the cause is nonexistent or
jaroslav@49
    69
     *         unknown.)
jaroslav@49
    70
     * @since 1.5
jaroslav@49
    71
     */
jaroslav@49
    72
    public IllegalArgumentException(String message, Throwable cause) {
jaroslav@49
    73
        super(message, cause);
jaroslav@49
    74
    }
jaroslav@49
    75
jaroslav@49
    76
    /**
jaroslav@49
    77
     * Constructs a new exception with the specified cause and a detail
jaroslav@49
    78
     * message of <tt>(cause==null ? null : cause.toString())</tt> (which
jaroslav@49
    79
     * typically contains the class and detail message of <tt>cause</tt>).
jaroslav@49
    80
     * This constructor is useful for exceptions that are little more than
jaroslav@49
    81
     * wrappers for other throwables (for example, {@link
jaroslav@49
    82
     * java.security.PrivilegedActionException}).
jaroslav@49
    83
     *
jaroslav@49
    84
     * @param  cause the cause (which is saved for later retrieval by the
jaroslav@49
    85
     *         {@link Throwable#getCause()} method).  (A <tt>null</tt> value is
jaroslav@49
    86
     *         permitted, and indicates that the cause is nonexistent or
jaroslav@49
    87
     *         unknown.)
jaroslav@49
    88
     * @since  1.5
jaroslav@49
    89
     */
jaroslav@49
    90
    public IllegalArgumentException(Throwable cause) {
jaroslav@49
    91
        super(cause);
jaroslav@49
    92
    }
jaroslav@49
    93
jaroslav@49
    94
    private static final long serialVersionUID = -5365630128856068164L;
jaroslav@49
    95
}