On Thu, 9 Nov 2023 09:31:50 GMT, Tagir F. Valeev <tval...@openjdk.org> wrote:
>> src/java.base/share/classes/java/util/stream/Gatherer.java line 306: >> >>> 304: * @param <T> the type of input elements for the new gatherer >>> 305: * @param <R> the type of results for the new gatherer >>> 306: * @throws NullPointerException if the argument is null >> >> I think we can specify that gatherers are null averse in a single place as >> we do for Stream an the likes. Then we do not have to nag about @throws NPE > > I think it's still better to specify this for every method. Many developers > read the documentation only for the specific method they are going to call, > using IDE features like quick documentation. Yeah, I agree with @amaembo, I think it is important to keep the contract close to the caller. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16420#discussion_r1387727423