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

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

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • 13
    • core-libs
    • None
    • behavioral
    • minimal
    • Document existing behavior.
    • Java API
    • SE

      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

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

              Created:
              Updated:
              Resolved: