Exception transparency - lone throws (no checked exceptions)
Stephen Colebourne
scolebourne at joda.org
Thu Jun 17 15:47:12 PDT 2010
On 17 June 2010 22:52, Paul Benedict <pbenedict at apache.org> wrote:
> My only comment is on the the "catch throws" clause.
...
> Why doesn't Java relax its exception catching rules so that it's legal
> to catch undeclared checked exceptions? So the compiler cannot
> definitively prove the exception will be thrown, so what? It should be
> backwards compatible since it is illegal today, and it takes away this
> "catch throws" clause that is a bit hackish -- albeit necessary.
This is perfectly possible and not backwards incompatible as far as I
can see (it simply makes code that wouldn't compile today start to
compile.)
I would note that the catch side of checked exceptions is just as
important as the throws side to those that favour checked. Thats why I
chose the slightly less aggressive change with an additional keyword.
Were this proposal to be seriously considered, I'd expect that this
option would be very much on the table.
Stephen
More information about the lambda-dev
mailing list