diff --git a/src/java.base/share/classes/java/util/concurrent/StructuredTaskScope.java b/src/java.base/share/classes/java/util/concurrent/StructuredTaskScope.java index fb16e0a615e..0088e486d4a 100644 --- a/src/java.base/share/classes/java/util/concurrent/StructuredTaskScope.java +++ b/src/java.base/share/classes/java/util/concurrent/StructuredTaskScope.java @@ -700,12 +700,12 @@ public sealed interface StructuredTaskScope * } * } * - * var joiner = Joiner.all(new CancelAfterTwoFailures()); + * var joiner = Joiner.allUntil(new CancelAfterTwoFailures()); * } * *

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. + * except that it yields a list of the completed subtasks. * {@snippet lang=java : * List> invokeAll(Collection> tasks) throws InterruptedException { * try (var scope = StructuredTaskScope.open(Joiner.allUntil(_ -> false))) {