-
Type:
Sub-task
-
Resolution: Delivered
-
Priority:
P4
-
Affects Version/s: 9
-
Component/s: core-libs
-
Verified
The `invokedynamic` byte code instruction is no longer specified by the Java Virtual Machine Specification to wrap any `Throwable` thrown during linking in `java.lang.invoke.BootstrapMethodError`, which is then thrown to the caller.
If during linking an instance of `Error`, or a subclass of, is thrown then that `Error` is no longer wrapped and is thrown directly to the caller. Any other instance of `Throwable`, or subclass of, is still wrapped in `java.lang.invoke.BootstrapMethodError`.
This change in behaviour ensures that errors such as `OutOfMemoryError` or `ThreadDeath` are thrown unwrapped and may be acted on or reported directly, thereby enabling more uniform replacement of byte code with an `invokedynamic` instruction whose call site performs the same functionality as the replaced byte code (and may throw the same errors).
If during linking an instance of `Error`, or a subclass of, is thrown then that `Error` is no longer wrapped and is thrown directly to the caller. Any other instance of `Throwable`, or subclass of, is still wrapped in `java.lang.invoke.BootstrapMethodError`.
This change in behaviour ensures that errors such as `OutOfMemoryError` or `ThreadDeath` are thrown unwrapped and may be acted on or reported directly, thereby enabling more uniform replacement of byte code with an `invokedynamic` instruction whose call site performs the same functionality as the replaced byte code (and may throw the same errors).