RFR: 8284640: CollectorImpl class could be a record class

liach duke at openjdk.java.net
Wed Apr 27 22:04:12 UTC 2022


On Mon, 11 Apr 2022 13:08:43 GMT, altrisi <duke at openjdk.java.net> wrote:

> Changes the definition of `CollectorImpl` to be a record.

src/java.base/share/classes/java/util/stream/Collectors.java line 197:

> 195:      * @param <R> the type of the result
> 196:      */
> 197:     static record CollectorImpl<T, A, R>(Supplier<A> supplier,

Suggestion:

    record CollectorImpl<T, A, R>(Supplier<A> supplier,

[Nested records are implicitly static.](https://docs.oracle.com/javase/specs/jls/se18/html/jls-8.html#jls-8.10-220)

-------------

PR: https://git.openjdk.java.net/jdk/pull/8179


More information about the core-libs-dev mailing list