Path: blob/master/src/java.base/share/classes/java/lang/BootstrapMethodError.java
41152 views
/*1* Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package java.lang;2627/**28* Thrown to indicate that an {@code invokedynamic} instruction or a dynamic29* constant failed to resolve its bootstrap method and arguments,30* or for {@code invokedynamic} instruction the bootstrap method has failed to31* provide a32* {@linkplain java.lang.invoke.CallSite call site} with a33* {@linkplain java.lang.invoke.CallSite#getTarget target}34* of the correct {@linkplain java.lang.invoke.MethodHandle#type() method type},35* or for a dynamic constant the bootstrap method has failed to provide a36* constant value of the required type.37*38* @author John Rose, JSR 292 EG39* @since 1.740*/41public class BootstrapMethodError extends LinkageError {42@java.io.Serial43private static final long serialVersionUID = 292L;4445/**46* Constructs a {@code BootstrapMethodError} with no detail message.47*/48public BootstrapMethodError() {49super();50}5152/**53* Constructs a {@code BootstrapMethodError} with the specified54* detail message.55*56* @param s the detail message.57*/58public BootstrapMethodError(String s) {59super(s);60}6162/**63* Constructs a {@code BootstrapMethodError} with the specified64* detail message and cause.65*66* @param s the detail message.67* @param cause the cause, may be {@code null}.68*/69public BootstrapMethodError(String s, Throwable cause) {70super(s, cause);71}7273/**74* Constructs a {@code BootstrapMethodError} with the specified75* cause.76*77* @param cause the cause, may be {@code null}.78*/79public BootstrapMethodError(Throwable cause) {80// cf. Throwable(Throwable cause) constructor.81super(cause == null ? null : cause.toString());82initCause(cause);83}84}858687