On Thu, 27 Mar 2025 15:24:15 GMT, Daniel Fuchs <dfu...@openjdk.org> wrote:

>>> The only use of HttpConnection.id is for ordering - so that connections can 
>>> be placed in a ConcurrentSkipListSet.
>> 
>> I wasn't aware of that. Now that you mentioned it, I looked up the code 
>> which uses the Set to store these connections. And from what I can see, the 
>> order is only used during the closing of a HttpClient, to close these opened 
>> connections in that specific order. Did I miss any other usages of the order?
>> 
>> In any case, now that you corrected me about the usage of the `id` order, I 
>> agree that having the comment on the `id` field is fine and only remove it 
>> from the paragraph here.
>
> When we close a connection, we take it out of the set. So it's not about 
> ordering the connection but about quickly finding the connection in that set.

It was already a puzzler for me to figure out `id` cannot be used for `label`, 
and `label` cannot be used for `id` either. Both are due to the fact that 
`label` can be shared across instances, whereas `id` cannot. In short, I've 
found it very helpful to thoroughly document their these fields' properties and 
what they serve for. Unless you have a strong objection, I'd like to keep the 
current form of documentation.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24154#discussion_r2023538966

Reply via email to