Proposal: Automatic Resource Management (original) (raw)

Neal Gafter neal at gafter.com
Sat Mar 7 11:06:07 PST 2009


On Sat, Mar 7, 2009 at 11:04 AM, Stephen Colebourne <scolebourne at joda.org> wrote:

The proposal does allows the supressed exceptions to be checked immediately:

try (Writer w = open()) { // process } catch (IOException ex) { if (ex.getSuppressedExceptions() > 0) { // handle exceptions } } which is pretty neat.

It would be neat if you had a way of knowing ahead of time where this code needed to be put. I don't see how you could know it ahead of time.



More information about the coin-dev mailing list