RFR 8025002 "".codePoints().sorted().iterator().hasNext() causes NegativeArraySizeException

Alan Bateman Alan.Bateman at oracle.com
Thu Sep 19 08:37:34 UTC 2013

On 18/09/2013 19:27, Paul Sandoz wrote:
> Hi,
> Please review a fix for CharSequence.codePoints:
>    http://hg.openjdk.java.net/lambda/lambda/jdk/rev/e040a0dda7e4
> (That change set should apply cleanly to tl.)
> The incorrect spliterator characteristics were being reported when constructing the stream. Specifically it should not report SIZED/SUBSIZED.
> I added a quick test of the characteristics but we should probably add further tests using the stream test framework which would have most likely caught this error much earlier (since parallel evaluation should barf in certain cases). Plus there are more optimal impls that could be provided for String (even IIUC for codePoints if care is taken when splitting). All stuff to consider later on...
> Paul.
It is easy to get the characteristics wrong (or maybe this one was 
copied down from the chars methods). The change looks good to me.


More information about the core-libs-dev mailing list