On Wed, 13 Nov 2024 10:37:19 GMT, Jaikiran Pai <j...@openjdk.org> wrote:
>> Daniel Fuchs has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update test/jdk/java/net/httpclient/http2/StreamFlowControlTest.java >> >> Co-authored-by: Andrey Turbanov <turban...@gmail.com> > > test/jdk/java/net/httpclient/lib/jdk/httpclient/test/lib/common/HttpServerAdapters.java > line 467: > >> 465: } >> 466: } >> 467: t.getResponseBody().close(); > > It's a `HttpTestExchange`, so we don't have clear defined semantics for what > happens when `HttpTestExchange.getResponseBody()` is invoked after the > response body is already `close()`d previously. I think it might be better to > move this `t.getResponseBody().close()` into the individual `case` blocks to > avoid calling `t.getResponseBody()` after the `case GET` already closes the > response body in its try-with-resources. OutputStream::close is supposed to be idempotent and I do believe it is in this implementation. It would be a bug if `getResponseBody().close()` were not. I have followed your suggestion though. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21991#discussion_r1840429878