src/java.base/share/classes/java/lang/IllegalCallerException.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:
43712
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
     1
/*
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
     2
 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
     4
 *
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    10
 *
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    15
 * accompanied this code).
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    16
 *
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    20
 *
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    23
 * questions.
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    24
 */
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    25
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    26
package java.lang;
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    27
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    28
/**
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    29
 * Thrown to indicate that a method has been called by an inappropriate caller.
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    30
 *
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    31
 * @since 9
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    32
 * @spec JPMS
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    33
 * @see StackWalker#getCallerClass
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    34
 */
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    35
public class IllegalCallerException extends RuntimeException {
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    36
    /**
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    37
     * Constructs an IllegalCallerException with no detail message.
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    38
     */
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    39
    public IllegalCallerException() {
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    40
        super();
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    41
    }
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    42
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    43
    /**
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    44
     * Constructs an IllegalCallerException with the specified detail
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    45
     * message.
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    46
     *
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    47
     * @param s the String that contains a detailed message (can be null)
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    48
     */
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    49
    public IllegalCallerException(String s) {
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    50
        super(s);
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    51
    }
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    52
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    53
    /**
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    54
     * Constructs a new exception with the specified detail message and
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    55
     * cause.
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    56
     *
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    57
     * @param  message the detail message (can be null)
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    58
     * @param  cause the cause (can be null)
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    59
     */
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    60
    public IllegalCallerException(String message, Throwable cause) {
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    61
        super(message, cause);
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    62
    }
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    63
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    64
    /**
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    65
     * Constructs a new exception with the specified cause and a detail
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    66
     * message of {@code (cause==null ? null : cause.toString())} (which
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    67
     * typically contains the class and detail message of {@code cause}).
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    68
     *
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    69
     * @param  cause the cause (can be null)
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    70
     */
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    71
    public IllegalCallerException(Throwable cause) {
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    72
        super(cause);
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    73
    }
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    74
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    75
    static final long serialVersionUID = -2349421918363102232L;
5dfd0950317c 8173393: Module system implementation refresh (2/2017)
alanb
parents:
diff changeset
    76
}