On throwing InterruptedException
Alan Bateman
alan.bateman at oracle.com
Thu Nov 6 09:33:45 UTC 2025
On 05/11/2025 23:10, Pavel Rappo wrote:
> And also this, which is a bit contrived but valid nonetheless:
>
> } catch (InterruptedException e) { // good
> throw new InterruptedException();
>
> }
>
The good/bad table is fun. For completeness you can also add the case
where someone restores the interrupt status and rethrows the
InterruptedException (or throws a new InterruptedException). It would be
strange to do this but no different to a double whammy where two parts
of the system are requesting you to cancel/finish-up around the same time.
-Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20251106/9b094c03/attachment-0001.htm>
More information about the core-libs-dev
mailing list