Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/jcl/src/java.base/share/classes/java/lang/InstantiationError.java
12513 views
1
/*[INCLUDE-IF Sidecar16]*/
2
3
package java.lang;
4
5
/*******************************************************************************
6
* Copyright (c) 1998, 2019 IBM Corp. and others
7
*
8
* This program and the accompanying materials are made available under
9
* the terms of the Eclipse Public License 2.0 which accompanies this
10
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
11
* or the Apache License, Version 2.0 which accompanies this distribution and
12
* is available at https://www.apache.org/licenses/LICENSE-2.0.
13
*
14
* This Source Code may also be made available under the following
15
* Secondary Licenses when the conditions for such availability set
16
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
17
* General Public License, version 2 with the GNU Classpath
18
* Exception [1] and GNU General Public License, version 2 with the
19
* OpenJDK Assembly Exception [2].
20
*
21
* [1] https://www.gnu.org/software/classpath/license.html
22
* [2] http://openjdk.java.net/legal/assembly-exception.html
23
*
24
* 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-exception
25
*******************************************************************************/
26
27
/**
28
* This error is thrown when the VM notices that a
29
* an attempt is being made to create a new instance
30
* of a class which has no visible constructors from
31
* the location where new is invoked.
32
* <p>
33
* Note that this can only occur when inconsistent
34
* class files are being loaded.
35
*
36
* @author OTI
37
* @version initial
38
*/
39
public class InstantiationError extends IncompatibleClassChangeError {
40
private static final long serialVersionUID = -4885810657349421204L;
41
42
/**
43
* Constructs a new instance of this class with its
44
* walkback filled in.
45
*
46
* @author OTI
47
* @version initial
48
*/
49
public InstantiationError () {
50
super();
51
}
52
53
/**
54
* Constructs a new instance of this class with its
55
* walkback and message filled in.
56
*
57
* @author OTI
58
* @version initial
59
*
60
* @param detailMessage String
61
* The detail message for the exception.
62
*/
63
public InstantiationError (String detailMessage) {
64
super(detailMessage);
65
}
66
67
/**
68
* Constructs a new instance of this class with its
69
* walkback and message filled in.
70
*
71
* @author OTI
72
* @version initial
73
*
74
* @param clazz Class
75
* The class which cannot be instantiated.
76
*/
77
InstantiationError (Class clazz) {
78
super(clazz.getName());
79
}
80
81
}
82
83