Skip to content

Commit

Permalink
Annotate Gatherer.default*.
Browse files Browse the repository at this point in the history
  • Loading branch information
cpovirk committed Oct 7, 2024
1 parent 98d5c86 commit d4eb452
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/java.base/share/classes/java/util/stream/Gatherer.java
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ default BiConsumer<A, Downstream<? super R>> finisher() {
* @return the instance of the default initializer
* @param <A> the type of the state of the returned initializer
*/
static <A> Supplier<A> defaultInitializer() {
static <A> Supplier<@Nullable A> defaultInitializer() {
return Gatherers.Value.DEFAULT.initializer();
}

Expand All @@ -301,7 +301,7 @@ static <A> Supplier<A> defaultInitializer() {
* @return the instance of the default combiner
* @param <A> the type of the state of the returned combiner
*/
static <A> BinaryOperator<A> defaultCombiner() {
static <A extends @Nullable Object> BinaryOperator<A> defaultCombiner() {
return Gatherers.Value.DEFAULT.combiner();
}

Expand All @@ -318,7 +318,7 @@ static <A> BinaryOperator<A> defaultCombiner() {
* @param <A> the type of the state of the returned finisher
* @param <R> the type of the Downstream of the returned finisher
*/
static <A, R> BiConsumer<A, Downstream<? super R>> defaultFinisher() {
static <A extends @Nullable Object, R extends @Nullable Object> BiConsumer<A, Downstream<? super R>> defaultFinisher() {
return Gatherers.Value.DEFAULT.finisher();
}

Expand Down

0 comments on commit d4eb452

Please sign in to comment.