StructuredTaskScope.TimeoutException vs UncheckedTimeoutException
Pavel Rappo
pavel.rappo at gmail.com
Tue Oct 21 12:50:08 UTC 2025
As suggested in a PR thread [*], I bring this question to loom-dev:
I haven't been paying much attention to the recent previews of this
feature, so feel free to point me to a relevant discussion elsewhere.
As I understand it, an unchecked StructuredTaskScope.TimeoutException
was added in JDK 25. There's also the well-known checked
java.util.TimeoutException. I assume that the namesake exception was
added solely because it's unchecked. I also assume
UncheckedTimeoutException was considered at some stage, because in my
mind, the situation is similar to that of
IOException/UncheckedIOException.
Why did you choose to add a namesake instead of an unchecked wrapper
exception? Was it because you consider that the likelihood of mixing
the two TimeoutException's is low in the context of a single file?
-Pavel
[*]: https://github.com/openjdk/jdk/pull/27392#issuecomment-3426369195
More information about the loom-dev
mailing list