View Javadoc
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       * Super class of any run-time exception
35       */
36      Class<RuntimeException> RUNTIME_EXCEPTION = RuntimeException.class;
37      /**
38       * Super class of any linking exception (aka Linkage Error)
39       */
40      Class<LinkageError> LINKING_EXCEPTION = LinkageError.class;
41      /**
42       * Linking Exceptions
43       */
44      Class<ClassCircularityError> CLASS_CIRCULARITY_ERROR = ClassCircularityError.class;
45      Class<ClassFormatError> CLASS_FORMAT_ERROR = ClassFormatError.class;
46      Class<ExceptionInInitializerError> EXCEPTION_IN_INITIALIZER_ERROR = ExceptionInInitializerError.class;
47      Class<IncompatibleClassChangeError> INCOMPATIBLE_CLASS_CHANGE_ERROR = IncompatibleClassChangeError.class;
48      Class<AbstractMethodError> ABSTRACT_METHOD_ERROR = AbstractMethodError.class;
49      Class<IllegalAccessError> ILLEGAL_ACCESS_ERROR = IllegalAccessError.class;
50      Class<InstantiationError> INSTANTIATION_ERROR = InstantiationError.class;
51      Class<NoSuchFieldError> NO_SUCH_FIELD_ERROR = NoSuchFieldError.class;
52      Class<NoSuchMethodError> NO_SUCH_METHOD_ERROR = NoSuchMethodError.class;
53      Class<NoClassDefFoundError> NO_CLASS_DEF_FOUND_ERROR = NoClassDefFoundError.class;
54      Class<UnsatisfiedLinkError> UNSATISFIED_LINK_ERROR = UnsatisfiedLinkError.class;
55      Class<VerifyError> VERIFY_ERROR = VerifyError.class;
56      /* UnsupportedClassVersionError is new in JDK 1.2 */
57  //    Class UnsupportedClassVersionError = UnsupportedClassVersionError.class;
58      /**
59       * Run-Time Exceptions
60       */
61      Class<NullPointerException> NULL_POINTER_EXCEPTION = NullPointerException.class;
62      Class<ArrayIndexOutOfBoundsException> ARRAY_INDEX_OUT_OF_BOUNDS_EXCEPTION = ArrayIndexOutOfBoundsException.class;
63      Class<ArithmeticException> ARITHMETIC_EXCEPTION = ArithmeticException.class;
64      Class<NegativeArraySizeException> NEGATIVE_ARRAY_SIZE_EXCEPTION = NegativeArraySizeException.class;
65      Class<ClassCastException> CLASS_CAST_EXCEPTION = ClassCastException.class;
66      Class<IllegalMonitorStateException> ILLEGAL_MONITOR_STATE = IllegalMonitorStateException.class;
67  
68      /**
69       * Pre-defined exception arrays according to chapters 5.1-5.4 of the Java Virtual Machine Specification
70       *
71       * @deprecated Do not use these arrays, use the static methods in the ExceptionConst implementation class instead
72       */
73      @Deprecated
74      Class<?>[] EXCS_CLASS_AND_INTERFACE_RESOLUTION = {NO_CLASS_DEF_FOUND_ERROR, CLASS_FORMAT_ERROR, VERIFY_ERROR, ABSTRACT_METHOD_ERROR,
75          EXCEPTION_IN_INITIALIZER_ERROR, ILLEGAL_ACCESS_ERROR}; // Chapter 5.1
76      @Deprecated
77      Class<?>[] EXCS_FIELD_AND_METHOD_RESOLUTION = {NO_SUCH_FIELD_ERROR, ILLEGAL_ACCESS_ERROR, NO_SUCH_METHOD_ERROR}; // Chapter 5.2
78  
79      /**
80       * Empty array.
81       */
82      @Deprecated
83      Class<?>[] EXCS_INTERFACE_METHOD_RESOLUTION = new Class[0]; // Chapter 5.3 (as below)
84  
85      /**
86       * Empty array.
87       */
88      @Deprecated
89      Class<?>[] EXCS_STRING_RESOLUTION = new Class[0];
90      // Chapter 5.4 (no errors but the ones that _always_ could happen! How stupid.)
91      @Deprecated
92      Class<?>[] EXCS_ARRAY_EXCEPTION = {NULL_POINTER_EXCEPTION, ARRAY_INDEX_OUT_OF_BOUNDS_EXCEPTION};
93  
94  }