Details
-
Bug
-
Resolution: Fixed
-
P2
-
8
-
JDK8 b107 Windows7x64
-
b110
-
x86
-
windows_7
-
Verified
Description
Following code
public class Test {
public static void main(String[] args) {
"".codePoints().sorted().iterator().hasNext();
}
}
causes following output:
Exception in thread "main" java.lang.NegativeArraySizeException
at java.util.stream.SortedOps$SizedIntSortingSink.begin(SortedOps.java:367)
at java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.doAdvance(StreamSpliterators.java:159)
at java.util.stream.StreamSpliterators$IntWrappingSpliterator.tryAdvance(StreamSpliterators.java:357)
at java.util.Spliterators$2Adapter.hasNext(Spliterators.java:726)
at Test.main(Test.java:3)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:491)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
The minimized test is attached
public class Test {
public static void main(String[] args) {
"".codePoints().sorted().iterator().hasNext();
}
}
causes following output:
Exception in thread "main" java.lang.NegativeArraySizeException
at java.util.stream.SortedOps$SizedIntSortingSink.begin(SortedOps.java:367)
at java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.doAdvance(StreamSpliterators.java:159)
at java.util.stream.StreamSpliterators$IntWrappingSpliterator.tryAdvance(StreamSpliterators.java:357)
at java.util.Spliterators$2Adapter.hasNext(Spliterators.java:726)
at Test.main(Test.java:3)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:491)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
The minimized test is attached