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

j.l.c.ClassDesc::arrayType(int rank) throws IllegalArgumentException if rank = 0

    XMLWordPrintable

    Details

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

      Description

      Summary

      The API for method java.lang.constant.ClassDesc::arrayType(int) is not in sync with its implementation. The spec should be modified to match the method's implementation.

      Problem

      The API for method java.lang.constant.ClassDesc::arrayType(int) is not in sync with its implementation

      Solution

      Update the spec of java.lang.constant.ClassDesc::arrayType(int) to throw IAE if rank <= 0

      Specification

      diff -r 748932cafa41 -r d617bc0baefa src/java.base/share/classes/java/lang/constant/ClassDesc.java
      --- a/src/java.base/share/classes/java/lang/constant/ClassDesc.java     Wed Feb 20 16:20:53 2019 -0500
      +++ b/src/java.base/share/classes/java/lang/constant/ClassDesc.java     Wed Feb 20 17:59:47 2019 -0500
      @@ -170,7 +170,7 @@
            *
            * @param rank the rank of the array
            * @return a {@linkplain ClassDesc} describing the array type
      -     * @throws IllegalArgumentException if the rank is less than zero or if the rank of the resulting array type is
      +     * @throws IllegalArgumentException if the rank is less than or equal to zero or if the rank of the resulting array type is
            * greater than 255
            * @jvms 4.4.1 The CONSTANT_Class_info Structure
            */

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              vromero Vicente Arturo Romero Zaldivar
              Reporter:
              lkuskov Leonid Kuskov
              Reviewed By:
              Mandy Chung
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: