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

j.l.c.MethodTypeDesc::ofConstructor spec should contain precise assertions for its parameters

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Approved
    • Fix Version/s: 13
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      the NPE exception was already being thrown, but it wasn't properly documented in the spec
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

      Method java.lang.constant.MethodTypeDesc::ofConstructor should have precise assertions for the cases for which a NullPointerException can be thrown

      Problem

      Method java.lang.constant.MethodTypeDesc::ofConstructor doesn't have precise assertions for the cases for which a NullPointerException can be thrown.

      Solution

      Update the specification to indicate in a precise way when a NPE can be thrown

      Specification

      diff -r b99e97bc5040 -r 95a9343e7881 src/java.base/share/classes/java/lang/constant/MethodHandleDesc.java
      --- a/src/java.base/share/classes/java/lang/constant/MethodHandleDesc.java      Wed May 15 08:58:23 2019 -0400
      +++ b/src/java.base/share/classes/java/lang/constant/MethodHandleDesc.java      Thu May 16 12:50:11 2019 -0400
      @@ -177,7 +177,7 @@
            * @param paramTypes {@link ClassDesc}s describing the parameter types of
            *                   the constructor
            * @return the {@linkplain MethodHandleDesc}
      -     * @throws NullPointerException if any of the arguments are null
      +     * @throws NullPointerException if any argument or its contents is {@code null}
            */
           static DirectMethodHandleDesc ofConstructor(ClassDesc owner,
                                                       ClassDesc... paramTypes) {

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              vromero Vicente Arturo Romero Zaldivar
              Reporter:
              lkuskov Leonid Kuskov
              Reviewed By:
              Joe Darcy
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: