rt/emul/compact/src/main/java/java/lang/BootstrapMethodError.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Sun, 10 Aug 2014 05:55:55 +0200
branchjdk8-b132
changeset 1649 98bdfed1a6e9
permissions -rw-r--r--
New exceptions as of JDK8-b132 needed for invoke dynamic
jaroslav@1649
     1
/*
jaroslav@1649
     2
 * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
jaroslav@1649
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
jaroslav@1649
     4
 *
jaroslav@1649
     5
 * This code is free software; you can redistribute it and/or modify it
jaroslav@1649
     6
 * under the terms of the GNU General Public License version 2 only, as
jaroslav@1649
     7
 * published by the Free Software Foundation.  Oracle designates this
jaroslav@1649
     8
 * particular file as subject to the "Classpath" exception as provided
jaroslav@1649
     9
 * by Oracle in the LICENSE file that accompanied this code.
jaroslav@1649
    10
 *
jaroslav@1649
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
jaroslav@1649
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
jaroslav@1649
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
jaroslav@1649
    14
 * version 2 for more details (a copy is included in the LICENSE file that
jaroslav@1649
    15
 * accompanied this code).
jaroslav@1649
    16
 *
jaroslav@1649
    17
 * You should have received a copy of the GNU General Public License version
jaroslav@1649
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
jaroslav@1649
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
jaroslav@1649
    20
 *
jaroslav@1649
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
jaroslav@1649
    22
 * or visit www.oracle.com if you need additional information or have any
jaroslav@1649
    23
 * questions.
jaroslav@1649
    24
 */
jaroslav@1649
    25
jaroslav@1649
    26
package java.lang;
jaroslav@1649
    27
jaroslav@1649
    28
/**
jaroslav@1649
    29
 * Thrown to indicate that an {@code invokedynamic} instruction has
jaroslav@1649
    30
 * failed to find its bootstrap method,
jaroslav@1649
    31
 * or the bootstrap method has failed to provide a
jaroslav@1649
    32
 * {@linkplain java.lang.invoke.CallSite call site} with a {@linkplain java.lang.invoke.CallSite#getTarget target}
jaroslav@1649
    33
 * of the correct {@linkplain java.lang.invoke.MethodHandle#type method type}.
jaroslav@1649
    34
 *
jaroslav@1649
    35
 * @author John Rose, JSR 292 EG
jaroslav@1649
    36
 * @since 1.7
jaroslav@1649
    37
 */
jaroslav@1649
    38
public class BootstrapMethodError extends LinkageError {
jaroslav@1649
    39
    private static final long serialVersionUID = 292L;
jaroslav@1649
    40
jaroslav@1649
    41
    /**
jaroslav@1649
    42
     * Constructs a {@code BootstrapMethodError} with no detail message.
jaroslav@1649
    43
     */
jaroslav@1649
    44
    public BootstrapMethodError() {
jaroslav@1649
    45
        super();
jaroslav@1649
    46
    }
jaroslav@1649
    47
jaroslav@1649
    48
    /**
jaroslav@1649
    49
     * Constructs a {@code BootstrapMethodError} with the specified
jaroslav@1649
    50
     * detail message.
jaroslav@1649
    51
     *
jaroslav@1649
    52
     * @param s the detail message.
jaroslav@1649
    53
     */
jaroslav@1649
    54
    public BootstrapMethodError(String s) {
jaroslav@1649
    55
        super(s);
jaroslav@1649
    56
    }
jaroslav@1649
    57
jaroslav@1649
    58
    /**
jaroslav@1649
    59
     * Constructs a {@code BootstrapMethodError} with the specified
jaroslav@1649
    60
     * detail message and cause.
jaroslav@1649
    61
     *
jaroslav@1649
    62
     * @param s the detail message.
jaroslav@1649
    63
     * @param cause the cause, may be {@code null}.
jaroslav@1649
    64
     */
jaroslav@1649
    65
    public BootstrapMethodError(String s, Throwable cause) {
jaroslav@1649
    66
        super(s, cause);
jaroslav@1649
    67
    }
jaroslav@1649
    68
jaroslav@1649
    69
    /**
jaroslav@1649
    70
     * Constructs a {@code BootstrapMethodError} with the specified
jaroslav@1649
    71
     * cause.
jaroslav@1649
    72
     *
jaroslav@1649
    73
     * @param cause the cause, may be {@code null}.
jaroslav@1649
    74
     */
jaroslav@1649
    75
    public BootstrapMethodError(Throwable cause) {
jaroslav@1649
    76
        // cf. Throwable(Throwable cause) constructor.
jaroslav@1649
    77
        super(cause == null ? null : cause.toString());
jaroslav@1649
    78
        initCause(cause);
jaroslav@1649
    79
    }
jaroslav@1649
    80
}