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

Typo in the comment of StructuredTaskScope#allUntil

XMLWordPrintable

      A DESCRIPTION OF THE PROBLEM :
      The comment of StructuredTaskScope#allUntil says:
               * <p> The following example uses {@code allUntil} to wait for all subtasks to
               * complete without any cancellation. This is similar to {@link #awaitAll()}
               * except that it yields a stream of the completed subtasks.
               * {@snippet lang=java :
               * <T> List<Subtask<T>> invokeAll(Collection<Callable<T>> tasks) throws InterruptedException {
               * try (var scope = StructuredTaskScope.open(Joiner.<T>allUntil(_ -> false))) {
               * tasks.forEach(scope::fork);
               * return scope.join().toList();
               * }
               * }
               * }

      But instead of a stream, the example below returns a list.


            alanb Alan Bateman
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: