On Wed, 11 May 2022 08:54:48 GMT, Jaikiran Pai <j...@openjdk.org> wrote:

>> src/java.net.http/share/classes/java/net/http/HttpClient.java line 378:
>> 
>>> 376:          *
>>> 377:          * @implSpec The default implementation of this method throws
>>> 378:          * {@code UnsupportedOperationException}. {@code Builder}s 
>>> obtained
>> 
>> I think the implSpec here is correct, but will be confusing for most users. 
>> I'm not sure what value it adds. Do we really need it?
>
> Hello Michael,
> Most users will be using the `HttpClient.newBuilder()` to create the builder, 
> so this note about `UnsupportedOperationException` can be confusing. However, 
> for implementations (libraries?) which provide their  own implementation of 
> the `java.net.http.HttpClient.Builder`, I think, this note would be relevant. 
> This approach is similar to what we already have on 
> `java.net.http.HttpClient.newWebSocketBuilder()` method.

Sure, I just think when most developers read "The default implementation of 
this method throws UOE" they will think they can't use it without implementing 
something themselves. Library developers will figure it out anyway.

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

PR: https://git.openjdk.java.net/jdk/pull/6690

Reply via email to