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

j.l.c.MethodHandleDesc::of throws undocumented exception IllegalArgumentException

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P3
    • Resolution: Approved
    • Fix Version/s: 13
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      Document existing behavior.
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

      Method j.l.c.MethodHandleDesc::of throws an exception in a case not documented by its specification.

      Problem

      Method java.lang.constant.MethodHandleDesc::of throws an undocumented exception, IllegalArgumentException.

      Solution

      Add the missing exception to the specification.

      Specification

      diff -r 657f6e484bc6 -r f849dfd818a1 src/java.base/share/classes/java/lang/constant/MethodHandleDesc.java
      --- a/src/java.base/share/classes/java/lang/constant/MethodHandleDesc.java      Fri May 17 13:16:07 2019 -0400
      +++ b/src/java.base/share/classes/java/lang/constant/MethodHandleDesc.java      Fri May 17 15:51:20 2019 -0400
      @@ -70,6 +70,8 @@
            *                         for a field or constructor
            * @return the {@linkplain MethodHandleDesc}
            * @throws NullPointerException if any of the non-ignored arguments are null
      +     * @throws IllegalArgumentException if the descriptor string is not a valid
      +     * method or field descriptor
            * @jvms 4.4.8 The CONSTANT_MethodHandle_info Structure
            * @jvms 4.2.2 Unqualified Names
            * @jvms 4.3.2 Field Descriptors

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              vromero Vicente Arturo Romero Zaldivar
              Reporter:
              lkuskov Leonid Kuskov
              Reviewed By:
              Roger Riggs
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: