JDK-8168606 : Release Note: invokedynamic implementation should not wrap Errors
  • Type: Sub-task
  • Component: core-libs
  • Sub-Component: java.lang.invoke
  • Affected Version: 9
  • Priority: P4
  • Status: Closed
  • Resolution: Delivered
  • Submitted: 2016-10-24
  • Updated: 2017-09-22
  • Resolved: 2016-12-06
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9Resolved
Description
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).