RFR: 8371009: HttpClient javadoc synchronous example missing HttpRequest variable declaration [v2]

EunHyunsu duke at openjdk.org
Sat Nov 1 15:53:01 UTC 2025


On Fri, 31 Oct 2025 12:58:39 GMT, EunHyunsu <duke at openjdk.org> 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.
>
> EunHyunsu has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Apply review suggestion: create client before request in HttpClient example

> > @Michael-Mc-Mahon I believe this change doesn't require a CSR since it's just fixing an example.
> > @ehs208 did you generate `make docs-jdk-api` and verify that the generated API documentation correctly displays the new changes?
> 
> I built the Javadoc locally using `make docs-jdk-api` and confirmed that the HttpClient example now renders correctly.
> 
> The `HttpRequest` declaration appears properly before the `send` call, matching the asynchronous example style in the generated docs.
> 
> <img alt="image" width="2000" height="1398" src="https://private-user-images.githubusercontent.com/109217208/508574310-f2b931e5-ee42-4dd6-8373-69010e85765b.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjIwMTE5MjEsIm5iZiI6MTc2MjAxMTYyMSwicGF0aCI6Ii8xMDkyMTcyMDgvNTA4NTc0MzEwLWYyYjkzMWU1LWVlNDItNGRkNi04MzczLTY5MDEwZTg1NzY1Yi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUxMTAxJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MTEwMVQxNTQwMjFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT05MDZjOGZmOWIzNDY5MDQzY2EzZWZmYjAzMGE5ZjQxMDIxYzk2ODdhMjk3ODlmZjdiMTc1NWMyMjYzZjA2YTcyJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.IjKox944B5wm2sDNgA3F-niVl1ZPIA1B0b5dLSuWsS4">
> (Attached is a screenshot from the generated docs:)

Upon checking again, I noticed that the asynchronous example is indented slightly more than the synchronous one.  
It appears that this difference already existed prior to my patch.  
Just wanted to confirm whether this is intentional or if we should align the indentation for consistency.

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

PR Comment: https://git.openjdk.org/jdk/pull/28084#issuecomment-3476475892


More information about the net-dev mailing list