Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8294883

The `Throwable` assignability check in `MethodHandles.tryFinallyChecks` is wrong

    XMLWordPrintable

Details

    Description

      A DESCRIPTION OF THE PROBLEM :
      Currently, `MethodHandles.tryFinallyChecks(…)` allows a cleanup handle with a signature such as `(Error, V, A...)V`, even though the invocation of which will cause a `ClassCastException` at runtime if the `target` throws anything that is not a subclass of `Error`.

      At the same time, a cleanup handle with the signatures `(Object, V, A...)V` or `(Serializable, V, A...)V` is perfectly valid, but `MethodHandles.tryFinallyChecks(…)` rejects it, as `Object` or `Serializable` are not subtypes of `Throwable`.

      See also:
      - JDK-8034820
      - JDK-8254717
      - JDK-8279800
      - JDK-8284939


      FREQUENCY : always


      Attachments

        Activity

          People

            mchung Mandy Chung
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: