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

RandomXSpliterators report SIZED and SUBSIZED even if semantically non-finite

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 17, 18, 19, 20, 21, 22, 23, 24
    • core-libs
    • None

      There are several ways of obtaining Spliterators from random generators (Random::ints(…) etc) which do not have a user-supplied size, which means that they currently operate as though they have Long.MAX_VALUE elements, and report the characteristics SIZED and SUBSIZED.

      However, the documentation for SIZED states:

      ```
      Characteristic value signifying that the value returned from estimateSize() prior to traversal or splitting represents a finite size that, in the absence of structural source modification, represents an exact count of the number of elements that would be encountered by a complete traversal.
      ```

      The aforementioned Spliterators reporting SIZED and SUBSIZED seems to violate that specification.

            vklang Viktor Klang
            vklang Viktor Klang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: