RFR: JDK-8200380 String::lines
Paul Sandoz
paul.sandoz at oracle.com
Fri May 18 17:47:21 UTC 2018
Hi Jim,
The Spliterators could be marginally improved:
- the package private constructor need not declare a cs argument, and can pass in the characteristics to the other constructor.
- the other constructor can be made private (i use this pattern just to signal that it is used internally) and be adjusted to take the fence directly, then you don’t need to subtract in the call and then add back in the constructor.
Given the two spliterators are almost identical in functionality it's tempting to provide an abstract implementation with two concrete implementation each providing their version of a getChar. Possibly not worth it.
Paul.
> On May 18, 2018, at 6:44 AM, Jim Laskey <james.laskey at oracle.com> wrote:
>
> String::lines instance method that returns a Stream<String> with elements composed of substrings from the original string delimited by any recognized new line character sequence.
>
> webrev: http://cr.openjdk.java.net/~jlaskey/8200380/webrev/index.html <http://cr.openjdk.java.net/~jlaskey/8200380/webrev/index.html>
> bug: https://bugs.openjdk.java.net/browse/JDK-8200380 <https://bugs.openjdk.java.net/browse/JDK-8200380>
> csr: https://bugs.openjdk.java.net/browse/JDK-8200425 <https://bugs.openjdk.java.net/browse/JDK-8200425>
>
>
More information about the core-libs-dev
mailing list