RFR: 7105350: HttpExchange's attributes are the same as HttpContext's attributes [v16]
Jaikiran Pai
jpai at openjdk.org
Fri Oct 24 04:52:08 UTC 2025
On Wed, 22 Oct 2025 17:52:48 GMT, Josiah Noel <duke at openjdk.org> wrote:
>> Now ExchangeImpl will default to having a separate attribute map for the request duration.
>
> Josiah Noel has updated the pull request incrementally with one additional commit since the last revision:
>
> Update ExchangeAttributeTest.java
test/jdk/com/sun/net/httpserver/ExchangeAttributeTest.java line 115:
> 113: assertEquals("context-val", exchange.getHttpContext().getAttributes().get("attr"));
> 114: exchange.setAttribute("attr", "val");
> 115: assertEquals("val", exchange.getAttribute("attr"));
I think it would be good to add an additional assert after this line to verify that the call to `exchange.setAttribute("attr", "val");` doesn't change the value in the context attributes. So something like:
assertEquals("context-val", exchange.getHttpContext().getAttributes().get("attr"));
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27652#discussion_r2458882677
More information about the net-dev
mailing list