Skip to content

Commit d04d4ee

Browse files
turbanoffdfuch
authored andcommittedOct 12, 2021
8274894: Use Optional.empty() instead of ofNullable(null) in HttpResponse.BodySubscribers.discarding
Reviewed-by: dfuchs
1 parent 33050f8 commit d04d4ee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/java.net.http/share/classes/java/net/http/HttpResponse.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -1273,7 +1273,7 @@ public static <U> BodySubscriber<U> replacing(U value) {
12731273
* @return a response body subscriber
12741274
*/
12751275
public static BodySubscriber<Void> discarding() {
1276-
return new ResponseSubscribers.NullSubscriber<>(Optional.ofNullable(null));
1276+
return new ResponseSubscribers.NullSubscriber<>(Optional.empty());
12771277
}
12781278

12791279
/**

0 commit comments

Comments
 (0)
Please sign in to comment.