Proposal: Automatic Resource Management

Neal Gafter neal at
Mon Mar 9 13:06:49 PDT 2009

On Mon, Mar 9, 2009 at 11:16 AM, Joshua Bloch <jjb at> wrote:
> This URL should always point at the latest version:

The static exception analysis implied by the proposal's translation
doesn't match its dynamic semantics.  In the following program
snippet, the proposal requires an error message where shown, while the
dynamic semantics never allow the reported exception to occur.

    static BufferedReader getReader(String name) {
	// any implementation here
    public static void main(String[] args) {
	    try (BufferedReader localVar = getReader(args[0])) {
	        throw new NullPointerException(args[0]);
	    } // required language error: IOException not caught

More information about the coin-dev mailing list