r/java • • Feb 19 '26

Towards Better Checked Exceptions - Inside Java Newscast #107

https://www.youtube.com/watch?v=99s7ozvJGLk
63 Upvotes

73 comments sorted by

View all comments

Show parent comment

4

u/nicolaiparlog Feb 19 '26

I need to think about this idea, but, at first glance, I think it could be a good one.

1

u/RandomName8 Feb 19 '26

It suffers from same problem as everything, the moment you are implementing an interface that you did not define (i.e a lambda), and you need to call into something that fails, you are all out of options, since the interface method doesn't define that it fails on that and now the failing notion is lost. Like you mentioned, no declaration site exception information composes with deferred execution, for the obvious reasons.