ClassFileElement, CodeElement, PseudoInstructionpublic sealed interface ExceptionCatch extends PseudoInstruction
exception_table array of a Code attribute. Catch (JVMS 3.12) and finally (JVMS 3.14) blocks in Java source code compile to exception table entries. Delivered as a CodeElement when traversing the contents of a CodeModel. An exception table entry is composite:
ExceptionCatch(
Label handler,
Label tryStart,
Label tryEnd,
Optional<ClassEntry> catchType
)
Code Attribute| Modifier and Type | Method | Description |
|---|---|---|
Optional |
catchType() |
Returns the type of the exception to catch, or empty if this handler catches everything. |
Label |
handler() |
Returns the handler for the exception. |
static ExceptionCatch |
of |
Returns an exception table pseudo-instruction to catch everything. |
static ExceptionCatch |
of |
Returns an exception table pseudo-instruction. |
Label |
tryEnd() |
Returns the end of the instruction range for the guarded instructions. |
Label |
tryStart() |
Returns the beginning of the instruction range for the guarded instructions. |
Label handler()
Label tryStart()
Label tryEnd()
Optional<ClassEntry> catchType()
static ExceptionCatch of(Label handler, Label tryStart, Label tryEnd, Optional<ClassEntry> catchTypeEntry)
handler - the handler for the exceptiontryStart - the beginning of the instruction range for the guarded instructionstryEnd - the end of the instruction range for the guarded instructionscatchTypeEntry - the type of exception to catch, or empty if this handler is unconditionalstatic ExceptionCatch of(Label handler, Label tryStart, Label tryEnd)
handler - the handler for the exceptiontryStart - the beginning of the instruction range for the guarded instructionstryEnd - the end of the instruction range for the guarded instructions
© 1993, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/classfile/instruction/ExceptionCatch.html