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

ArraysSupport.newLength doc, test, and exception message

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 17
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b13

      Description

      ArraysSupport.newLength is an internal method in jdk.internal.util that does safe array length computations.

      1) It throws OutOfMemoryError in certain cases. The message should include the details of the request (current length + required minimum growth) that could not be fulfilled.

      2) The doc comment is fairly verbose, yet it doesn't explain the method very well nor why it's useful. See the writeup here:

      http://mail.openjdk.java.net/pipermail/core-libs-dev/2020-June/066928.html

      This is part of a larger discussion on this thread:

      http://mail.openjdk.java.net/pipermail/core-libs-dev/2020-May/066844.html
      http://mail.openjdk.java.net/pipermail/core-libs-dev/2020-June/066865.html

      3) There is no unit test for this method. Given its intricacy, it should have one.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              smarks Stuart Marks
              Reporter:
              smarks Stuart Marks
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: