On Tue, 4 Aug 2026 14:10:52 GMT, Volkan Yazici <[email protected]> wrote:

> Document that `java.net.http.HttpResponse#body()` can return null.
> 
> ---------
> - [X] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

src/java.net.http/share/classes/java/net/http/HttpResponse.java line 167:

> 165:      * @apiNote
> 166:      *
> 167:      * Exactly when {@code null} can be returned is implementation 
> dependent. It

I agree with @liach that the last sentence before the note makes the current 
note text a bit confusing. I'd suggest to update the note text as follows: 

Suggestion:

     * Depending on the response's {@linkplain #statusCode() status code} a 
body may not always
      * be available, and an implementation may return {@code null} in such 
cases.
      * Exactly when {@code null} can be returned is implementation dependent. 
It

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

PR Review Comment: https://git.openjdk.org/jdk/pull/32196#discussion_r3719731584

Reply via email to