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

Better Spliterator implementations for String.chars() and String.codePoints()

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b49
    • Verification:
      Verified

      Backports

        Description

        CharSequence contains two default methods that return a Stream:

        - chars() for streaming over the sequence of characters (as ints)
        - codePoints() for streaming over the sequence of characters as code points (as ints)

        The default implementations for these streams provide source spliterators that split poorly.

        The methods can be overridden on String to provide better source spliterators, since the character array and size is known. The same applies to StringBuilder and StringBuffer.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                psandoz Paul Sandoz
                Reporter:
                psandoz Paul Sandoz
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: