On Wed, 20 Mar 2024 15:41:24 GMT, Daniel Fuchs <[email protected]> wrote:
>> Michael McMahon has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Update test/jdk/java/net/httpclient/GETTest.java >> >> Co-authored-by: Andrey Turbanov <[email protected]> > > src/java.net.http/share/classes/java/net/http/HttpResponse.java line 154: > >> 152: */ >> 153: public Optional<T> bodyWhen(Predicate<ResponseInfo> predicate) >> throws IOException; >> 154: > > I believe the method should be specified to close the body if it is closeable > and if it is not returned. I wasn't sure about that, because that effectively means this method can be called once only (in the case of closeable response bodies). But, maybe that is not unreasonable in those cases. I'll change as suggested. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/18227#discussion_r1532508165
