Integrated: 8365086: CookieStore.getURIs() and get(URI) should return an immutable List

Jaikiran Pai jpai at openjdk.org
Sun Aug 10 04:25:22 UTC 2025


On Fri, 8 Aug 2025 13:28:50 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

> Can I please get a review of this change which proposes to address the issue noted in https://bugs.openjdk.org/browse/JDK-8365086?
> 
> `java.net.CookieStore` has some APIs which return a `java.util.List`. These API are specified to return an immutable `List`. The JDK ships an implementation of the `CookieStore` - the `java.net.InMemoryCookieStore`. The implementations of the `getURIs()` and `get(URI)` methods  in the `InMemoryCookieStore` currently return a `List` which is modifiable.
> 
> The changes in this PR fix those two method to return an immutable `List` to match the specification. A new regression test has been introduced to reproduce the issue and verify the fix.
> 
> I think this may not require a CSR since this fixes the implementation to match the already existing specification in `CookieStore`. I will create one if anyone suggests we should.

This pull request has now been integrated.

Changeset: 022e29a7
Author:    Jaikiran Pai <jpai at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/022e29a77533aacabd56820d00ecffa9646a8362
Stats:     127 lines in 2 files changed: 119 ins; 4 del; 4 mod

8365086: CookieStore.getURIs() and get(URI) should return an immutable List

Reviewed-by: liach, vyazici, dfuchs

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

PR: https://git.openjdk.org/jdk/pull/26698


More information about the net-dev mailing list