Exception transparency - lone throws (no checked exceptions)

Florian Weimer fweimer at bfk.de
Thu Jun 10 09:26:47 PDT 2010


* Stephen Colebourne:

> Current checked exceptions are maintained, however users have the
> choice to effectively turn them off. Given many APIs already do this
> today (by wrapping checked exceptions in unchecked) this would
> probably be used beyond just lambdas. (Checked exceptions remain a
> religious issue for some - this change offers teams a choice as to how
> they are handled.)

It makes checked exception leaks official.  IIRC, there is already one
such leak (some reflection method not properly wrapping checked
exceptions), but a general, by-design loophole seems a different
matter.

However, I have to admit that the simplicity of this proposal is
rather tempting.  It would lead to many simplifications in existing
code, usually without sacrificing clarity.  It should even be possible
to retrofit existing APIs such as Runnable.  In that regard, it's
different from "throws Throwable".

-- 
Florian Weimer                <fweimer at bfk.de>
BFK edv-consulting GmbH       http://www.bfk.de/
Kriegsstraße 100              tel: +49-721-96201-1
D-76133 Karlsruhe             fax: +49-721-96201-99


More information about the lambda-dev mailing list