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

clarify specification of Spliterator.tryAdvance

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 21
    • None
    • core-libs
    • None

      The restrictions on the implementation of the tryAdvance() method aren't entirely clear. The behavior is specified from the perspective of the caller, which is reasonable, but the requirements on the implementation aren't very explicit. The implementation is required to do ONE of the following:

      1. call action.accept() ONCE and return true;

      or

      2. call action.accept() ZERO times and return false.

      Specifically, it is not allowed to call action.accept() two or more times and then to return true.

      The specification should be clarified with the above requirements.

            vklang Viktor Klang
            smarks Stuart Marks
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: