RFR: 8371226: Thread class description needs section on Thread Interruption

Pavel Rappo prappo at openjdk.org
Tue Nov 11 18:03:25 UTC 2025


On Tue, 11 Nov 2025 17:33:30 GMT, Alan Bateman <alanb at openjdk.org> wrote:

> I think that would be too much to try to put in the InterruptedException class description but we could potentially extend the sentence in the Thread Interruption section to include the case where someone chooses to add the InterruptedException as a suppressed exception.

Fair enough.
 
> I would prefer not get into further guidance for unwrapping, e.g. catch FooException, get the InterruptedException cause, clear the interrupted status before re-throwing the cause.

I agree. Besides, there's no cookie-cutter guidance for cases like that. For example, some exceptions in an exception graph can originate in another thread. It would be a mistake to interrupt one thread because it got an exception that is linked to InterruptedException from another thread.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28216#discussion_r2515140262


More information about the core-libs-dev mailing list