Exception transparency - lone throws (no checked exceptions)
Reinier Zwitserloot
reinier at zwitserloot.com
Thu Jun 10 18:42:34 PDT 2010
Alex, exception transparency is obviously not about abstracting over the
types of checked exceptions that can be thrown by a method. Exception
transparency is about the ability to let the handling of a checked exception
thrown in a closure to be done by the containing method. As in, the
exception handling is transparent. Exception Transparency. Unless you'd like
to enshrine your particular definition as canon, but if that's the case, I
strongly suggest you pick a different name, and add it to the official spec.
The word "transparency" doesn't in any way suggest it's explicitly about
abstracting away an exception list. Perhaps "Exception Type Abstraction" or
some such would be a better name. That would be one of many ways to get to
exception transparency, and I believe the idea is that both I and Stephen
Colebourne agree that, while it is the most powerful way to do it between
these 3 proposals, it is also vastly more complicated. The extra power does
not warrant the extra complexity.
--Reinier Zwitserloot
On Thu, Jun 10, 2010 at 10:00 PM, Alex Buckley <alex.buckley at oracle.com>wrote:
> Exception transparency is about abstracting over the types of checked
> exceptions that can be thrown by a method.
>
> This proposal is not about exception transparency. This proposal is
> about _ignoring_ the checked exceptions that can be thrown by a method.
> You say yourself:
>
> On 6/10/2010 5:57 AM, Stephen Colebourne wrote:
> > Current checked exceptions are maintained, however users have the
> > choice to effectively turn them off.
>
> So, this proposal is about allowing checked exceptions to be turned off.
> And turned off in a very specific way: as per your response to Peter, if
> the caller doesn't care to catch anything from a 'lone throws' method,
> then the "checked" exception propagates up the call chain, and may be
> caught somewhere via a new 'lone catch' mechanism. Basically the same as
> wrapping checked exceptions in RuntimeExceptions, as proposed by
> http://bugs.sun.com/view_bug.do?bug_id=6534270.
>
> While I'm not especially fond of all the machinery around exception
> transparency, exception transparency _is_ what we want to provide.
>
> Alex
>
>
More information about the lambda-dev
mailing list