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

(bf) CharBuffer.getChars(int,int,char[],int) violates pre-existing specification

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2 P2
    • 26
    • 25, 26
    • core-libs
    • None
    • In Review
    • generic
    • generic

      The specification of CharBuffer [1] states:

      "The methods defined by CharSequence operate relative to the current position of the buffer when they are invoked."

      The method CharBuffer.getChars [2] is however specified to be an

      "Absolute bulk get method. "

      and interprets the source index parameters to be absolute. The implementation is consistent with this.

      To adhere to the previously existing specification, the getChars method should be specified to be a

      "Relative bulk get method. "

      and the implementation modified accordingly.

      [1] https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/nio/CharBuffer.html
      [2] https://download.java.net/java/early_access/jdk25/docs/api/java.base/java/nio/CharBuffer.html#getChars(int,int,char%5B%5D,int)

        1. CB.java
          1 kB
          Brian Burkhalter

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

              Created:
              Updated: