src/java.base/share/classes/java/lang/ReflectiveOperationException.java
author rriggs
Wed, 28 Nov 2018 15:53:49 -0500
changeset 52724 0bdbf854472f
parent 47216 71c04702a3d5
child 57956 e0b8b019d2f5
permissions -rw-r--r--
4947890: Minimize JNI upcalls in system-properties initialization Reviewed-by: erikj, mchung, bchristi, ihse, coleenp, stuefe
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3311
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3311
diff changeset
     2
 * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
3311
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
     4
 *
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3311
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
3311
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3311
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
3311
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    10
 *
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    15
 * accompanied this code).
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    16
 *
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3311
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3311
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3311
diff changeset
    23
 * questions.
3311
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    24
 */
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    25
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    26
package java.lang;
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    27
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    28
/**
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    29
 * Common superclass of exceptions thrown by reflective operations in
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    30
 * core reflection.
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    31
 *
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    32
 * @see LinkageError
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    33
 * @since 1.7
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    34
 */
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    35
public class ReflectiveOperationException extends Exception {
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    36
    static final long serialVersionUID = 123456789L;
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    37
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    38
    /**
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    39
     * Constructs a new exception with {@code null} as its detail
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    40
     * message.  The cause is not initialized, and may subsequently be
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    41
     * initialized by a call to {@link #initCause}.
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    42
     */
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    43
    public ReflectiveOperationException() {
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    44
        super();
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    45
    }
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    46
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    47
    /**
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    48
     * Constructs a new exception with the specified detail message.
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    49
     * The cause is not initialized, and may subsequently be
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    50
     * initialized by a call to {@link #initCause}.
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    51
     *
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    52
     * @param   message   the detail message. The detail message is saved for
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    53
     *          later retrieval by the {@link #getMessage()} method.
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    54
     */
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    55
    public ReflectiveOperationException(String message) {
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    56
        super(message);
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    57
    }
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    58
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    59
    /**
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    60
     * Constructs a new exception with the specified detail message
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    61
     * and cause.
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    62
     *
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    63
     * <p>Note that the detail message associated with
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    64
     * {@code cause} is <em>not</em> automatically incorporated in
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    65
     * this exception's detail message.
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    66
     *
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    67
     * @param  message the detail message (which is saved for later retrieval
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    68
     *         by the {@link #getMessage()} method).
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    69
     * @param  cause the cause (which is saved for later retrieval by the
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    70
     *         {@link #getCause()} method).  (A {@code null} value is
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    71
     *         permitted, and indicates that the cause is nonexistent or
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    72
     *         unknown.)
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    73
     */
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    74
    public ReflectiveOperationException(String message, Throwable cause) {
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    75
        super(message, cause);
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    76
    }
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    77
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    78
    /**
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    79
     * Constructs a new exception with the specified cause and a detail
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    80
     * message of {@code (cause==null ? null : cause.toString())} (which
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    81
     * typically contains the class and detail message of {@code cause}).
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    82
     *
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    83
     * @param  cause the cause (which is saved for later retrieval by the
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    84
     *         {@link #getCause()} method).  (A {@code null} value is
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    85
     *         permitted, and indicates that the cause is nonexistent or
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    86
     *         unknown.)
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    87
     */
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    88
    public ReflectiveOperationException(Throwable cause) {
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    89
        super(cause);
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    90
    }
a219a6c036a6 6857789: (reflect) Create common superclass of reflective exceptions
darcy
parents:
diff changeset
    91
}