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

ArraysSupport.newLength doc, test, and exception message

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 17
    • None
    • core-libs
    • None
    • b13

      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.

        There are no Sub-Tasks for this issue.

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

              Created:
              Updated:
              Resolved: