RFR: 8329829: HttpClient: Add a BodyPublishers.ofFileChannel method [v4]

Jaikiran Pai jpai at openjdk.org
Wed Jul 30 10:18:57 UTC 2025


On Wed, 30 Jul 2025 09:33:59 GMT, Volkan Yazici <vyazici at openjdk.org> wrote:

>> test/jdk/java/net/httpclient/FileChannelPublisherTest.java line 567:
>> 
>>> 565:                 String requestFailureMessage = requestFailure.getMessage();
>>> 566:                 assertTrue(
>>> 567:                         requestFailureMessage.contains("Unexpected EOF"),
>> 
>> Wouldn't this message be on the `ExecutionException`'s `getCause()`? instead of the `ExecutionException` itself?
>
> In fact, the message is from the `IOE` wrapped in a `UncheckedIOE` wrapped in the `ExecutionException`. I thought it would not matter from the perspective of the test. Nevertheless, in 99503c0bac7, I've updated the code to validate this causal chain and verify the message obtained from the `IOE`.

Thank you for this update to use the message from the underlying cause instance. This prevents the test from relying on which constructor of `ExecutionException` might have been used when throwing that exception from the `Future.get()` call.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26155#discussion_r2242173437


More information about the net-dev mailing list