<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div dir="auto" style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">Dear maintainers,</div><p class="p3" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);"><br></p><p class="p1" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">I noticed a small issue in the <span class="s1">HttpClient</span> Javadoc that could confuse developers using the synchronous example.</p><p class="p3" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);"><br></p><p class="p1" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">In <span class="s3"><b>HttpClient.java (lines 96ā107)</b></span>, the synchronous example references an undefined <span class="s1">request</span> variable:</p><pre style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);"><code>HttpClient client = HttpClient.newBuilder()
.version(Version.HTTP_1_1)
.followRedirects(Redirect.NORMAL)
.build();
HttpResponse<String> response = client.send(request, BodyHandlers.ofString());
// ^^^^^ 'request' is not defined</code></pre><p class="p1" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">However, the asynchronous example immediately below (<span class="s1"><b>lines 111ā119</b></span>) correctly shows the <span class="s2">HttpRequest</span> creation:</p><pre style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);"><code>HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://foo.com/"))
.build();</code></pre><p class="p1" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">This discrepancy would cause a compilation error if someone copies the synchronous example directly.</p><p class="p1" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">Iād like to suggest adding the missing <span class="s1">HttpRequest</span> declaration to make the example complete and executable.</p><p class="p2" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);"><br></p><p class="p1" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">Would this change be acceptable?</p><p class="p1" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">Should I file a JBS issue for it?</p><p class="p2" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);"><br></p><p class="p1" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">Thank you,</p><p class="p3" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);"><b>Hyunsu Eun</b><b></b></p><p class="p1" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">GitHub: <a href="https://github.com/ehs208">ehs208</a></p></div></body></html>