JDK-8354468 : Release Note: New getChars(int, int, char[], int) Method in CharSequence and CharBuffer
  • Type: Sub-task
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 25
  • Priority: P4
  • Status: In Progress
  • Resolution: Unresolved
  • Submitted: 2025-04-12
  • Updated: 2025-06-12
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 25
25Unresolved
Description
The absolute bulk get method `getChars(int, int, char[], int)` has been added to read from any `CharSequence` into a provided character array. This method is more efficient than a loop over all characters. `String`, `StringBuilder` and `StringBuffer` are examples of `CharSequence` which already provided this method before. `CharBuffer` is an example of a `CharSequence` which now benefits from this unified API. Callers hence can now rely on unified fast-path access, and can abstain from class-specific optimizations.
Comments
Hello Markus [~mkarg], I forgot to review this release note. I had a look at it now. The title of the release note and the labels look fine. For the text of the release note, I took inputs from others and the suggestion was to make it a bit more concise as follows: "New method `getChars(int, int, char[], int)` has been added to `java.lang.CharSequence` and `java.nio.CharBuffer` to bulk-read characters from a region of a `CharSequence` into a region of a `char[]`. `String`, `StringBuilder`, and `CharBuffer` implement `CharSequence`. Code that operates on a `CharSequence` should no longer need to special-case and cast to `String` when needing to bulk-read from a sequence. The new method may be more efficient than a loop over characters of the sequence." Could you update the text to this and then mark the release note as "Resolved" -> "Delivered"?
12-06-2025