On Fri, 31 Oct 2025 10:22:06 GMT, EunHyunsu <[email protected]> wrote:
> Fixes JDK-8371009.
>
> The synchronous HttpClient example references `request` without defining it.
> This patch adds a minimal HttpRequest initialization immediately before the
> synchronous example (mirroring the asynchronous snippet) so the example
> compiles and runs as-is.
src/java.net.http/share/classes/java/net/http/HttpClient.java line 101:
> 99: * .uri(URI.create("https://foo.com/"))
> 100: * .build();
> 101: *
Thanks for working on this patch!
I would put the creation of the request after the creation of the client.
Logically you would create the client first.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28084#discussion_r2481023063