diff -r 3ab9f0464a7d -r e25b317d0350 src/java.base/share/classes/java/util/stream/Collector.java --- a/src/java.base/share/classes/java/util/stream/Collector.java Thu Oct 03 08:51:40 2019 -0700 +++ b/src/java.base/share/classes/java/util/stream/Collector.java Thu Oct 03 18:59:56 2019 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,6 +33,10 @@ import java.util.function.Function; import java.util.function.Supplier; +// A compilation test for the code snippets in this class-level javadoc can be found at: +// test/jdk/java/util/stream/test/org/openjdk/tests/java/util/stream/CollectorExample.java +// The test needs to be updated if the examples in this javadoc change or new examples are added. + /** * A mutable reduction operation that * accumulates input elements into a mutable result container, optionally transforming @@ -154,7 +158,7 @@ * Performing a reduction operation with a {@code Collector} should produce a * result equivalent to: *
{@code
- *     R container = collector.supplier().get();
+ *     A container = collector.supplier().get();
  *     for (T t : data)
  *         collector.accumulator().accept(container, t);
  *     return collector.finisher().apply(container);