8168841 The JavaDoc of java.util.stream.Collectors method collectingAndThen has incorrect code snippet

Stuart Marks stuart.marks at oracle.com
Mon Oct 31 22:04:53 UTC 2016


+1

On 10/31/16 2:58 PM, Paul Sandoz wrote:
> Hi,
>
> Please review the following JavDoc fix for j.u.stream.Collectors:: collectingAndThen.
>
> Thanks,
> Paul.
>
> diff -r 2e076c7e72d6 src/java.base/share/classes/java/util/stream/Collectors.java
> --- a/src/java.base/share/classes/java/util/stream/Collectors.java	Mon Oct 31 14:51:23 2016 -0700
> +++ b/src/java.base/share/classes/java/util/stream/Collectors.java	Mon Oct 31 14:55:16 2016 -0700
> @@ -508,7 +508,7 @@
>       * transformation.  For example, one could adapt the {@link #toList()}
>       * collector to always produce an immutable list with:
>       * <pre>{@code
> -     *     List<String> people
> +     *     List<String> list
>       *         = people.stream().collect(collectingAndThen(toList(), Collections::unmodifiableList));
>       * }</pre>
>       *
>


More information about the core-libs-dev mailing list