On Thu, 31 Jul 2025 13:58:48 GMT, Jaikiran Pai <j...@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