Path: blob/master/jcl/src/java.base/share/classes/java/lang/InstantiationError.java
12513 views
/*[INCLUDE-IF Sidecar16]*/12package java.lang;34/*******************************************************************************5* Copyright (c) 1998, 2019 IBM Corp. and others6*7* This program and the accompanying materials are made available under8* the terms of the Eclipse Public License 2.0 which accompanies this9* distribution and is available at https://www.eclipse.org/legal/epl-2.0/10* or the Apache License, Version 2.0 which accompanies this distribution and11* is available at https://www.apache.org/licenses/LICENSE-2.0.12*13* This Source Code may also be made available under the following14* Secondary Licenses when the conditions for such availability set15* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU16* General Public License, version 2 with the GNU Classpath17* Exception [1] and GNU General Public License, version 2 with the18* OpenJDK Assembly Exception [2].19*20* [1] https://www.gnu.org/software/classpath/license.html21* [2] http://openjdk.java.net/legal/assembly-exception.html22*23* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception24*******************************************************************************/2526/**27* This error is thrown when the VM notices that a28* an attempt is being made to create a new instance29* of a class which has no visible constructors from30* the location where new is invoked.31* <p>32* Note that this can only occur when inconsistent33* class files are being loaded.34*35* @author OTI36* @version initial37*/38public class InstantiationError extends IncompatibleClassChangeError {39private static final long serialVersionUID = -4885810657349421204L;4041/**42* Constructs a new instance of this class with its43* walkback filled in.44*45* @author OTI46* @version initial47*/48public InstantiationError () {49super();50}5152/**53* Constructs a new instance of this class with its54* walkback and message filled in.55*56* @author OTI57* @version initial58*59* @param detailMessage String60* The detail message for the exception.61*/62public InstantiationError (String detailMessage) {63super(detailMessage);64}6566/**67* Constructs a new instance of this class with its68* walkback and message filled in.69*70* @author OTI71* @version initial72*73* @param clazz Class74* The class which cannot be instantiated.75*/76InstantiationError (Class clazz) {77super(clazz.getName());78}7980}818283