1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * https://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19 package org.apache.bcel;
20
21 /**
22 * Exception constants.
23 *
24 * @deprecated (since 6.0) DO NOT USE - use ExceptionConst instead
25 */
26 @Deprecated
27 public interface ExceptionConstants {
28
29 /**
30 * The mother of all exceptions
31 */
32 Class<Throwable> THROWABLE = Throwable.class;
33
34 /**
35 * Super class of any run-time exception
36 */
37 Class<RuntimeException> RUNTIME_EXCEPTION = RuntimeException.class;
38
39 /**
40 * Super class of any linking exception (aka Linkage Error)
41 */
42 Class<LinkageError> LINKING_EXCEPTION = LinkageError.class;
43
44 /**
45 * Linking Exceptions.
46 */
47
48 /** Exception class: ClassCircularityError. */
49 Class<ClassCircularityError> CLASS_CIRCULARITY_ERROR = ClassCircularityError.class;
50
51 /** Exception class: ClassFormatError. */
52 Class<ClassFormatError> CLASS_FORMAT_ERROR = ClassFormatError.class;
53
54 /** Exception class: ExceptionInInitializerError. */
55 Class<ExceptionInInitializerError> EXCEPTION_IN_INITIALIZER_ERROR = ExceptionInInitializerError.class;
56
57 /** Exception class: IncompatibleClassChangeError. */
58 Class<IncompatibleClassChangeError> INCOMPATIBLE_CLASS_CHANGE_ERROR = IncompatibleClassChangeError.class;
59
60 /** Exception class: AbstractMethodError. */
61 Class<AbstractMethodError> ABSTRACT_METHOD_ERROR = AbstractMethodError.class;
62
63 /** Exception class: IllegalAccessError. */
64 Class<IllegalAccessError> ILLEGAL_ACCESS_ERROR = IllegalAccessError.class;
65
66 /** Exception class: InstantiationError. */
67 Class<InstantiationError> INSTANTIATION_ERROR = InstantiationError.class;
68
69 /** Exception class: NoSuchFieldError. */
70 Class<NoSuchFieldError> NO_SUCH_FIELD_ERROR = NoSuchFieldError.class;
71
72 /** Exception class: NoSuchMethodError. */
73 Class<NoSuchMethodError> NO_SUCH_METHOD_ERROR = NoSuchMethodError.class;
74
75 /** Exception class: NoClassDefFoundError. */
76 Class<NoClassDefFoundError> NO_CLASS_DEF_FOUND_ERROR = NoClassDefFoundError.class;
77
78 /** Exception class: UnsatisfiedLinkError. */
79 Class<UnsatisfiedLinkError> UNSATISFIED_LINK_ERROR = UnsatisfiedLinkError.class;
80
81 /** Exception class: VerifyError. */
82 Class<VerifyError> VERIFY_ERROR = VerifyError.class;
83 /* UnsupportedClassVersionError is new in JDK 1.2 */
84 // Class UnsupportedClassVersionError = UnsupportedClassVersionError.class;
85
86 /**
87 * Run-Time Exceptions.
88 */
89
90 /** Exception class: NullPointerException. */
91 Class<NullPointerException> NULL_POINTER_EXCEPTION = NullPointerException.class;
92
93 /** Exception class: ArrayIndexOutOfBoundsException. */
94 Class<ArrayIndexOutOfBoundsException> ARRAY_INDEX_OUT_OF_BOUNDS_EXCEPTION = ArrayIndexOutOfBoundsException.class;
95
96 /** Exception class: ArithmeticException. */
97 Class<ArithmeticException> ARITHMETIC_EXCEPTION = ArithmeticException.class;
98
99 /** Exception class: NegativeArraySizeException. */
100 Class<NegativeArraySizeException> NEGATIVE_ARRAY_SIZE_EXCEPTION = NegativeArraySizeException.class;
101
102 /** Exception class: ClassCastException. */
103 Class<ClassCastException> CLASS_CAST_EXCEPTION = ClassCastException.class;
104
105 /** Exception class: IllegalMonitorStateException. */
106 Class<IllegalMonitorStateException> ILLEGAL_MONITOR_STATE = IllegalMonitorStateException.class;
107
108 /**
109 * Pre-defined exception arrays according to chapters 5.1-5.4 of the Java Virtual Machine Specification.
110 *
111 * @deprecated Do not use these arrays, use the static methods in the ExceptionConst implementation class instead.
112 */
113 @Deprecated
114 Class<?>[] EXCS_CLASS_AND_INTERFACE_RESOLUTION = {NO_CLASS_DEF_FOUND_ERROR, CLASS_FORMAT_ERROR, VERIFY_ERROR, ABSTRACT_METHOD_ERROR,
115 EXCEPTION_IN_INITIALIZER_ERROR, ILLEGAL_ACCESS_ERROR}; // Chapter 5.1
116
117 /** Exception array for field and method resolution. @deprecated Do not use. */
118 @Deprecated
119 Class<?>[] EXCS_FIELD_AND_METHOD_RESOLUTION = {NO_SUCH_FIELD_ERROR, ILLEGAL_ACCESS_ERROR, NO_SUCH_METHOD_ERROR}; // Chapter 5.2
120
121 /**
122 * Empty array.
123 */
124 @Deprecated
125 Class<?>[] EXCS_INTERFACE_METHOD_RESOLUTION = new Class[0]; // Chapter 5.3 (as below)
126
127 /**
128 * Empty array.
129 */
130 @Deprecated
131 Class<?>[] EXCS_STRING_RESOLUTION = new Class[0];
132
133 /** Exception array. @deprecated Do not use. */
134 @Deprecated
135 Class<?>[] EXCS_ARRAY_EXCEPTION = {NULL_POINTER_EXCEPTION, ARRAY_INDEX_OUT_OF_BOUNDS_EXCEPTION};
136
137 }