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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • None
    • core-libs
    • b49
    • Verified

        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.

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

                Created:
                Updated:
                Resolved: