Exception transparency

Neal Gafter neal at gafter.com
Thu Jun 10 16:52:27 PDT 2010


On Thu, Jun 10, 2010 at 4:36 PM, maurizio cimadamore <
maurizio.cimadamore at oracle.com> wrote:

>  But due to a previously unreported compiler bug (I'm using javac version
>> 1.6.0_07), it won't compile anyway.  I'll be surprised if anyone can find
>> production code that compiles today and would break under a hypothetical
>> change to lub() for all type parameters that extend Throwable or a
>> subtype.
>>
>>
> The program I posted earlier in this thread compiles correctly under jdk 6
> and would fail with the proposed extension of dropping lub() in favor of
> disjunctive types for type-variables extending Throwable. It's clearly not
> production code, but it's something.


Agreed: you can't make much of a change without breaking some hypothetical
program.  But breakage that is only hypothetical isn't much to worry about.

I believe "extends Exception" and its ilk is more than enough of a hint to
the programmer what is intended without the addition of a further "throws"
keyword in the type parameter.


More information about the lambda-dev mailing list