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

List.spliterator should optimize for RandomAccess lists

    XMLWordPrintable

    Details

      Description

      The default implementation of List.spliterator() produces a spliterator from the list's iterator.

      If the List implementation implements RandomAccess then a spliterator can be produced that traverses elements using List.get and can therefore split efficiently (calls to List.get may be performed by multiple threads concurrently).

      Further if the List implementation extends from AbstractList then the modCount field can be used to support fail-fast behaviour.

        Attachments

          Activity

            People

            Assignee:
            psandoz Paul Sandoz
            Reporter:
            psandoz Paul Sandoz
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: