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

ArraysSupport.newLength doc, test, and exception message

    XMLWordPrintable

Details

    • Enhancement
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • None
    • 17
    • core-libs
    • None
    • 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

              smarks Stuart Marks
              smarks Stuart Marks
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: