Incorrect ranges in jdk.internal.util.ByteArray JavaDoc

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P5
    • 27
    • Affects Version/s: 26
    • Component/s: core-libs
    • None
    • master

      These look wrong to me:

      @throws IndexOutOfBoundsException if the provided {@code offset} is outside the range [0, array.length] => SHOULD BE array.length - 1?
      public static void setBoolean(byte[] array, int offset, boolean value)

      @throws IndexOutOfBoundsException if the provided {@code offset} is outside the range [0, array.length - 2] => SHOULD BE array.length - 4?
      public static void setFloat(byte[] array, int offset, float value)

      IndexOutOfBoundsException if the provided {@code offset} is outside the range [0, array.length - 2] => SHOULD BE array.length - 4?
      public static void setFloatRaw(byte[] array, int offset, float value)

      @throws IndexOutOfBoundsException if the provided {@code offset} is outside the range [0, array.length - 4] => SHOULD BE array.length - 8?
      public static void setLong(byte[] array, int offset, long value)

      @throws IndexOutOfBoundsException if the provided {@code offset} is outside the range [0, array.length - 2] => SHOULD BE array.length - 8?
      public static void setDouble(byte[] array, int offset, double value)

      @throws IndexOutOfBoundsException if the provided {@code offset} is outside the range [0, array.length - 2] => SHOULD BE array.length - 8?
      public static void setDoubleRaw(byte[] array, int offset, double value)

            Assignee:
            Per-Ake Minborg
            Reporter:
            Daniel Gredler
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: