ExceptionConstants.java

  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.  * Exception constants.
  20.  *
  21.  * @deprecated (since 6.0) DO NOT USE - use ExceptionConst instead
  22.  */
  23. @Deprecated
  24. public interface ExceptionConstants {

  25.     /**
  26.      * The mother of all exceptions
  27.      */
  28.     Class<Throwable> THROWABLE = Throwable.class;
  29.     /**
  30.      * Super class of any run-time exception
  31.      */
  32.     Class<RuntimeException> RUNTIME_EXCEPTION = RuntimeException.class;
  33.     /**
  34.      * Super class of any linking exception (aka Linkage Error)
  35.      */
  36.     Class<LinkageError> LINKING_EXCEPTION = LinkageError.class;
  37.     /**
  38.      * Linking Exceptions
  39.      */
  40.     Class<ClassCircularityError> CLASS_CIRCULARITY_ERROR = ClassCircularityError.class;
  41.     Class<ClassFormatError> CLASS_FORMAT_ERROR = ClassFormatError.class;
  42.     Class<ExceptionInInitializerError> EXCEPTION_IN_INITIALIZER_ERROR = ExceptionInInitializerError.class;
  43.     Class<IncompatibleClassChangeError> INCOMPATIBLE_CLASS_CHANGE_ERROR = IncompatibleClassChangeError.class;
  44.     Class<AbstractMethodError> ABSTRACT_METHOD_ERROR = AbstractMethodError.class;
  45.     Class<IllegalAccessError> ILLEGAL_ACCESS_ERROR = IllegalAccessError.class;
  46.     Class<InstantiationError> INSTANTIATION_ERROR = InstantiationError.class;
  47.     Class<NoSuchFieldError> NO_SUCH_FIELD_ERROR = NoSuchFieldError.class;
  48.     Class<NoSuchMethodError> NO_SUCH_METHOD_ERROR = NoSuchMethodError.class;
  49.     Class<NoClassDefFoundError> NO_CLASS_DEF_FOUND_ERROR = NoClassDefFoundError.class;
  50.     Class<UnsatisfiedLinkError> UNSATISFIED_LINK_ERROR = UnsatisfiedLinkError.class;
  51.     Class<VerifyError> VERIFY_ERROR = VerifyError.class;
  52.     /* UnsupportedClassVersionError is new in JDK 1.2 */
  53. //    Class UnsupportedClassVersionError = UnsupportedClassVersionError.class;
  54.     /**
  55.      * Run-Time Exceptions
  56.      */
  57.     Class<NullPointerException> NULL_POINTER_EXCEPTION = NullPointerException.class;
  58.     Class<ArrayIndexOutOfBoundsException> ARRAY_INDEX_OUT_OF_BOUNDS_EXCEPTION = ArrayIndexOutOfBoundsException.class;
  59.     Class<ArithmeticException> ARITHMETIC_EXCEPTION = ArithmeticException.class;
  60.     Class<NegativeArraySizeException> NEGATIVE_ARRAY_SIZE_EXCEPTION = NegativeArraySizeException.class;
  61.     Class<ClassCastException> CLASS_CAST_EXCEPTION = ClassCastException.class;
  62.     Class<IllegalMonitorStateException> ILLEGAL_MONITOR_STATE = IllegalMonitorStateException.class;

  63.     /**
  64.      * Pre-defined exception arrays according to chapters 5.1-5.4 of the Java Virtual Machine Specification
  65.      *
  66.      * @deprecated Do not use these arrays, use the static methods in the ExceptionConst implementation class instead
  67.      */
  68.     @Deprecated
  69.     Class<?>[] EXCS_CLASS_AND_INTERFACE_RESOLUTION = {NO_CLASS_DEF_FOUND_ERROR, CLASS_FORMAT_ERROR, VERIFY_ERROR, ABSTRACT_METHOD_ERROR,
  70.         EXCEPTION_IN_INITIALIZER_ERROR, ILLEGAL_ACCESS_ERROR}; // Chapter 5.1
  71.     @Deprecated
  72.     Class<?>[] EXCS_FIELD_AND_METHOD_RESOLUTION = {NO_SUCH_FIELD_ERROR, ILLEGAL_ACCESS_ERROR, NO_SUCH_METHOD_ERROR}; // Chapter 5.2

  73.     /**
  74.      * Empty array.
  75.      */
  76.     @Deprecated
  77.     Class<?>[] EXCS_INTERFACE_METHOD_RESOLUTION = new Class[0]; // Chapter 5.3 (as below)

  78.     /**
  79.      * Empty array.
  80.      */
  81.     @Deprecated
  82.     Class<?>[] EXCS_STRING_RESOLUTION = new Class[0];
  83.     // Chapter 5.4 (no errors but the ones that _always_ could happen! How stupid.)
  84.     @Deprecated
  85.     Class<?>[] EXCS_ARRAY_EXCEPTION = {NULL_POINTER_EXCEPTION, ARRAY_INDEX_OUT_OF_BOUNDS_EXCEPTION};

  86. }