RFR: 8360037: Refactor ImageReader in preparation for Valhalla support [v15]

David Beaumont duke at openjdk.org
Fri Aug 1 13:54:04 UTC 2025


On Thu, 31 Jul 2025 13:58:48 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

>> I don't think I can, can I? That method takes a Runnable, not some sort of Callable that throws E.
>
> The construct that Alan suggested works fine here. The fact that ImageReader.open() returns some value shouldn't matter here. I gave this a try locally and the use of `assertThrows(...)` with `ImageReader.open(...)` works as expected.

Ahh, I hadn't spotted that it's using a "ThrowingRunnable" type. I think my code completion might have picked up a different assertThrows() method when I looked at it. Ta for testing.
Sadly the failure message is lost now though.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26054#discussion_r2248035536


More information about the core-libs-dev mailing list