Checked exceptions

Andrew Haley aph at redhat.com
Tue Oct 15 09:00:46 UTC 2019


On 10/14/19 11:45 PM, Ryan Schmitt wrote:

> I'm curious to know what the current thinking is on checked
> exceptions. Is there agreement that the current situation is less
> than ideal? If so, how might they be addressed, and are they even
> enough of a problem to be worth addressing?

Opinions are divided, but when you ask experienced OpenJDK developers
about their least-favourite Java feature, checked exceptions are
likely to be high on the list. In hindsight, it would have been better
not to have them, at least in this form.

However, it's hard to see a good way to transition away from them. I
suppose we could simply declare exception specifications to be
optional in some future Java release, but it would be substantial work
for a lot of people and we'd have to very carefully review the
compatibility implications.

-- 
Andrew Haley  (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671


More information about the jdk-dev mailing list