try-with-resources and null resource

Stephen Colebourne scolebourne at joda.org
Mon Jan 24 12:24:39 PST 2011


On 24 January 2011 19:53, Rémi Forax <forax at univ-mlv.fr> wrote:
> On 01/24/2011 08:30 PM, Tim Peierls wrote:
>> On Mon, Jan 24, 2011 at 2:00 PM, Joe Darcy<joe.darcy at oracle.com>  wrote:
>>
>>> I think this stack trace can easily be explained to programmers by
>>> saying "the suppressed exception comes from the close call you did have
>>> to write yourself."
>>>
>> Agreed on all points, except I think you meant: s/did/didn't/
>
> Am I the only one to think that having a generated code that throw an
> exception lately is a bad idea ?

No you're not alone. Having the exception thrown at the first line
that the null is invalid would be preferable, as in enums.

The current behaviour isn't too bad, just non-optimal. For a new
feature, I'd prefer it was optimal.

Stephen



More information about the coin-dev mailing list