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