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

(bf) Improve IndexOutOfBoundsException messages in $Type$Buffer classes

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 13
    • None
    • core-libs
    • b13
    • generic
    • generic

    Description

      A number of bounds checks are performed in the $Type$Buffer classes using the package-scope method java.nio.Buffer.checkBounds() which has an empty message:

          static void checkBounds(int off, int len, int size) { // package-private
              if ((off | len | (off + len) | (size - (off + len))) < 0)
                  throw new IndexOutOfBoundsException();
          }

      It would be better to have some more information on what failed, for example, to use java.util.Objects.checkFromIndexSize() instead.

      Attachments

        Activity

          People

            bpb Brian Burkhalter
            bpb Brian Burkhalter
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: