RFR: JDK-8319123 : Implementation of JEP-461: Stream Gatherers (Preview) [v2]

Per Minborg pminborg at openjdk.org
Thu Nov 9 12:41:12 UTC 2023


On Thu, 9 Nov 2023 11:46:55 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> Yeah, I agree with @amaembo, I think it is important to keep the contract close to the caller.
>
> I don't mind either way - just wanted to note that the notion of blanket statements for `NullPointerException` is used in several areas ([java.util.logging](https://docs.oracle.com/en/java/javase/21/docs/api/java.logging/java/util/logging/package-summary.html), [java.net.http](https://docs.oracle.com/en/java/javase/21/docs/api/java.net.http/java/net/http/package-summary.html) ...). So there is an established precedent if you were inclined to go this route.

It is different in  `java.util.stream.Stream` and `Collector` and because `Gatherer` is more similar to `Collector` it might in fact be more consistent having the @throws NPE here.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16420#discussion_r1387940567


More information about the core-libs-dev mailing list