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

j.l.c.ClassDesc::nested(String, String...) must throw NPE if any arg is null

    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:
      The java.lang.constant API is very recent, introduced in JDK12, so we don't expect that there is a lot of user code depending on it
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

      The API for method: j.l.c.ClassDesc::nested(String, String...) states that it will throw an exception if any argument is null and the implementation must enforce this assertion

      Problem

      The API for method: j.l.c.ClassDesc::nested(String, String...) states that it will throw an exception if any argument is null. The implementation is not enforcing this assertion

      Solution

      Throw a NullPointerException if any argument passed to the method is null.

      Specification

            /**
             * Returns a {@linkplain ClassDesc} for a nested class of the class or
             * interface type described by this {@linkplain ClassDesc}.
             *
             * @param firstNestedName the unqualified name of the first level of nested class
             * @param moreNestedNames the unqualified name(s) of the remaining levels of
             *                       nested class
             * @return a {@linkplain ClassDesc} describing the nested class
       -     * @throws NullPointerException if any argument is {@code null}
       +     * @throws NullPointerException if any argument or its contents is {@code null}
             * @throws IllegalStateException if this {@linkplain ClassDesc} does not
             * describe a class or interface type
             * @throws IllegalArgumentException if the nested class name is invalid
             */

        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:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: