On Thu, 27 Mar 2025 14:13:22 GMT, Jaikiran Pai <j...@openjdk.org> wrote:
>> The only use of `HttpConnection.id` is for ordering - so that connections >> can be placed in a ConcurrentSkipListSet. So maybe here we should not speak >> of ordering (remove the last sentence in that paragraph) - but I think it >> helps to keep it for `id`. > >> 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. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24154#discussion_r2016933117